summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-01-10 13:37:38 +1000
committerDave Airlie <[email protected]>2011-01-11 08:32:33 +1000
commita988ddf3798e0ec568704e4a72b46030079c7e45 (patch)
treefb1472345ff57c82010bf2410b75afd2d496918c /src/mesa/main/teximage.c
parent31351dc029ff0e12a250e3ffc509f4f01e025a24 (diff)
mesa/swrast: handle sRGB FBOs correctly (v2)
From reading EXT_texture_sRGB and EXT_framebuffer_sRGB and interactions with FBO I've found that swrast is converting the sRGB values to linear for blending when an sRGB texture is bound as an FBO. According to the spec and further explained in the framebuffer_sRGB spec this behaviour is not required unless the GL_FRAMEBUFFER_SRGB is enabled and the Visual/config exposes GL_FRAMEBUFFER_SRGB_CAPABLE_EXT. This patch fixes swrast to use a separate Fetch call for FBOs bound to SRGB and avoid the conversions. v2: export _mesa_get_texture_dimensions as per Brian's comments. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 1e8626c7346..47d509396a7 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -932,8 +932,8 @@ _mesa_max_texture_levels(struct gl_context *ctx, GLenum target)
/**
* Return number of dimensions per mipmap level for the given texture target.
*/
-static GLint
-get_texture_dimensions(GLenum target)
+GLint
+_mesa_get_texture_dimensions(GLenum target)
{
switch (target) {
case GL_TEXTURE_1D:
@@ -1158,7 +1158,7 @@ _mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
img->TexFormat = format;
- dims = get_texture_dimensions(target);
+ dims = _mesa_get_texture_dimensions(target);
_mesa_set_fetch_functions(img, dims);
}