glsl: Allow non-constant UBO array indexing with GLSL4/ARB_gpu_shader5.
authorChris Forbes <chrisf@ijw.co.nz>
Fri, 16 May 2014 09:10:18 +0000 (21:10 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Sat, 26 Jul 2014 04:46:03 +0000 (16:46 +1200)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ast_array_index.cpp

index f3b060e..50f9987 100644 (file)
@@ -181,7 +181,8 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
       if (array->type->is_unsized_array()) {
         _mesa_glsl_error(&loc, state, "unsized array index must be constant");
       } else if (array->type->fields.array->is_interface()
-                 && array->variable_referenced()->data.mode == ir_var_uniform) {
+                 && array->variable_referenced()->data.mode == ir_var_uniform
+                 && !state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
         /* Page 46 in section 4.3.7 of the OpenGL ES 3.00 spec says:
          *
          *     "All indexes used to index a uniform block array must be