PDA

View Full Version : A little misunderstanding on the wiki



qnoper
03-29-2016, 10:26 AM
Hello !

I am not sure, but could it exist one little error there :
https://www.opengl.org/wiki/Buffer_Object#Persistent_mapping

On the write synchronization, it is wrote :
When you use a mapped pointer to write to a buffer, the data you write does not immediately become visible to OpenGL. It only becomes visible to OpenGL when you issue a glMemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BI T)​ call. Alternatively, if you map the buffer with GL_MAP_FLUSH_EXPLICIT_BIT, you can tell OpenGL that specific sections of the mapped range should become visible to OpenGL calls.

Since I agree with "flushing buffer", I disagree about GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT.
If I understand well the purpose of glMemoryBarrier, you have to tell it how you want to use the write after the barrier, so, according to me, this bit should be only set when you want to perform a read. Am I wrong?

Thanks !
Antoine

Alfonse Reinheart
03-29-2016, 10:44 AM
You know that Wiki's can be edited by anyone, right?

qnoper
03-29-2016, 10:47 AM
No I didn't know that, and I prefer to ask if I am right before to correct it or not ^^.