Handle fbconfig comparison correctly for attributes the X server didn't send.
authorJie Luo <clotho67@gmail.com>
Tue, 8 Apr 2008 23:17:06 +0000 (19:17 -0400)
committerKristian Høgsberg <krh@redhat.com>
Tue, 8 Apr 2008 23:17:06 +0000 (19:17 -0400)
src/glx/x11/dri_glx.c
src/glx/x11/glcontextmodes.c

index fd100474523adab90280455b854e8ce717bfeb53..70873c2cc41f7158b56620fc4f08fe713eb9739a 100644 (file)
@@ -520,13 +520,13 @@ static const struct { unsigned int attrib, offset; } attribMap[] = {
 static int
 scalarEqual(__GLcontextModes *mode, unsigned int attrib, unsigned int value)
 {
-    unsigned int driValue;
+    unsigned int glxValue;
     int i;
 
     for (i = 0; i < ARRAY_SIZE(attribMap); i++)
        if (attribMap[i].attrib == attrib) {
-           driValue = *(unsigned int *) ((char *) mode + attribMap[i].offset);
-           return driValue == value;
+           glxValue = *(unsigned int *) ((char *) mode + attribMap[i].offset);
+           return glxValue == GLX_DONT_CARE || glxValue == value;
        }
 
     return GL_TRUE; /* Is a non-existing attribute equal to value? */
@@ -572,7 +572,8 @@ driConfigEqual(const __DRIcoreExtension *core,
                glxValue |= GLX_TEXTURE_2D_BIT_EXT;
            if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT)
                glxValue |= GLX_TEXTURE_RECTANGLE_BIT_EXT;
-           if (glxValue != modes->bindToTextureTargets)
+           if (modes->bindToTextureTargets != GLX_DONT_CARE &&
+               glxValue != modes->bindToTextureTargets)
                return GL_FALSE;
            break;      
 
index 58c548a8fc114fdfa05ea2d34131d142c95fc52d..2a8e48d00d400774aeaeb1c1d3f86f78a477f275 100644 (file)
@@ -415,7 +415,7 @@ _gl_context_modes_create( unsigned count, size_t minimum_size )
       (*next)->bindToTextureRgb = GLX_DONT_CARE;
       (*next)->bindToTextureRgba = GLX_DONT_CARE;
       (*next)->bindToMipmapTexture = GLX_DONT_CARE;
-      (*next)->bindToTextureTargets = 0;
+      (*next)->bindToTextureTargets = GLX_DONT_CARE;
       (*next)->yInverted = GLX_DONT_CARE;
 
       next = & ((*next)->next);