renderType = GLX_RGBA_TYPE;
} else if (config->renderType & GLX_COLOR_INDEX_BIT) {
renderType = GLX_COLOR_INDEX_TYPE;
- } else if (config->rgbMode) {
- /* If we're here, then renderType is not set correctly. Let's use a
- * safeguard - any TrueColor or DirectColor mode is RGB mode. Such
- * default value is needed by old DRI drivers, which didn't set
- * renderType correctly as the value was just ignored.
- */
- renderType = GLX_RGBA_TYPE;
- } else {
- /* Safeguard - only one option left, all non-RGB modes are indexed
- * modes. Again, this allows drivers with invalid renderType to work
- * properly.
- */
- renderType = GLX_COLOR_INDEX_TYPE;
}
#endif
* glXChooseVisual.
*/
if (fbconfig_style_tags) {
- config->rgbMode = GL_TRUE;
config->doubleBufferMode = GLX_DONT_CARE;
config->renderType = GLX_RGBA_BIT;
}
Bool fbconfig_style_tags)
{
int i;
- GLint renderType = 0;
if (!tagged_only) {
/* Copy in the first set of properties */
config->visualType = convert_from_x_visual_type(*bp++);
- config->rgbMode = *bp++;
+ config->renderType = *bp++ ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
config->redBits = *bp++;
config->greenBits = *bp++;
switch (tag) {
case GLX_RGBA:
- FETCH_OR_SET(rgbMode);
+ if (fbconfig_style_tags)
+ config->renderType = *bp++ ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
+ else
+ config->renderType = GLX_RGBA_BIT;
break;
case GLX_BUFFER_SIZE:
config->rgbBits = *bp++;
#endif
break;
case GLX_RENDER_TYPE: /* fbconfig render type bits */
- renderType = *bp++;
+ config->renderType = *bp++;
break;
case GLX_X_RENDERABLE:
config->xRenderable = *bp++;
}
}
- if (renderType != 0 && renderType != GLX_DONT_CARE) {
- config->renderType = renderType;
- config->floatMode = (renderType &
- (GLX_RGBA_FLOAT_BIT_ARB|GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT)) != 0;
- } else {
- /* If there wasn't GLX_RENDER_TYPE property, set it based on
- * config->rgbMode. The only way to communicate that the config is
- * floating-point is via GLX_RENDER_TYPE, so this cannot be a float
- * config.
- */
- config->renderType =
- (config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
- }
-
/* The GLX_ARB_fbconfig_float spec says:
*
* "Note that floating point rendering is only supported for
* GLXPbuffer drawables."
*/
- if (config->floatMode)
+ if (config->renderType &
+ (GLX_RGBA_FLOAT_BIT_ARB|GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT))
config->drawableType &= GLX_PBUFFER_BIT;
}