meta: Use _mesa_need_rgb_to_luminance_conversion() in decompress_texture_image()
authorAnuj Phogat <anuj.phogat@gmail.com>
Fri, 12 Jun 2015 21:58:46 +0000 (14:58 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Fri, 24 Jul 2015 17:48:59 +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 b7c91bfd65e9056da2af8ef287ea016edbb03d25..bde544ef490084259dfbf6d1a5fbd78140af0918 100644 (file)
@@ -3164,11 +3164,8 @@ decompress_texture_image(struct gl_context *ctx,
           /* If we're reading back an RGB(A) texture (using glGetTexImage) as
           * luminance then we need to return L=tex(R).
           */
-          ((baseTexFormat == GL_RGBA ||
-            baseTexFormat == GL_RGB  ||
-            baseTexFormat == GL_RG) &&
-          (destBaseFormat == GL_LUMINANCE ||
-           destBaseFormat == GL_LUMINANCE_ALPHA))) {
+          _mesa_need_rgb_to_luminance_conversion(baseTexFormat,
+                                                 destBaseFormat)) {
          /* Green and blue must be zero */
          _mesa_PixelTransferf(GL_GREEN_SCALE, 0.0f);
          _mesa_PixelTransferf(GL_BLUE_SCALE, 0.0f);