glx: Fix GLX_NV_float_buffer fbconfig handling

Since we didn't record this attribute from the server, we wouldn't
account for it in glXChooseFBConfig, and glXGetFBConfigAttrib wouldn't
know about it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14221>
This commit is contained in:
Adam Jackson 2021-06-16 14:01:04 -04:00 committed by Marge Bot
parent 108881cbcc
commit c77e5af7a3
4 changed files with 10 additions and 1 deletions

View File

@ -1035,6 +1035,7 @@ fbconfigs_compatible(const struct glx_config * const a,
MATCH_MASK(drawableType);
MATCH_MASK(renderType);
MATCH_DONT_CARE(sRGBCapable);
MATCH_DONT_CARE(floatComponentsNV);
/* 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.

View File

@ -186,10 +186,12 @@ glx_config_get(struct glx_config * mode, int attribute, int *value_return)
case GLX_Y_INVERTED_EXT:
*value_return = mode->yInverted;
return 0;
case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:
*value_return = mode->sRGBCapable;
return 0;
case GLX_FLOAT_COMPONENTS_NV:
*value_return = mode->floatComponentsNV;
return 0;
/* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX.
* It is ONLY for communication between the GLX client and the GLX

View File

@ -99,6 +99,9 @@ struct glx_config {
/* EXT_framebuffer_sRGB */
GLint sRGBCapable;
/* NV_float_buffer */
GLint floatComponentsNV;
};
extern GLint _gl_convert_from_x_visual_type(int visualType);

View File

@ -612,6 +612,9 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count,
if (fbconfig_style_tags)
bp++;
break;
case GLX_FLOAT_COMPONENTS_NV:
config->floatComponentsNV = *bp++;
break;
case None:
i = count;
break;