My hardware is:
Quadro P2000 (notebook)
Driver version 411.63 Using OpenGL 4.5 (core)
We are developing a graphics engine.Till now we mapped buffer range to upload data to GPU.
Now we decided to try persistent mapping.Important to note that in our use case we must sync the data upload
before each next frame rendering. After initial tests we detected issue with the sync.
We tried GL_MAP_COHERENT_BIT and also glMemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT);. It doesn’t work…
To verify this is not problem with our usage of
the API we reverted back to regular range mapping - it worked.And also tried to force the GPU to accomplish all the commands with read out Frame buffer to CPU - it also fixed the issue.
Now the only direction we have is - the current version of the driver has a bug.
Here is what we do in the code:
glCreateBuffers(1, &buffer->handle);
glNamedBufferStorage(buffer->handle, buffer->size, data, GL_MAP_PERSISTENT_BIT | GL_MAP_WRITE_BIT | GL_MAP_COHERENT_BIT);
gpuPointer = glMapNamedBufferRange(buffer->handle, offset, buffer->size, GL_MAP_PERSISTENT_BIT | GL_MAP_WRITE_BIT | GL_MAP_COHERENT_BIT);
glBindBufferBase(buffer->target, index, buffer->handle);
//Then at some point later during execution we grab gpuPointer and update the data.
This specific buffer is responsible to hold MVP matrix array.And we can see the output with sporadically wrong transformation of different objects which is another indication that the issue with the sync.