From 9068e4415a3a934d70bc3f4d39de8cbe70a5572e Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 4 Sep 2024 12:51:21 +0200 Subject: [PATCH] mesa/main: tighten glsl-version checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't want to expose GLSL versions above what should be exposed for the current API, otherwise we allow out-of-spec behavior. This is unlikely to have any real-world effect, because most of the time, the version is the highest supported. It's only if the version is artificially limited that this should matter. But it's also a bit cleaner this way. Reviewed-by: Tapani Pälli Part-of: --- src/mesa/main/version.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 1994f891b24..c3809bcc1ac 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -771,13 +771,13 @@ _mesa_get_shading_language_version(const struct gl_context *ctx, GLSL_VERSION(""); /* GLSL es */ - if (_mesa_is_gles32(ctx) || ctx->Extensions.ARB_ES3_2_compatibility) + if (_mesa_is_gles32_compatible(ctx)) GLSL_VERSION("320 es"); - if (_mesa_is_gles31(ctx) || ctx->Extensions.ARB_ES3_1_compatibility) + if (_mesa_is_gles31_compatible(ctx)) GLSL_VERSION("310 es"); - if (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility) + if (_mesa_is_gles3_compatible(ctx)) GLSL_VERSION("300 es"); - if (_mesa_is_gles2(ctx) || ctx->Extensions.ARB_ES2_compatibility) + if (_mesa_is_gles2_compatible(ctx)) GLSL_VERSION("100"); #undef GLSL_VERSION