meta: Use _mesa_need_luminance_to_rgb_conversion() in decompress_texture_image()
authorAnuj Phogat <anuj.phogat@gmail.com>
Fri, 12 Jun 2015 00:23:34 +0000 (17:23 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Fri, 24 Jul 2015 17:48:58 +0000 (10:48 -0700)
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/common/meta.c

index 5c46efc45d37e4eaa098a6c3df25585be40187e3..b7c91bfd65e9056da2af8ef287ea016edbb03d25 100644 (file)
@@ -3159,16 +3159,8 @@ 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) &&
-           (destBaseFormat == GL_RGBA ||
-            destBaseFormat == GL_RGB ||
-            destBaseFormat == GL_RG ||
-            destBaseFormat == GL_GREEN ||
-            destBaseFormat == GL_BLUE ||
-            destBaseFormat == GL_BGRA ||
-            destBaseFormat == GL_BGR)) ||
+      if (_mesa_need_luminance_to_rgb_conversion(baseTexFormat,
+                                                 destBaseFormat) ||
           /* If we're reading back an RGB(A) texture (using glGetTexImage) as
           * luminance then we need to return L=tex(R).
           */