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