summaryrefslogtreecommitdiff
path: root/src/glx/x11/dri_glx.c
diff options
context:
space:
mode:
authorJie Luo <clotho67@gmail.com>2008-04-08 19:17:06 -0400
committerKristian Høgsberg <krh@redhat.com>2008-04-08 19:17:06 -0400
commit2771862adcbc163c0a3f3eaaf4b58c658e72f680 (patch)
tree721460abbe89f1f51fed21cfc0da758673edc1cc /src/glx/x11/dri_glx.c
parentc016f329abb3d638442bf0b0f27d8f34ebf54f86 (diff)
Handle fbconfig comparison correctly for attributes the X server didn't send.
Diffstat (limited to 'src/glx/x11/dri_glx.c')
-rw-r--r--src/glx/x11/dri_glx.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c
index fd10047452..70873c2cc4 100644
--- a/src/glx/x11/dri_glx.c
+++ b/src/glx/x11/dri_glx.c
@@ -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;