* as using a loop counter as the index to an array of samplers. If the
* loop in unrolled, the code should compile correctly. Instead, emit a
* warning.
+ *
+ * In GLSL 4.00 / ARB_gpu_shader5, this requirement is relaxed again to allow
+ * indexing with dynamically uniform expressions. Note that these are not
+ * required to be uniforms or expressions based on them, but merely that the
+ * values must not diverge between shader invocations run together. If the
+ * values *do* diverge, then the behavior of the operation requiring a
+ * dynamically uniform expression is undefined.
*/
if (array->type->element_type()->is_sampler()) {
if (!state->is_version(130, 100)) {
"expressions will be forbidden in GLSL 1.30 "
"and later");
}
- } else {
+ } else if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
_mesa_glsl_error(&loc, state,
"sampler arrays indexed with non-constant "
"expressions is forbidden in GLSL 1.30 and "