diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-08-26 10:58:35 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-08-26 11:07:32 -0400 |
commit | fd94651fc3a6f49ec153ffb823b86c1d125bb298 (patch) | |
tree | 38970af6cc3c81a284440068c08e0e0ea0fe9d4e /glx | |
parent | 41bd8d5dfe27d5c91fe7e4cdba1475a2a0741b1c (diff) |
Fix driGetConfigAttribIndex unaligned access to GLboolean.
We don't actually send the float mode so just drop it. Drop a couple of
other unused or redundant fields from GLXconfig.
Diffstat (limited to 'glx')
-rw-r--r-- | glx/glxcmds.c | 8 | ||||
-rw-r--r-- | glx/glxdricommon.c | 16 | ||||
-rw-r--r-- | glx/glxscreens.h | 7 |
3 files changed, 8 insertions, 23 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c index aedbc02b0..0421026eb 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -906,7 +906,7 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc) p = 0; buf[p++] = modes->visualID; buf[p++] = glxConvertToXVisualType( modes->visualType ); - buf[p++] = modes->rgbMode; + buf[p++] = (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE; buf[p++] = modes->redBits; buf[p++] = modes->greenBits; @@ -958,7 +958,7 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc) return Success; } -#define __GLX_TOTAL_FBCONFIG_ATTRIBS (35) +#define __GLX_TOTAL_FBCONFIG_ATTRIBS (36) #define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2) /** * Send the set of GLXFBConfigs to the client. There is not currently @@ -1010,7 +1010,9 @@ DoGetFBConfigs(__GLXclientState *cl, unsigned screen) WRITE_PAIR( GLX_FBCONFIG_ID, modes->fbconfigID ); WRITE_PAIR( GLX_X_RENDERABLE, GL_TRUE ); - WRITE_PAIR( GLX_RGBA, modes->rgbMode ); + WRITE_PAIR( GLX_RGBA, + (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE ); + WRITE_PAIR( GLX_RENDER_TYPE, modes->renderType ); WRITE_PAIR( GLX_DOUBLEBUFFER, modes->doubleBufferMode ); WRITE_PAIR( GLX_STEREO, modes->stereoMode ); diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c index 3285835f0..faaa3b7ae 100644 --- a/glx/glxdricommon.c +++ b/glx/glxdricommon.c @@ -88,7 +88,6 @@ static const struct { unsigned int attrib, offset; } attribMap[] = { __ATTRIB(__DRI_ATTRIB_TRANSPARENT_GREEN_VALUE, transparentGreen), __ATTRIB(__DRI_ATTRIB_TRANSPARENT_BLUE_VALUE, transparentBlue), __ATTRIB(__DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE, transparentAlpha), - __ATTRIB(__DRI_ATTRIB_FLOAT_MODE, floatMode), __ATTRIB(__DRI_ATTRIB_RED_MASK, redMask), __ATTRIB(__DRI_ATTRIB_GREEN_MASK, greenMask), __ATTRIB(__DRI_ATTRIB_BLUE_MASK, blueMask), @@ -136,16 +135,11 @@ createModeFromConfig(const __DRIcoreExtension *core, while (core->indexConfigAttrib(driConfig, i++, &attrib, &value)) { switch (attrib) { case __DRI_ATTRIB_RENDER_TYPE: - if (value & __DRI_ATTRIB_RGBA_BIT) { + config->config.renderType = 0; + if (value & __DRI_ATTRIB_RGBA_BIT) config->config.renderType |= GLX_RGBA_BIT; - config->config.rgbMode = GL_TRUE; - } else if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) { + if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) config->config.renderType |= GLX_COLOR_INDEX_BIT; - config->config.rgbMode = GL_FALSE; - } else { - config->config.renderType = 0; - config->config.rgbMode = GL_FALSE; - } break; case __DRI_ATTRIB_CONFIG_CAVEAT: if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG) @@ -164,10 +158,6 @@ createModeFromConfig(const __DRIcoreExtension *core, if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT) config->config.bindToTextureTargets |= GLX_TEXTURE_RECTANGLE_BIT_EXT; break; - case __DRI_ATTRIB_FLOAT_MODE: - config->config.floatMode = (value ? GL_TRUE : GL_FALSE); - break; - default: setScalar(&config->config, attrib, value); break; diff --git a/glx/glxscreens.h b/glx/glxscreens.h index dfe7c9d0a..53bb009b7 100644 --- a/glx/glxscreens.h +++ b/glx/glxscreens.h @@ -58,16 +58,9 @@ void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs); typedef struct __GLXconfig __GLXconfig; struct __GLXconfig { __GLXconfig *next; - GLboolean rgbMode; - GLboolean floatMode; - GLboolean colorIndexMode; GLuint doubleBufferMode; GLuint stereoMode; - GLboolean haveAccumBuffer; - GLboolean haveDepthBuffer; - GLboolean haveStencilBuffer; - GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ GLuint redMask, greenMask, blueMask, alphaMask; GLint rgbBits; /* total bits for rgb */ |