st/mesa: add missing ETC2 entries to format_map
authorRob Clark <robclark@freedesktop.org>
Tue, 16 Feb 2016 16:43:38 +0000 (11:43 -0500)
committerRob Clark <robclark@freedesktop.org>
Tue, 16 Feb 2016 20:53:43 +0000 (15:53 -0500)
Noticed by Ilia when I was trying to figure out why some app was failing
to use ETC2.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/state_tracker/st_format.c

index 2b92bade4405f947c4534347285af36ead1d179b..82bf3a185add618b99c31c6c077fde2fd70f512d 100644 (file)
@@ -1484,6 +1484,48 @@ static const struct format_mapping format_map[] = {
       { PIPE_FORMAT_ETC1_RGB8, 0 }
    },
 
+   /* ETC2 */
+   {
+      { GL_COMPRESSED_RGB8_ETC2, 0 },
+      { PIPE_FORMAT_ETC2_RGB8, 0 }
+   },
+   {
+      { GL_COMPRESSED_SRGB8_ETC2, 0 },
+      { PIPE_FORMAT_ETC2_SRGB8, 0 }
+   },
+   {
+      { GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, 0 },
+      { PIPE_FORMAT_ETC2_RGB8A1, 0 }
+   },
+   {
+      { GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, 0 },
+      { PIPE_FORMAT_ETC2_SRGB8A1, 0 }
+   },
+   {
+      { GL_COMPRESSED_RGBA8_ETC2_EAC, 0 },
+      { PIPE_FORMAT_ETC2_RGBA8, 0 }
+   },
+   {
+      { GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, 0 },
+      { PIPE_FORMAT_ETC2_SRGBA8, 0 }
+   },
+   {
+      { GL_COMPRESSED_R11_EAC, 0 },
+      { PIPE_FORMAT_ETC2_R11_UNORM, 0 }
+   },
+   {
+      { GL_COMPRESSED_SIGNED_R11_EAC, 0 },
+      { PIPE_FORMAT_ETC2_R11_SNORM, 0 }
+   },
+   {
+      { GL_COMPRESSED_RG11_EAC, 0 },
+      { PIPE_FORMAT_ETC2_RG11_UNORM, 0 }
+   },
+   {
+      { GL_COMPRESSED_SIGNED_RG11_EAC, 0 },
+      { PIPE_FORMAT_ETC2_RG11_SNORM, 0 }
+   },
+
    /* BPTC */
    {
       { GL_COMPRESSED_RGBA_BPTC_UNORM, 0 },