summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glx/glxcmds.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 7cdd42caf0..e256a078f1 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -1110,6 +1110,13 @@ init_fbconfig_for_chooser(__GLcontextModes * config,
} \
} while ( 0 )
+/* Test that all bits from a are contained in b */
+#define MATCH_MASK(param) \
+ do { \
+ if ((a->param & ~b->param) != 0) \
+ return False; \
+ } while (0);
+
/**
* Determine if two GLXFBConfigs are compatible.
*
@@ -1148,11 +1155,8 @@ fbconfigs_compatible(const __GLcontextModes * const a,
MATCH_DONT_CARE(stereoMode);
MATCH_EXACT(level);
- if (((a->drawableType & b->drawableType) == 0)
- || ((a->renderType & b->renderType) == 0)) {
- return False;
- }
-
+ MATCH_MASK(drawableType);
+ MATCH_MASK(renderType);
/* There is a bug in a few of the XFree86 DDX drivers. They contain
* visuals with a "transparent type" of 0 when they really mean GLX_NONE.