glsl: fix declarations of gl_MaxVaryingFloats

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 <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9514>
(cherry picked from commit 684f97de80)
This commit is contained in:
Timothy Arceri 2021-03-11 14:45:14 +11:00 committed by Dylan Baker
parent 3f66917855
commit b9174db5f2
2 changed files with 7 additions and 5 deletions

View file

@ -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"
},

View file

@ -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);
}