The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

VBO Test - glBufferData vs glBufferSubData vs glMapBufferOES

Hi,

I am John, and new to this forum. I want to start by saying, I love OpenGL ES. There are few things that the more I use, the more I fall in love with; C and OpenGL ES are among them.

Here is my question:
I have been doing a lot of tests for how I should setup the base rendering engine. Right now I am not using buffers, but had been considering them for quite a while. I have found that glMapBufferOES is slower then glBufferSubData which is slower then glBufferData; and I am wondering why that is.

To my understanding, glBufferSubData should always be faster then glBufferData because glBufferData reallocs the memory each time called, thus if your size doesn't change, use glBufferSubData otherwise use glBufferData. What I have found is that glBufferSubData runs about 68% the speed of only using glBufferData.

I also understand that glMapBufferOES is an extension, but I have found that it also runs slower then glBufferSubData or glBufferData. It, in fact, is the slowest way of updating vertex information.

Re: VBO Test - glBufferData vs glBufferSubData vs glMapBuffe

There might be inefficiencies in the implementation of glMapBuffers and glBufferSubData on the ipad. If things are optimal I would expect:

glMapBufferOES ? glBufferSubData ? glBufferData

Note, some driver will optimize the case of doing uploads with glBufferData if the size is the same as the previous, which allows skipping the re-allocation. You're likely hitting the optimized case. Otherwise, it would be much slower then glBufferSubData and glMapBuffers. You can try removing or adding one vertex each frame, and I bet you'd see a difference.