Reputation: 4244
I am new to iphone and haven't done any threading on it at all. It seems that calls to drawElements are taking a big chunk of my processing time, so it makes me think that a large amount of rendering is being done before the code is allowed to continue past the call.
does anyone know how the parallelism of openGL works? or how it works on the iphone? how much is done synchronously compared to asynchronously? is it worth making a rendering thread that queues all the calls to GL? is threading even that good on the iphone? or is it so terrible that even if it was a good idea in theory, the terrible threading means you should not bother? (not making a judgment, as I said, i haven’t tried threading at all on the iphone).
has anyone tried this before?
basically, is the cpu just sitting there doing nothing while the GPU does stuff with a call to DrawElements/Arrays?
Upvotes: 4
Views: 617
Reputation: 5701
OpenGL ES on iPhone is a bit of both: synchronous & asynchronous (deferred renderer). Each call consumes a small amount of CPU to move memory around and prepare the GPU, but you're right. The CPU is just sitting there sometimes, but when it is, the bus is typically saturated.
If you have other things that aren't too memory intensive, then you can probably get a small boost by running your calculations in a separate thread. I wouldn't suggest moving your rendering code and I'd really watch out for concurrent memory operations. RAM on iPhone is a big bottleneck for rendering as it is.
Upvotes: 2