From 9064d801a9acea56feeddc9edd6512245bd2055d Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 18 Mar 2021 13:50:02 -0400 Subject: [PATCH] glx/drisw: Implement WaitX and WaitGL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit My goodness. Reviewed-by: Dave Airlie Reviewed-by: Michel Dänzer Part-of: --- src/glx/drisw_glx.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 4089f9fa40c..5fe911f92f9 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -411,6 +411,18 @@ drisw_unbind_context(struct glx_context *context, struct glx_context *new) (*psc->core->unbindContext) (pcp->driContext); } +static void +drisw_wait_gl(struct glx_context *context) +{ + glFinish(); +} + +static void +drisw_wait_x(struct glx_context *context) +{ + XSync(context->currentDpy, False); +} + static void drisw_bind_tex_image(Display * dpy, GLXDrawable drawable, @@ -474,8 +486,8 @@ static const struct glx_context_vtable drisw_context_vtable = { .destroy = drisw_destroy_context, .bind = drisw_bind_context, .unbind = drisw_unbind_context, - .wait_gl = NULL, - .wait_x = NULL, + .wait_gl = drisw_wait_gl, + .wait_x = drisw_wait_x, .bind_tex_image = drisw_bind_tex_image, .release_tex_image = drisw_release_tex_image, };