summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-06-09 09:35:09 +0200
committerChristian König <[email protected]>2011-06-09 09:35:09 +0200
commit003401f95c9b59471c22368b7da16fe7a951e490 (patch)
treed21fa0197ff27b8a38bd8b1d795b74d816db8b26 /src/mesa/drivers/common/meta.c
parent00b4e48560f4d576b7b1924257322f5167e58c8d (diff)
parentd302804debeed13ced27fce222110c629e55d6f9 (diff)
Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts: src/gallium/tests/unit/u_format_test.c src/gallium/winsys/r600/drm/r600_hw_context.c
Diffstat (limited to 'src/mesa/drivers/common/meta.c')
-rw-r--r--src/mesa/drivers/common/meta.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 08b6024639f..979926a7e8f 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1186,6 +1186,8 @@ blitframebuffer_texture(struct gl_context *ctx,
const GLint maxLevelSave = texObj->MaxLevel;
const GLenum wrapSSave = texObj->Sampler.WrapS;
const GLenum wrapTSave = texObj->Sampler.WrapT;
+ const GLenum srgbSave = texObj->Sampler.sRGBDecode;
+ const GLenum fbo_srgb_save = ctx->Color.sRGBEnabled;
const GLenum target = texObj->Target;
if (drawAtt->Texture == readAtt->Texture) {
@@ -1217,6 +1219,14 @@ blitframebuffer_texture(struct gl_context *ctx,
}
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+
+ /* Always do our blits with no sRGB decode or encode.*/
+ if (ctx->Extensions.EXT_texture_sRGB_decode) {
+ _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
+ GL_SKIP_DECODE_EXT);
+ }
+ _mesa_Disable(GL_FRAMEBUFFER_SRGB_EXT);
+
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
_mesa_set_enable(ctx, target, GL_TRUE);
@@ -1278,6 +1288,12 @@ blitframebuffer_texture(struct gl_context *ctx,
}
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave);
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave);
+ if (ctx->Extensions.EXT_texture_sRGB_decode) {
+ _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, srgbSave);
+ }
+ if (ctx->Extensions.EXT_texture_sRGB_decode && fbo_srgb_save) {
+ _mesa_Enable(GL_FRAMEBUFFER_SRGB_EXT);
+ }
/* Done with color buffer */
mask &= ~GL_COLOR_BUFFER_BIT;