mesa/texcompress: correct mapping of S3TC formats in conversion function
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 26 Aug 2015 19:01:38 +0000 (12:01 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Mon, 31 Aug 2015 22:03:08 +0000 (15:03 -0700)
MESA_FORMAT_RGBA_DXT5 should actually be reserved for GL_RGBA[4]_DXT5_S3TC.
Also, Gallium and other dri drivers (radeon and nouveau) follow this mapping
scheme.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
src/mesa/main/texcompress.c

index bb94137a940ca4bee681951c8a145364d023ab6a..394c8bab2143a8ae6140758c13f56f03076f500b 100644 (file)
@@ -400,15 +400,15 @@ _mesa_glenum_to_compressed_format(GLenum format)
 
    case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
    case GL_RGB_S3TC:
+   case GL_RGB4_S3TC:
       return MESA_FORMAT_RGB_DXT1;
    case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
-   case GL_RGB4_S3TC:
       return MESA_FORMAT_RGBA_DXT1;
    case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
    case GL_RGBA_S3TC:
+   case GL_RGBA4_S3TC:
       return MESA_FORMAT_RGBA_DXT3;
    case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
-   case GL_RGBA4_S3TC:
       return MESA_FORMAT_RGBA_DXT5;
 
    case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: