From db59692c5a57a00ef25c5f0bdc60d32758537fd7 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 8 Jul 2021 15:31:18 +0200 Subject: [PATCH] Use glFlush instead of glFinish glFinish waits for all GPU rendering to complete. This can stall the rendering pipeline. In comparison, glFlush just inserts a synchronization barrier, which is enough for our usage. --- example/cube.c | 2 +- src/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/cube.c b/example/cube.c index f10d5b8..344d6b4 100644 --- a/example/cube.c +++ b/example/cube.c @@ -306,7 +306,7 @@ static void render_view(struct cube_xr_view *view, uint32_t time) { glm_mat4_mul(view->mvp_matrix, model_matrix, mvp_matrix); render_scene(time, mvp_matrix); - glFinish(); + glFlush(); zxr_composite_buffer_v1_attach_buffer( composite_buffer, view->view, buffer->buffer, diff --git a/src/main.c b/src/main.c index bf7393d..d041213 100644 --- a/src/main.c +++ b/src/main.c @@ -65,7 +65,7 @@ static XrResult wxrc_xr_view_push_frame(struct wxrc_xr_view *view, wxrc_gl_render_xr_view(server, view, xr_view, view->framebuffers[buffer_index], view->images[buffer_index].image, view->depth_buffer); - glFinish(); + glFlush(); r = xrReleaseSwapchainImage(view->swapchain, NULL); if (XR_FAILED(r)) { -- 2.45.2