vrend: call glFlush after glFenceSync.

I hit app stall frequently when running virgl on Windows/macOS, it
turned out virgl kept calling glClientWaitSync and just got timeout.
According to https://www.khronos.org/opengl/wiki/Sync_Object, the sync
object may never be signaled without proper flushing. This glFlush fixes
the stall issue on Windows/macOS.

Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Lepton Wu 7 years ago committed by Jakob Bornecrantz
parent 85675f35b0
commit 21bbc9ea2d
  1. 1
      src/vrend_renderer.c

@ -6062,6 +6062,7 @@ int vrend_renderer_create_fence(int client_fence_id, uint32_t ctx_id)
fence->ctx_id = ctx_id;
fence->fence_id = client_fence_id;
fence->syncobj = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
glFlush();
if (fence->syncobj == NULL)
goto fail;

Loading…
Cancel
Save