diff options
author | marha <marha@users.sourceforge.net> | 2013-10-31 08:40:01 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-10-31 08:40:01 +0100 |
commit | e4ef724e06621be9325fc41ed886fd404467fdc0 (patch) | |
tree | be445314647f682fbb4a1e8b94aeb6ee79cede5f /xorg-server/glx/glxdricommon.c | |
parent | 270d3a1aa4137dc15d7b7e5a0958cc8c0bef9a1a (diff) | |
download | vcxsrv-e4ef724e06621be9325fc41ed886fd404467fdc0.tar.gz vcxsrv-e4ef724e06621be9325fc41ed886fd404467fdc0.tar.bz2 vcxsrv-e4ef724e06621be9325fc41ed886fd404467fdc0.zip |
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
Diffstat (limited to 'xorg-server/glx/glxdricommon.c')
-rw-r--r-- | xorg-server/glx/glxdricommon.c | 42 |
1 files changed, 39 insertions, 3 deletions
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 <GL/internal/dri_interface.h> #include <os.h> #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); |