glx: Generate fewer errors in MakeContextCurrent
authorAdam Jackson <ajax@redhat.com>
Fri, 4 Oct 2013 13:25:51 +0000 (09:25 -0400)
committerAdam Jackson <ajax@redhat.com>
Tue, 8 Oct 2013 17:24:20 +0000 (13:24 -0400)
For a few reasons.

1: In the (current) common case, these conditionals are never true. All
we're doing by checking them is slowing down MakeCurrent.  The server
does these checks already anyway.

2: GLX >= 3.0 contexts may legally be made current without a bound
framebuffer.

This does not fix piglit/glx-create-context-current-no-framebuffer, but
is a prerequisite for fixing it.

Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
src/glx/glxcurrent.c

index 3d8893cf9afd17576c516024bbe520a7616d26f1..a6884cf8da295c1e26e571b8b850c8dc46b17f17 100644 (file)
@@ -231,16 +231,6 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
       return GL_FALSE;
    }
 
-   if (gc == NULL && (draw != None || read != None)) {
-      __glXGenerateError(dpy, (draw != None) ? draw : read,
-                         BadMatch, X_GLXMakeContextCurrent);
-      return False;
-   }
-   if (gc != NULL && (draw == None || read == None)) {
-      __glXGenerateError(dpy, None, BadMatch, X_GLXMakeContextCurrent);
-      return False;
-   }
-
    _glapi_check_multithread();
 
    __glXLock();