glx/drisw: Fix glXMakeCurrent(dpy, None, ctx)
authorAdam Jackson <ajax@redhat.com>
Thu, 9 Nov 2017 21:57:30 +0000 (16:57 -0500)
committerAdam Jackson <ajax@redhat.com>
Mon, 13 Nov 2017 15:39:48 +0000 (10:39 -0500)
This is perfectly legal in GL 3.0+.

Fixes piglit/glx-create-context-current-no-framebuffer.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
src/glx/drisw_glx.c

index 2f0675addb42a8065bf476702bebd5c2c867529e..df2467a5c2d0424699c53532056af115f0e7bfed 100644 (file)
@@ -255,11 +255,9 @@ drisw_bind_context(struct glx_context *context, struct glx_context *old,
 
    driReleaseDrawables(&pcp->base);
 
-   if (pdraw == NULL || pread == NULL)
-      return GLXBadDrawable;
-
    if ((*psc->core->bindContext) (pcp->driContext,
-                                 pdraw->driDrawable, pread->driDrawable))
+                                  pdraw ? pdraw->driDrawable : NULL,
+                                  pread ? pread->driDrawable : NULL))
       return Success;
 
    return GLXBadContext;