iosperformanceopengl-es-2.0wireframe

glDrawElements with GL_LINES forces gleRunVertexSubmitARM? (or: why drawing wireframes is slow on iOS?)


while doing some tests for a small project for iPhone/iPad that I'm working on, I observed that there is a big CPU performance penalty in drawing wireframes using glDrawElements with GL_LINES.

This is the scenario:

Then:

In both cases the models look as expected and no glErrors around...

It seems that the issue is device dependent. I experience it on an iPhone 3GS and iPhone 4, NOT on an iPad 2 nor the simulators. On an iPad 2 frame-time CPU = 1ms and no calls to gleRunVertexSubmitARM, on an iPhone 4 frame-time CPU = 12ms and continuous calls to gleRunVertexSubmitARM.

Can anyone explain this behaviour or point out what mistakes I might be making?

Any insight is highly appreciated. Thanks in advance,

Francesco


Solution

  • not an easy answer to a not easy question I would say.

    Anyway, the reason why 2 devices of the same "family" behave in different ways could depend on many factors.

    First of all, they mount different GPUs (I am very sure you know already it so, sorry to state the obvious) which brings the following differences:

    First of all, the latter is an evolution of the first with a much different throughput and a newer architecture.

    This alone does not anyway explain everything, the reason why you notice much more calls to gleRunVertexSubmitARM could be explained to the OpenGL driver implementation performed by PowerVR on its GPUs, most probably the SGX535 GPU driver performs the operations you require over an hook on that function.

    Last, but not least, performance wise, drawing with GL_LINES is most of the time very inefficient for several reasons:

    I hope to have helped you in some way.

    Ciao Maurizio