glsl: gl_Max{Vertex,Fragment}UniformComponents exist in all desktop GL versions
The current implementation assumed that these were replaced in GLSL >= 4.10 by gl_Max{Vertex,Fragment}UniformVectors, however this is not true: both built-ins should be produced from GLSL 4.10 onwards. This was raised by new CTS tests that are in development. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
@@ -632,8 +632,16 @@ builtin_variable_generator::generate_constants()
|
|||||||
add_const("gl_MaxDrawBuffers", state->Const.MaxDrawBuffers);
|
add_const("gl_MaxDrawBuffers", state->Const.MaxDrawBuffers);
|
||||||
|
|
||||||
/* Max uniforms/varyings: GLSL ES counts these in units of vectors; desktop
|
/* Max uniforms/varyings: GLSL ES counts these in units of vectors; desktop
|
||||||
* GL counts them in units of "components" or "floats".
|
* GL counts them in units of "components" or "floats" and also in units
|
||||||
|
* of vectors since GL 4.1
|
||||||
*/
|
*/
|
||||||
|
if (!state->es_shader) {
|
||||||
|
add_const("gl_MaxFragmentUniformComponents",
|
||||||
|
state->Const.MaxFragmentUniformComponents);
|
||||||
|
add_const("gl_MaxVertexUniformComponents",
|
||||||
|
state->Const.MaxVertexUniformComponents);
|
||||||
|
}
|
||||||
|
|
||||||
if (state->is_version(410, 100)) {
|
if (state->is_version(410, 100)) {
|
||||||
add_const("gl_MaxVertexUniformVectors",
|
add_const("gl_MaxVertexUniformVectors",
|
||||||
state->Const.MaxVertexUniformComponents / 4);
|
state->Const.MaxVertexUniformComponents / 4);
|
||||||
@@ -661,16 +669,10 @@ builtin_variable_generator::generate_constants()
|
|||||||
state->Const.MaxDualSourceDrawBuffers);
|
state->Const.MaxDualSourceDrawBuffers);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
add_const("gl_MaxVertexUniformComponents",
|
|
||||||
state->Const.MaxVertexUniformComponents);
|
|
||||||
|
|
||||||
/* Note: gl_MaxVaryingFloats was deprecated in GLSL 1.30+, but not
|
/* Note: gl_MaxVaryingFloats was deprecated in GLSL 1.30+, but not
|
||||||
* removed
|
* removed
|
||||||
*/
|
*/
|
||||||
add_const("gl_MaxVaryingFloats", state->ctx->Const.MaxVarying * 4);
|
add_const("gl_MaxVaryingFloats", state->ctx->Const.MaxVarying * 4);
|
||||||
|
|
||||||
add_const("gl_MaxFragmentUniformComponents",
|
|
||||||
state->Const.MaxFragmentUniformComponents);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Texel offsets were introduced in ARB_shading_language_420pack (which
|
/* Texel offsets were introduced in ARB_shading_language_420pack (which
|
||||||
|
Reference in New Issue
Block a user