Mesa (master): glx/dri: add initial dri interface for GLX_EXT_framebuffer_sRGB.
Dave Airlie
airlied at kemper.freedesktop.org
Sun Mar 6 10:14:21 UTC 2011
Module: Mesa
Branch: master
Commit: 6538b5824e298eaebede2d9686c7607c44ab446a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6538b5824e298eaebede2d9686c7607c44ab446a
Author: Dave Airlie <airlied at redhat.com>
Date: Sun Mar 6 20:06:42 2011 +1000
glx/dri: add initial dri interface for GLX_EXT_framebuffer_sRGB.
This realigns the name of the glx bit to align with the core mesa names.
---
src/glx/dri_common.c | 4 +++-
src/glx/glxconfig.c | 4 ++--
src/glx/glxconfig.h | 2 +-
src/glx/glxext.c | 2 +-
src/mesa/drivers/dri/common/utils.c | 3 +++
5 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
index 83d6e3c..06a73e4 100644
--- a/src/glx/dri_common.c
+++ b/src/glx/dri_common.c
@@ -222,7 +222,9 @@ __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba),
__ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE,
bindToMipmapTexture),
- __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),};
+ __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),
+ __ATTRIB(__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE, sRGBCapable)
+};
static int
scalarEqual(struct glx_config *mode, unsigned int attrib, unsigned int value)
diff --git a/src/glx/glxconfig.c b/src/glx/glxconfig.c
index 805c301..c3e1d5a 100644
--- a/src/glx/glxconfig.c
+++ b/src/glx/glxconfig.c
@@ -189,7 +189,7 @@ glx_config_get(struct glx_config * mode, int attribute, int *value_return)
return 0;
case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:
- *value_return = mode->framebuffer_srgb_capable;
+ *value_return = mode->sRGBCapable;
return 0;
/* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX.
@@ -255,7 +255,7 @@ glx_config_create_list(unsigned count)
(*next)->bindToMipmapTexture = GLX_DONT_CARE;
(*next)->bindToTextureTargets = GLX_DONT_CARE;
(*next)->yInverted = GLX_DONT_CARE;
- (*next)->framebuffer_srgb_capable = GLX_DONT_CARE;
+ (*next)->sRGBCapable = GLX_DONT_CARE;
next = &((*next)->next);
}
diff --git a/src/glx/glxconfig.h b/src/glx/glxconfig.h
index a587612..2f1074c 100644
--- a/src/glx/glxconfig.h
+++ b/src/glx/glxconfig.h
@@ -102,7 +102,7 @@ struct glx_config {
GLint yInverted;
/* EXT_framebuffer_sRGB */
- GLint framebuffer_srgb_capable;
+ GLint sRGBCapable;
};
#define __GLX_MIN_CONFIG_PROPS 18
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 38622f3..e35dcb7 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -547,7 +547,7 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count,
break;
#endif
case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:
- config->framebuffer_srgb_capable = *bp++;
+ config->sRGBCapable = *bp++;
break;
case GLX_USE_GL:
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 42be77f..083edfa 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -648,6 +648,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
__DRI_ATTRIB_TEXTURE_1D_BIT |
__DRI_ATTRIB_TEXTURE_2D_BIT |
__DRI_ATTRIB_TEXTURE_RECTANGLE_BIT;
+
+ modes->sRGBCapable = GL_FALSE;
}
}
}
@@ -727,6 +729,7 @@ static const struct { unsigned int attrib, offset; } attribMap[] = {
__ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS, bindToTextureTargets),
__ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),
+ __ATTRIB(__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE, sRGBCapable),
/* The struct field doesn't matter here, these are handled by the
* switch in driGetConfigAttribIndex. We need them in the array
More information about the mesa-commit
mailing list