From b59b2d4bfa4a130f1144140d0107d1494534b4f7 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 4 Sep 2024 12:54:58 +0200 Subject: [PATCH] mesa/main: tighten gl-version checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we allow this whenever the extension is supported by the driver, we end up allowing out-of-spec behavior for instance on GLES 1.x. So let's tighten these checks to consider the current API, by using the new helpers. Reviewed-by: Tapani Pälli Part-of: --- src/mesa/main/texcompress.c | 2 +- src/mesa/main/teximage.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index c57d46ba8f7..e4a0a590661 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -360,7 +360,7 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats) formats[n++] = GL_PALETTE8_RGB5_A1_OES; } - if (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility) { + if (_mesa_is_gles3_compatible(ctx)) { formats[n++] = GL_COMPRESSED_RGB8_ETC2; formats[n++] = GL_COMPRESSED_RGBA8_ETC2_EAC; formats[n++] = GL_COMPRESSED_R11_EAC; diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 6ff8432e29c..0a728a13c63 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1594,7 +1594,7 @@ _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target, */ target_can_be_compresed = ctx->Extensions.EXT_texture_compression_s3tc && - (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility); + _mesa_is_gles3_compatible(ctx); break; case MESA_FORMAT_LAYOUT_ASTC: target_can_be_compresed = @@ -5601,7 +5601,7 @@ compressed_subtexture_target_check(struct gl_context *ctx, GLenum target, case MESA_FORMAT_LAYOUT_S3TC: targetOK = ctx->Extensions.EXT_texture_compression_s3tc && - (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility); + _mesa_is_gles3_compatible(ctx); break; case MESA_FORMAT_LAYOUT_ASTC: targetOK =