I’ve got a setup where i render to an FBO and read back to host PBO using glReadPixels.
In order to not block the rendering thread with glMapBuffer im using FENCE_NV extension to check for status.
However, if I call glSetFenceNV after glReadPixels then glTestFenceNV will always return false, no matter how long I wait.
On the other hand if I put the glSetFenceNV before glReadPixels then everything works just fine, however the fence will only signal the status of the rendering, not the transfer back to host memory, glMapBuffer might still block.
Any ideas why it behaves like this?
It seems I have to call glFlush after glReadPixels, otherwise it will not work.