I have a GLES 3.2 program where a background thread uploads VBOs to a background gl context which are then provided to the render thread via context resource sharing. The command order in the upload thread is basically like this:
glDeleteSync ( if the fence variable is recycled )
glFenceSync ( for the new fence variable )
glClientWaitSync( fence, GL_SYNC_FLUSH_COMMANDS_BIT, 0 );
glBindBuffer (…, 0 )
Then the buffer and fence are passed to the main render thread which waits on fence via glWaitSync. However, after some runtime the render thread gets stuck in glWaitSync. Deep down in the driver it seems to stand in a sched_yield system call.
If I replace glClientWaitSync with regular glFlush it won’t get stuck.
Does anyone know this problem?
Ubuntu 18.04.5 LTS x64
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GT 1030/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 455.23.04