In OpenGL Driver Monitor, we do see a number of things that seem to
go wrong,
- we see a large number of OpenGL contexts (> 150). Is that bad ?
OpenGL contexts use regular memory, so it's bad to have too many of
them, but not as bad as using a lot of VRAM (as there's much more RAM
than VRAM)
It seems that whenever we call [[QCRenderer alloc]
initWithOpenGLContext:openGLContext pixelFormat:format
file:QTZPath] it increments the number of OpenGL contexts by at
least 1, sometimes 4. Is that expected ? It confuses me a bit as we
pass the same OpenGL context around. FYI, we have about 30
QCRenderers in our test.
We looked at optimizing that and it might make it in a software
update, but for now, you'll have to live with it
- we see large waiting times (CPU Wait for GPU ).
- Video ram goes down quite quickly in that exemple. Has the number
of OpenGL contexts anything to do with it ?
not directly: it means you use a lot of textures
We then tried to reduce the number of QCRenderers (to about 9) by
recycling them. What we see is:
- number of OpenGL contexts goes down (from 150 to 32)
- CPU Wait for GPU goes down
- VideoRam is luch better
- but performance is bad, since the fact of recycling the
QCRenderers now requires to pass all input parameters (including
images) for each frame that we compute. This just kills us.
Try recycling your QCRenderers but passing the images as CGImageRef
or better CVPixelBufferRef: the internal caching should work better
than if you were to pass NSImages or CIImages.
________________________________________________________
Pierre-Olivier Latour email@hidden
Quartz Composer Team Apple Computer, Inc.