From 684f97de80b91da828ed45ceda1d4693ea3c05e9 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Thu, 11 Mar 2021 14:45:14 +1100 Subject: [PATCH] glsl: fix declarations of gl_MaxVaryingFloats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gl_MaxVaryingFloats was not removed from core until 4.20 and is still available in compat shaders. Found while writing some new CTS to test the correct declarations of this constant. Fixes: 0ebf4257a385i ("glsl: define some GLES3 constants in GLSL 4.1") Reviewed-by: Tapani Pälli Part-of: --- src/compiler/glsl/builtin_variables.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index 2df045eb345..72ae3996110 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -772,10 +772,12 @@ builtin_variable_generator::generate_constants() add_const("gl_MaxDualSourceDrawBuffersEXT", state->Const.MaxDualSourceDrawBuffers); } - } else { - /* Note: gl_MaxVaryingFloats was deprecated in GLSL 1.30+, but not - * removed - */ + } + + /* gl_MaxVaryingFloats was deprecated in GLSL 1.30+, and was moved to + * compat profile in GLSL 4.20. GLSL ES never supported this constant. + */ + if (compatibility || !state->is_version(420, 100)) { add_const("gl_MaxVaryingFloats", state->ctx->Const.MaxVarying * 4); }