glx/drisw: Implement WaitX and WaitGL
authorAdam Jackson <ajax@redhat.com>
Thu, 18 Mar 2021 17:50:02 +0000 (13:50 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Mar 2021 15:43:49 +0000 (15:43 +0000)
My goodness.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9696>

src/glx/drisw_glx.c

index 4089f9f..5fe911f 100644 (file)
@@ -412,6 +412,18 @@ drisw_unbind_context(struct glx_context *context, struct glx_context *new)
 }
 
 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,
                    int buffer, const int *attrib_list)
@@ -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,
 };