glMapBuffer vs. client-stored datas
Hi,
I'm playing with vertex buffer objects, and am comparing mapped buffer and client-stored buffers.
For a mapped buffer, I call glBufferData() with NULL avoid sync problems, then I call glMapBuffer(), fill the buffer, then unmap it. It works perfectly, 390fps with a single textured quad on a Radeon X200M.
For a client-stored buffer, I create a buffer (new float[foo]), fill it, then call glBufferData(). It works too, with more than 470fps for the same scene.
On this scene, VBO is STATIC_DRAW, and of course, is never modified.
I thought client-stored buffer was useful only for frequently modified datas, but it seems there are faster anyway.
Does anyone knows why I should use mapped buffer, except to avoid datas in main memory ?
Thanks.
Hi Galdor,
I could not tell you a great deal about your question exactly.
However, from what I hear and read, I think it's unreasonable to be able to benchmark any application using "1 quad".
I think you should try this again, with a few hundred or even a thousands, and run several times, before you can have any kind of frame rate comparison.
Try something a little more intensive, and let us know the results [wink]
I could not tell you a great deal about your question exactly.
However, from what I hear and read, I think it's unreasonable to be able to benchmark any application using "1 quad".
I think you should try this again, with a few hundred or even a thousands, and run several times, before you can have any kind of frame rate comparison.
Try something a little more intensive, and let us know the results [wink]
I tested with the stanford bunny, 8100 tris, and have the same perfs (33fps on x200m), but this bunny has no index buffer, perhaps there's something related.
Anyway, I find this a bit strange.
Anyway, I find this a bit strange.
I find it strange too and unexpected. Mapping a buffer and filling it should be no different then glBufferData. Even using glBufferSubData should yeild same results.
Do you have up to date drivers?
It really depends on how ATI has coded their drivers. Perhaps they use glMapBuffer as a hint instead of actually looking at STATIC_DRAW
Do you have up to date drivers?
It really depends on how ATI has coded their drivers. Perhaps they use glMapBuffer as a hint instead of actually looking at STATIC_DRAW
Quote:Original post by Galdor
Hi,
I'm playing with vertex buffer objects, and am comparing mapped buffer and client-stored buffers.
For a mapped buffer, I call glBufferData() with NULL avoid sync problems, then I call glMapBuffer(), fill the buffer, then unmap it. It works perfectly, 390fps with a single textured quad on a Radeon X200M.
For a client-stored buffer, I create a buffer (new float[foo]), fill it, then call glBufferData(). It works too, with more than 470fps for the same scene.
On this scene, VBO is STATIC_DRAW, and of course, is never modified.
I thought client-stored buffer was useful only for frequently modified datas, but it seems there are faster anyway.
Does anyone knows why I should use mapped buffer, except to avoid datas in main memory ?
Thanks.
I don't think you really understand what's going on here. In both versions, you are not using client-side memory at all. When you unmap, data gets copied to some part of GPU-accessible memory. However, the same thing happens with glBufferData. Even more so, you can delete your own buffer (the one you allocated with new) immediately thereafter. In fact, I can't really explain the difference in framerate, but as darren_mfuk pointed out, one quad isn't really up to the test either. It could be pretty much anything, even external factors.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement