PDA

View Full Version : Mapping buffers optimisations



zedrummer
03-25-2014, 03:24 AM
Hello

1/ Is there any speed improvement in using glMapBufferRange rather than
glMapBuffer, considering that the transferred datas will be the same after?

2/ Let's say that I have a 2048x2048 VBO, is it more efficient to transfer the whole 2048x2048 floats in one memcpy(...) or is it the same to have several calls to memcpy(...) but transferring less data?

Thanks for your help
Cathy L.

Ilian Dinev
03-25-2014, 12:33 PM
A single glMapBuffer is more efficient afaik. The driver won't have to check for synchronization a thousand times.

zedrummer
03-26-2014, 04:00 AM
Ok so here are the results I got from internet and from my own experience:

1/ If you are going to map different buffers, it's better to glMapBuffer all of them at once, then sending/receiving datas in all of them, then glUnmapBuffer all of them at once.

2/ There are no difference of speed between glMapBuffer and glMapBufferRange.

3/ I really see a huge speed improvement in just sending the datas you need even with thousands of VBOmemorymapped[i]=xxxxx; rather than a big call to memcpy(VBOmemorymapped,xxx); (with a radeon 4870 512Mo, latest drivers)

Hope this will help
Cathy L.