From b9174db5f2deccc2dc6923dd06835c36f1df83bf 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: (cherry picked from commit 684f97de80b91da828ed45ceda1d4693ea3c05e9) --- .pick_status.json | 2 +- src/compiler/glsl/builtin_variables.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 456f1d33ba9..4826de7d365 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1570,7 +1570,7 @@ "description": "glsl: fix declarations of gl_MaxVaryingFloats", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "0ebf4257a385972be0b6e851383ee6b728515aad" }, diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index 869d4523f6c..2e883479dd2 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -733,10 +733,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); }