From e4ef724e06621be9325fc41ed886fd404467fdc0 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 31 Oct 2013 08:40:01 +0100 Subject: fontconfig glproto libX11 mesa xserver xkeyboard-config git update 31 oct 2013 xserver commit 902ff0b3497d202b86bf9a411e17db7b694d6eaa xkeyboard-config commit 70bbf18d6cddb7271db1b2e042765ace3c4ac485 libX11 commit 6cb02b166361200da35ba14f52cd9aaa493eb0ea glproto commit aacc7a51b6161c765b04524e0d2ab31e5e586834 fontconfig commit 525a135ccf53e4bf3363c3143d9cfdf15fba55ab mesa commit b16b3c8703f198ca0f025b730d582600df79c19c --- xorg-server/glx/glxdricommon.c | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) (limited to 'xorg-server/glx/glxdricommon.c') diff --git a/xorg-server/glx/glxdricommon.c b/xorg-server/glx/glxdricommon.c index 0ab3e3071..48f0bce21 100644 --- a/xorg-server/glx/glxdricommon.c +++ b/xorg-server/glx/glxdricommon.c @@ -36,6 +36,7 @@ #include #include #include "glxserver.h" +#include "glxext.h" #include "glxcontext.h" #include "glxscreens.h" #include "glxdricommon.h" @@ -127,6 +128,7 @@ createModeFromConfig(const __DRIcoreExtension * core, unsigned int visualType, unsigned int drawableType) { __GLXDRIconfig *config; + GLint renderType = 0; unsigned int attrib, value; int i; @@ -138,11 +140,14 @@ createModeFromConfig(const __DRIcoreExtension * core, while (core->indexConfigAttrib(driConfig, i++, &attrib, &value)) { switch (attrib) { case __DRI_ATTRIB_RENDER_TYPE: - config->config.renderType = 0; if (value & __DRI_ATTRIB_RGBA_BIT) - config->config.renderType |= GLX_RGBA_BIT; + renderType |= GLX_RGBA_BIT; if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) - config->config.renderType |= GLX_COLOR_INDEX_BIT; + renderType |= GLX_COLOR_INDEX_BIT; + if (value & __DRI_ATTRIB_FLOAT_BIT) + renderType |= GLX_RGBA_FLOAT_BIT_ARB; + if (value & __DRI_ATTRIB_UNSIGNED_FLOAT_BIT) + renderType |= GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT; break; case __DRI_ATTRIB_CONFIG_CAVEAT: if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG) @@ -171,11 +176,26 @@ createModeFromConfig(const __DRIcoreExtension * core, config->config.next = NULL; config->config.xRenderable = GL_TRUE; config->config.visualType = visualType; + config->config.renderType = renderType; config->config.drawableType = drawableType; return &config->config; } +static Bool +render_type_is_pbuffer_only(unsigned renderType) +{ + /* The GL_ARB_color_buffer_float spec says: + * + * "Note that floating point rendering is only supported for + * GLXPbuffer drawables. The GLX_DRAWABLE_TYPE attribute of the + * GLXFBConfig must have the GLX_PBUFFER_BIT bit set and the + * GLX_RENDER_TYPE attribute must have the GLX_RGBA_FLOAT_BIT set." + */ + return !!(renderType & (__DRI_ATTRIB_UNSIGNED_FLOAT_BIT + | __DRI_ATTRIB_FLOAT_BIT)); +} + __GLXconfig * glxConvertConfigs(const __DRIcoreExtension * core, const __DRIconfig ** configs, unsigned int drawableType) @@ -187,6 +207,14 @@ glxConvertConfigs(const __DRIcoreExtension * core, head.next = NULL; for (i = 0; configs[i]; i++) { + unsigned renderType = 0; + if (core->getConfigAttrib(configs[i], __DRI_ATTRIB_RENDER_TYPE, + &renderType)) { + if (render_type_is_pbuffer_only(renderType) && + !(drawableType & GLX_PBUFFER_BIT)) + continue; + } + /* Add all the others */ tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR, drawableType); @@ -197,6 +225,14 @@ glxConvertConfigs(const __DRIcoreExtension * core, } for (i = 0; configs[i]; i++) { + int renderType = 0; + if (core->getConfigAttrib(configs[i], __DRI_ATTRIB_RENDER_TYPE, + &renderType)) { + if (render_type_is_pbuffer_only(renderType) && + !(drawableType & GLX_PBUFFER_BIT)) + continue; + } + /* Add all the others */ tail->next = createModeFromConfig(core, configs[i], GLX_DIRECT_COLOR, drawableType); -- cgit v1.2.3