Mesa (master): st/xlib: Do minimal version checking in glXCreateContextAttribsARB.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Thu Apr 24 19:40:43 UTC 2014


Module: Mesa
Branch: master
Commit: f438a824923342bc06f2d97a0aaf06b68e43e128
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f438a824923342bc06f2d97a0aaf06b68e43e128

Author: José Fonseca <jfonseca at vmware.com>
Date:   Thu Apr 24 15:49:01 2014 +0100

st/xlib: Do minimal version checking in glXCreateContextAttribsARB.

The current version checking is wrongly refusing to create 3.3 contexts;
unsupported version are checked elsewhere; and the DRI path doesn't do
this sort of checking neither.

This enables piglit glsl 3.30 tests to run without skipping.

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/state_trackers/glx/xlib/glx_api.c |   20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index 05880dd..d97cbd7 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -2724,26 +2724,8 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
    }
 
    /* check version (generate BadMatch if bad) */
-   switch (majorVersion) {
-   case 1:
-      if (minorVersion < 0 || minorVersion > 5)
-         return NULL;
-      break;
-   case 2:
-      if (minorVersion < 0 || minorVersion > 1)
-         return NULL;
-      break;
-   case 3:
-      if (minorVersion < 0 || minorVersion > 2)
-         return NULL;
-      break;
-   case 4:
-      if (minorVersion < 0 || minorVersion > 0)
-         return NULL;
-      break;
-   default:
+   if (majorVersion < 0 || minorVersion < 0)
       return NULL;
-   }
 
    if ((contextFlags & GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB) &&
        majorVersion < 3)




More information about the mesa-commit mailing list