This is something I've been struggling with for a while now:
I am streaming a lot of dynamic vertex data in a OpenGL 2.1/OpenGL ES 2 compatible renderer that is staying away from fixed function completley (in desktop GL 2.1 where there would still be the option). Now, as I have cpu-side state management I can swap on the fly between implementations using either Vertex Arrays or GPU-buffers and profile the separate paths/methods.
All is well, except that there is no way it seems I can get the vertex buffer updates using proper GL buffer objects as fast as the vertex array way, though theoretically it should come down to exactly about the same actions in the driver if I think about it:
- vertex array:
copy all the data from cpu memory to driver in glVertexAttribPointer
- vertex buffer:
copy all the data from cpu memory in glBufferSubData
I know this is of course rather dependent on the driver as well, but between a rather low-spec desktop machine and multiple versions of iPads, there is no way I can get the same times. The GPU buffer always loses.
I've been of course looking on the web and I tried everything I saw that I actually have available in the GL2-class spec (double/triple buffer, invalidating with null data first, etc.) to no avail. Also I am soon going to start the GL3/ES3 version which removes the vertex array option altogether, so this is going to have to be solved.
Any ideas? Appreciate all hints really! Maybe something extension based that isn't too badly supported?
Just want to mention I also tried various ways to "Map/MapRange", but none of the new fancy options to these are available to (vanilla) GL2/ES2 and (especially on the pads) these also always came in late in the profiling. I am obviously causing a sync somewhere but going double or triple and invalidation tricks just don't seem to make a difference so I am a bit lost for ideas
Edited by h3xl3r, 20 May 2014 - 09:44 AM.