From f25875ce180573fccd46dcc693c4331c80b51401 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 23 Aug 2022 14:48:39 +0200 Subject: [PATCH] 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 Acked-by: Eric Engestrom Tested-by: Eric Engestrom Part-of: --- src/mesa/state_tracker/st_format.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 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_SIGNED_RED_RGTC1, 0 }, - { PIPE_FORMAT_RGTC1_SNORM, DEFAULT_SNORM8_RGBA_FORMATS } + { GL_COMPRESSED_RED_RGTC1, 0 }, + { PIPE_FORMAT_RGTC1_UNORM, 0 } }, { - { GL_COMPRESSED_RG, GL_COMPRESSED_RG_RGTC2, 0 }, + { GL_COMPRESSED_SIGNED_RED_RGTC1, 0 }, + { PIPE_FORMAT_RGTC1_SNORM, 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 },