Module: Mesa
Branch: main
Commit: f25875ce180573fccd46dcc693c4331c80b51401
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f25875ce180573fccd46dcc693c4331c80b51401

Author: Erik Faye-Lund <[email protected]>
Date:   Tue Aug 23 14:48:39 2022 +0200

mesa/st: do not fall back to uncompressed for rgtc

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 <[email protected]>
Acked-by: Eric Engestrom <[email protected]>
Tested-by: Eric Engestrom <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18248>

---

 src/mesa/state_tracker/st_format.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/mesa/state_tracker/st_format.c 
b/src/mesa/state_tracker/st_format.c
index 041d2c89a36..07623946b16 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -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 },

Reply via email to