I can’t understand why this code is slow for the GPU on iOS, this code works fine on Windows without any problems.
Basically, what I do, I have one big dynamic vertex buffer (GL_STREAM_DRAW), and I'm trying to update only its parts, parts that should not overlap in one frame, so they should not cause flushes and the CPU should not wait for the graphic to complete processor, but it’s clearly not that I get about 10 frames per second on the iPhone 4 even when drawing only 10 to 20 triangles ... while I get more than 400 FPS on my PC with the same code ...
As you can see in the trace, I am reusing the same buffer, but I am sure that the updated parts do not overlap ... what can I do to improve performance?
Index trace
695 glBindBuffer (GL_ARRAY_BUFFER, 1u)
696 glBufferSubData (GL_ARRAY_BUFFER, 144l, 144l, 0x0453d090)
697 glBlendFunc (GL_SRC_ALPHA, GL_ZERO)
698 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
699 glActiveTexture (GL_TEXTURE0)
700 glBindTexture (GL_TEXTURE_2D, 12u)
701 glUseProgram (12ul)
702 glUniform4fv (uniform_000000001cd24950_12_0, 1, {0.0500000f, 0.0000000f, 0.0000000f, 0.0000000f})
703 glUniform4fv (uniform_000000001cd24950_12_1, 1, {0.0000000f, 0.0333333f, 0.0000000f, 0.0000000f})
704 glUniform4fv (uniform_000000001cd24950_12_2, 1, {0.0000000f, 0.0000000f, -0.0010010f, 0.0000000f})
705 glUniform4fv (uniform_000000001cd24950_12_3, 1, {-0.0000000f, 0.6333333f, -0.0010010f, 1.0000000f})
706 glDrawArrays (GL_TRIANGLES, 6, 6)
707 glBindBuffer (GL_ARRAY_BUFFER, 1u)
708 glBufferSubData (GL_ARRAY_BUFFER, 288l, 144l, 0x0453d120)