~sircmpwn/wxrc

db59692c5a57a00ef25c5f0bdc60d32758537fd7 — Simon Ser 3 years ago b5fb9b3 master
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.
2 files changed, 2 insertions(+), 2 deletions(-)

M example/cube.c
M src/main.c
M example/cube.c => example/cube.c +1 -1
@@ 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,

M src/main.c => src/main.c +1 -1
@@ 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)) {