From 040b07c7feebac90858f7426c2c20784642d0ca5 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 1 Jul 2020 13:04:25 +1000 Subject: [PATCH] mesa: fix fallthrough in glformats MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Before 908f817918fb this would fallthrough to GL_INVALID_OPERATION if the validation condition was not met. But since that change it will now only return GL_INVALID_OPERATION if !_mesa_has_EXT_texture_compression_bptc(ctx) is true. This seems unintended. Here we fix up the fallthrough and add the fallthrough comment so this doesn't happen again. Fixes: 908f817918fb ("mesa: expose EXT_texture_compression_bptc in GLES") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3005 Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/glformats.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index dfff4a21f04..66b29ede67a 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -3059,14 +3059,15 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, if (ctx->Version <= 20) return GL_INVALID_OPERATION; break; - case GL_RGB: - if (_mesa_has_OES_texture_float(ctx) && internalFormat == format) - break; case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT: case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT: if (!_mesa_has_EXT_texture_compression_bptc(ctx)) return GL_INVALID_OPERATION; break; + case GL_RGB: + if (_mesa_has_OES_texture_float(ctx) && internalFormat == format) + break; + /* fallthrough */ default: return GL_INVALID_OPERATION; } -- 2.30.2