diff options
author | Lepton Wu <lepton@chromium.org> | 2018-04-02 09:46:19 -0700 |
---|---|---|
committer | Jakob Bornecrantz <jakob@collabora.com> | 2018-04-03 13:53:43 +0100 |
commit | 21bbc9ea2d79884d8cd27bec9fef0852dbfa4ee7 (patch) | |
tree | 0e6a4d826887ccd9eaa93b9ccb03a6eb3e5c91e7 | |
parent | 85675f35b083f0d89274d9c0f4e11c2e58eb7725 (diff) |
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>
-rw-r--r-- | src/vrend_renderer.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index a676126..8e8f6f8 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; |