I would like to know how to use glBufferStorage without GL_MAP_COHERENT_BIT flag. If I remember correctly with that flag I don't have to glMemoryBarrier the buffer before reading or writing it. The problem is that I don't know how use glMemoryBarrier with glBufferStorage.
For example (C code):
Code :GLuint nUniformBuffer; glGenBuffers(1, &nUniformBuffer); glBindBuffer(GL_UNIFORM_BUFFER, nUniformBuffer); glBufferStorage(GL_UNIFORM_BUFFER, <buffer size>, NULL, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_CLIENT_STORAGE_BIT); GLvoid *pPointer = glMapBufferRange(GL_UNIFORM_BUFFER, 0, <buffer size>, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT); glBindBuffer(GL_UNIFORM_BUFFER, 0); // Do I have to glMemoryBarrier now? DoSomethingWith(pPointer); glDeleteBuffers(1, &nUniformBuffer);
How do I syncronize ARB_buffer_storage?