Jump to content

  • Log In with Google      Sign In   
  • Create Account

iPad 1 - OpenGL ES 2.0 batching mystery


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 pTymN   Members   -  Reputation: 464

Like
0Likes
Like

Posted 31 October 2012 - 11:36 AM

I've written what amounts to a random access video codec for my texture assets. Whenever the same GL texture handle is used in consecutive draw calls, my renderer automatically batches quads.

The original implementation calls glTexImage2D on textures from a pool for each loaded image. Images whose textures are not used by the end of the current frame are discarded for reuse. This was increasing my draw calls to ~70 per frame, mostly the fault of the drawn font strings (batched glyph quads). However, it does give me 29-34 fps according to the Instruments GL Driver profiler.

The implementation that I tried yesterday uses glTexSubImage2D to update portions of dynamically created atlases. Even though the draw call count dropped to ~10, and even though Instruments shows that my atlas rectangle choosing is not the cause of the slowdown, I am seeing a drop from ~30fps to ~22fps.

Is glTexImage faster than glTexSubImage? Does the iPad's tiled renderer hardware operate more efficiently with smaller textures? Would it be reasonable to expect that there are GPU caching issues in play and that the constant trimming down of in-memory GPU assets is making up the difference? Is there a possibility that if I queue up render calls in order to batch glTexSubImage calls, that my on-the-fly atlas approach could be faster?

I appreciate help from anyone with insight on how the particulars of the PowerVR SGX affects performance in my situation. Thank you so much for taking time to help me understand. Except for situations with some crazy multitexturing or complicated shaders, I haven't seen less draw calls be slower than so many more draw calls before.

 


Sponsor:

#2 joew   Crossbones+   -  Reputation: 3667

Like
0Likes
Like

Posted 31 October 2012 - 02:40 PM

Is glTexImage faster than glTexSubImage?

Yes and by large amounts as you have found out, as there is a lot of management and extra work that is done when issuing that call. If you are building an atlas dynamically the best way is using an FBO or depending on size using NEON intrinsics on the CPU size.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS