mesa: Remove transparency state from struct gl_config

We never set this to anything interesting, and this is really winsys
state not GL state anyway.

Nota bene: __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE is set to GLX_NONE
instead of the GLX_DONT_CARE we looked like we were doing before. This
is to preserve backward compatibility with older (technically, all
current) X servers, which when building their fbconfigs initialize a
field named 'transparentPixel' _twice_, and the second time from
__DRI_ATTRIB_TRANSPARENT_INDEX_VALUE, but then uses 'transparentPixel's
value for GLX_TRANSPARENT_TYPE. Which, GLX_DONT_CARE isn't a valid value
for that, so glx-fbconfig-sanity fails among much else.

This is harmless, in that I don't think any DRI driver has ever wired
this up (I can't find any evidence in r100 or mga history) and certainly
none that we can currently load have this working.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9817>
This commit is contained in:
Adam Jackson
2021-03-24 12:16:51 -04:00
committed by Marge Bot
parent c212283ef8
commit c17d35b402
2 changed files with 10 additions and 19 deletions

View File

@@ -350,13 +350,6 @@ driCreateConfigs(mesa_format format,
modes->stencilBits = stencil_bits[k];
modes->depthBits = depth_bits[k];
modes->transparentPixel = GLX_NONE;
modes->transparentRed = GLX_DONT_CARE;
modes->transparentGreen = GLX_DONT_CARE;
modes->transparentBlue = GLX_DONT_CARE;
modes->transparentAlpha = GLX_DONT_CARE;
modes->transparentIndex = GLX_DONT_CARE;
if (db_modes[i] == __DRI_ATTRIB_SWAP_NONE) {
modes->doubleBufferMode = GL_FALSE;
modes->swapMethod = __DRI_ATTRIB_SWAP_UNDEFINED;
@@ -466,12 +459,16 @@ driGetConfigAttribIndex(const __DRIconfig *config,
__ATTRIB(__DRI_ATTRIB_DOUBLE_BUFFER, doubleBufferMode);
__ATTRIB(__DRI_ATTRIB_STEREO, stereoMode);
__ATTRIB(__DRI_ATTRIB_AUX_BUFFERS, numAuxBuffers);
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_TYPE, transparentPixel);
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_INDEX_VALUE, transparentPixel);
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_RED_VALUE, transparentRed);
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_GREEN_VALUE, transparentGreen);
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_BLUE_VALUE, transparentBlue);
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE, transparentAlpha);
case __DRI_ATTRIB_TRANSPARENT_TYPE:
case __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE: /* horrible bc hack */
*value = GLX_NONE;
break;
case __DRI_ATTRIB_TRANSPARENT_RED_VALUE:
case __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE:
case __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE:
case __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE:
*value = GLX_DONT_CARE;
break;
case __DRI_ATTRIB_FLOAT_MODE:
*value = config->modes.floatMode;
break;

View File

@@ -182,12 +182,6 @@ struct gl_config
/* EXT_visual_rating / GLX 1.2 */
GLint visualRating;
/* EXT_visual_info / GLX 1.2 */
GLint transparentPixel;
/* colors are floats scaled to ints */
GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
GLint transparentIndex;
/* ARB_multisample / SGIS_multisample */
GLint sampleBuffers;
GLuint samples;