[virglrenderer-devel] [PATCH] vrend: call glFlush after glFenceSync.

Lepton Wu lepton at chromium.org
Mon Apr 2 16:46:19 UTC 2018


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.

Signed-off-by: Lepton Wu <lepton at chromium.org>
---
 src/vrend_renderer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 159ed09..fd65342 100644
--- a/src/vrend_renderer.c
+++ b/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;
-- 
2.17.0.rc1.321.gba9d0f2565-goog



More information about the virglrenderer-devel mailing list