add_const("gl_MaxDrawBuffers", state->Const.MaxDrawBuffers);
/* 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)) {
add_const("gl_MaxVertexUniformVectors",
state->Const.MaxVertexUniformComponents / 4);
state->Const.MaxDualSourceDrawBuffers);
}
} else {
- add_const("gl_MaxVertexUniformComponents",
- state->Const.MaxVertexUniformComponents);
-
/* Note: gl_MaxVaryingFloats was deprecated in GLSL 1.30+, but not
* removed
*/
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