From 8eae5ceb99b71854db566e18222f400641c23f39 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 16 May 2014 21:10:18 +1200 Subject: glsl: Allow non-constant UBO array indexing with GLSL4/ARB_gpu_shader5. Signed-off-by: Chris Forbes Reviewed-by: Ilia Mirkin Reviewed-by: Kenneth Graunke --- src/glsl/ast_array_index.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp index f3b060ea657..50f9987c8af 100644 --- a/src/glsl/ast_array_index.cpp +++ b/src/glsl/ast_array_index.cpp @@ -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 -- cgit v1.2.3