diff options
author | marha <marha@users.sourceforge.net> | 2013-11-04 12:11:17 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-11-04 12:11:17 +0100 |
commit | d79b6645eb21ca82d506ef038b8ea71a1e431f3f (patch) | |
tree | 8f96f2c0492c134147a32e124ea5d0a7337b2242 /xorg-server/glx/glxdricommon.c | |
parent | feb35c5e0724010fc4431e4e4fb24720fcdffe80 (diff) | |
parent | e4ef724e06621be9325fc41ed886fd404467fdc0 (diff) | |
download | vcxsrv-d79b6645eb21ca82d506ef038b8ea71a1e431f3f.tar.gz vcxsrv-d79b6645eb21ca82d506ef038b8ea71a1e431f3f.tar.bz2 vcxsrv-d79b6645eb21ca82d506ef038b8ea71a1e431f3f.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
fontconfig glproto libX11 mesa xserver xkeyboard-config git update 31 oct 2013
Conflicts:
xorg-server/glx/dispatch.h
xorg-server/glx/glapi.c
xorg-server/glx/glapi.h
xorg-server/glx/glapi_gentable.c
xorg-server/glx/glapitable.h
xorg-server/glx/glprocs.h
xorg-server/glx/glxcmdsswap.c
xorg-server/glx/glxdri.c
xorg-server/glx/glxext.c
xorg-server/glx/glxext.h
xorg-server/glx/indirect_dispatch.c
xorg-server/glx/indirect_dispatch.h
xorg-server/glx/indirect_dispatch_swap.c
xorg-server/glx/indirect_reqsize.c
xorg-server/glx/indirect_reqsize.h
xorg-server/glx/indirect_size.h
xorg-server/glx/indirect_size_get.c
xorg-server/glx/indirect_size_get.h
xorg-server/glx/indirect_table.c
xorg-server/glx/indirect_texture_compression.c
xorg-server/glx/render2.c
xorg-server/glx/render2swap.c
Diffstat (limited to 'xorg-server/glx/glxdricommon.c')
-rw-r--r--[-rwxr-xr-x] | 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 bf77211d2..15ce1eee2 100755..100644 --- a/xorg-server/glx/glxdricommon.c +++ b/xorg-server/glx/glxdricommon.c @@ -40,6 +40,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" @@ -140,6 +141,7 @@ createModeFromConfig(const __DRIcoreExtension * core, unsigned int visualType, unsigned int drawableType) { __GLXDRIconfig *config; + GLint renderType = 0; unsigned int attrib, value; int i; @@ -151,11 +153,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) @@ -184,11 +189,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) @@ -200,6 +220,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); @@ -210,6 +238,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); |