Bool fbconfig_style_tags)
{
int i;
+ GLint renderType = 0;
if (!tagged_only) {
/* Copy in the first set of properties */
config->drawableType |= GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT;
#endif
break;
- case GLX_RENDER_TYPE:
- config->renderType = *bp++;
+ case GLX_RENDER_TYPE: /* fbconfig render type bits */
+ renderType = *bp++;
break;
case GLX_X_RENDERABLE:
config->xRenderable = *bp++;
}
}
- config->renderType =
- (config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
+ 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)
+ config->drawableType &= ~(GLX_WINDOW_BIT|GLX_PIXMAP_BIT);
}
static struct glx_config *
else if (*parselist & GLX_COLOR_INDEX_BIT) {
rgb_flag = GL_FALSE;
}
+ else if (*parselist & (GLX_RGBA_FLOAT_BIT_ARB|GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT)) {
+ rgb_flag = GL_TRUE;
+ }
else if (*parselist == 0) {
rgb_flag = GL_TRUE;
}
case GLX_RENDER_TYPE_SGIX:
if (!fbconfig)
return GLX_BAD_ATTRIBUTE;
- if (xmvis->mesa_visual.rgbMode)
+ if (xmvis->mesa_visual.floatMode)
+ *value = GLX_RGBA_FLOAT_BIT_ARB;
+ else if (xmvis->mesa_visual.rgbMode)
*value = GLX_RGBA_BIT;
else
*value = GLX_COLOR_INDEX_BIT;