iphone - glDrawElements massive cpu usage on iOS -
Hardware: iPad 2 software: OpenGL ES 2.0 C ++
About 25% of glDrawElements P.U. When I do not use an index buffer and does not use glDrawArrays, then this speed and glDrawArrays appear on the Barley Profiler. Everything else is the same, more of the glDrawArrays because I have to duplicate in VBOX in duplicate without index buffer for copy.
So far:
- Almost the same state changes between two ways
- The top structure is two floats (8 bytes).
- IndexBuffer is 16 beats (tried with 32 bit)
- GL_SATIC_DRAW for both buffers <
- Do not change buffers after load
- The same VBO and IndexBuffer render frames many times, with different offset and size
- No open-gull errors
It seems that It's a fallback of some kind of software, but I do not know how to cause OpenGL to fallback.
There are some things that come in immediate attention which can affect the speed you have described. .
For one, several commands are released in an effortless manner to reduce the number of bus transfers. They are queued and wait for the next batch transfer. Changes in the state, texture changes, and all such orders are deposited. It is possible that the draw commands are triggering a large transfer in one case, but not in the other, or you are transferring it more often in one case or the other. For the second, your specific model can be better organized for one or the other call calls. You need to see how big they are, if they are re-indexing the values, and if they are optimized for the rendering or revised GlDrawArrays may need more data to move, but if your models Overhead can not be over-anxiety if it's small. Draw Frequency becomes important because you want to turn off the call often to keep the card busy and let your CPU do other things, you do not want to just submit it in waiting for the buffer to send, but to balance it It is necessary that there is a cost with those transfers and to stop it, often indexed values benefit from the cache effect, when they are often reused, lake Not linear as ways of accessing arrays is reached as can benefit from cache effects, when they linear, so you have different data benefits need to know your data for different types.
Even using Apple to be sure seems unsure.
I77 was written earlier for that version and:
Displaying the best, presented your models as as a single inner triangle strip Which should use glDrawArrays with some duplicate ones as possible. If your models require many repeating corners (...), you can get better performance using a separate index buffer and calling glDrawElements ... for best results Test your models using both indexed and unindexed triangle strips, and use the fastest performance.
But their updates, which apply to iOS 8, provide the opposite:
For best performance, your models have a single indexed triangle Should be presented in the form. To avoid specifying the data for the same header in the top buffer, use Use a different index buffer and drag the triangle strip by using the glDrawElements function
It seems that in your case you have tried both yet, and found that a method is better suited for your data.
Comments
Post a Comment