summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/common/meta.c')
-rw-r--r--src/mesa/drivers/common/meta.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index ca10bbe81f6..826f2239d11 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3159,9 +3159,16 @@ decompress_texture_image(struct gl_context *ctx,
* returned as red and two-channel texture values are returned as
* red/alpha.
*/
- if ((baseTexFormat == GL_LUMINANCE ||
- baseTexFormat == GL_LUMINANCE_ALPHA ||
- baseTexFormat == GL_INTENSITY) ||
+ if (((baseTexFormat == GL_LUMINANCE ||
+ baseTexFormat == GL_LUMINANCE_ALPHA ||
+ baseTexFormat == GL_INTENSITY) &&
+ (destBaseFormat == GL_RGBA ||
+ destBaseFormat == GL_RGB ||
+ destBaseFormat == GL_RG ||
+ destBaseFormat == GL_GREEN ||
+ destBaseFormat == GL_BLUE ||
+ destBaseFormat == GL_BGRA ||
+ destBaseFormat == GL_BGR)) ||
/* If we're reading back an RGB(A) texture (using glGetTexImage) as
* luminance then we need to return L=tex(R).
*/