Commit edb5253d authored by Kristian Høgsberg's avatar Kristian Høgsberg
Browse files

glx: Fix config chooser logic for 'mask' matching

When matching attributes using the 'mask' matching criteria, the spec
says that

  "Only GLXFBConfigs for which the set bits of attribute include all
   the bits that are set in the requested value are
   considered. (Additional bits might be set in the attribute)."

The current test returns true if the two bit masks have bits in
common, specifically it matches even if the requested value has bits
set that are not set in the fbconfig attribute.  For example, an
application asking for


as glxpbdemo does, will match fbconfigs that don't support pbuffer
rendering, as long as they support pixmap rendering.
Reviewed-by: default avatarIan Romanick <>
parent ba81b074
......@@ -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,
if (((a->drawableType & b->drawableType) == 0)
|| ((a->renderType & b->renderType) == 0)) {
return False;
/* 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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment