mesa/main: tighten glsl-version checks

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 <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31039>
This commit is contained in:
Erik Faye-Lund
2024-09-04 12:51:21 +02:00
committed by Marge Bot
parent 97b8febf3d
commit 9068e4415a
+4 -4
View File
@@ -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