mesa/st: do not fall back to uncompressed for rgtc
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 23 Aug 2022 12:48:39 +0000 (14:48 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 15 Sep 2022 08:16:01 +0000 (08:16 +0000)
This logic doesn't really do what it pretends to; we don't expose the
RGTC features unless we actually have RGTC support. This is about to
change, but for that logic to work, we need to be able to tell if we're
using a fallback-format or not, and we can't do that unless we keep the
format as RGTC.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Tested-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18248>

src/mesa/state_tracker/st_format.c

index 041d2c8..0762394 100644 (file)
@@ -582,20 +582,28 @@ static const struct format_mapping format_map[] = {
 
    /* compressed R, RG formats */
    {
-      { GL_COMPRESSED_RED, GL_COMPRESSED_RED_RGTC1, 0 },
+      { GL_COMPRESSED_RED, 0 },
       { PIPE_FORMAT_RGTC1_UNORM, PIPE_FORMAT_R8_UNORM, DEFAULT_RGBA_FORMATS }
    },
    {
+      { GL_COMPRESSED_RED_RGTC1, 0 },
+      { PIPE_FORMAT_RGTC1_UNORM, 0 }
+   },
+   {
       { GL_COMPRESSED_SIGNED_RED_RGTC1, 0 },
-      { PIPE_FORMAT_RGTC1_SNORM, DEFAULT_SNORM8_RGBA_FORMATS }
+      { PIPE_FORMAT_RGTC1_SNORM, 0 }
    },
    {
-      { GL_COMPRESSED_RG, GL_COMPRESSED_RG_RGTC2, 0 },
+      { GL_COMPRESSED_RG, 0 },
       { PIPE_FORMAT_RGTC2_UNORM, PIPE_FORMAT_R8G8_UNORM, DEFAULT_RGBA_FORMATS }
    },
    {
+      { GL_COMPRESSED_RG_RGTC2, 0 },
+      { PIPE_FORMAT_RGTC2_UNORM, 0 }
+   },
+   {
       { GL_COMPRESSED_SIGNED_RG_RGTC2, 0 },
-      { PIPE_FORMAT_RGTC2_SNORM, DEFAULT_SNORM8_RGBA_FORMATS }
+      { PIPE_FORMAT_RGTC2_SNORM, 0 }
    },
    {
       { GL_COMPRESSED_LUMINANCE, GL_COMPRESSED_LUMINANCE_LATC1_EXT, 0 },