I played a bit with Performer and added 2 more image inputs to the
Mixer.qtz composition, then modified the code to add 2 more Media
Sources feeding these new inputs. When the 4 inputs are
CompositionSources, that is all 4 inputs are generated by
QCRenderers, then I see the same drop of performance to only 15 fps
(2Ghz dual core Mac)...even if I use the simple Spectrum.qtz
composition on all 4 inputs. CPU metering shows only 8% of CPU usage.
Of course, Performer uses multiple buffer pools (one in each
CompositionSource) and 1 OpenGL context per compositionSource. So I
went ahead and did some further modifications to use only one pool
and 1 offline context.
But it does not really improve things...
I am a bit surprised by this result. I will look at the Open GL
Driver Monitor...but my firsts tests weren't displaying anything in
the view...not sure what I was doing wrong.
Is there any other way to do this more efficiently.
Thanks
Matthieu
On 18 May 2006, at 20:03, Pierre-Olivier Latour wrote:
We have set up a rendering framework based on Quartz Composer
where we use the image output generated by some compositions as
inputs to other compositions ,etc...
We have one object, let's call it ImageProducer, that maintains a
list of QCRenders and asks them to render their composition in a
specific OpenGL context. Then we arrach a CVOpenGLBufferRef (taken
from a pool, as in the Performer example) to the GLContext, call
glFlush and get our renderer image. This image, along with some
others calculated in parallel are then sent as inputs to the
QCRenderers of other ImageProducers, and so on.
We were hoping that dealing with CVOpenGLBufferRef would keep all
images in the Graphics Card memory and in order to get optimal
performances.
First results are quite promising with only a few producers, but
when we increase their number , we get a sudden drop of
performances from 60fps to 5fps.
You might be using too much VRAM at which point, data starts being
paged-out / paged-in from VRAM, which is pretty slow
In general you want to:
1) use a single CVOpenGLBufferPool
2) use two GL contexts (one for the display on screen and the other
one for drawing to the CVOpenGLBuffers)
3) draw into a CVOpenGLBuffer using this sequence: attach GL
context, call QCRenderer, flush, detach
4) OpenGL Driver Monitor in Performance Tools is the app you want
to monitor VRAM and what the GPU does
________________________________________________________
Pierre-Olivier Latour email@hidden
Quartz Composer Team Apple Computer, Inc.