From: Paul Berry Date: Mon, 22 Jul 2013 18:44:24 +0000 (-0700) Subject: glsl: Permit non-ubo input interface arrays to use non-const indexing. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1f1d8522c4650f55fac3a57466c9788f80f82f6;p=mesa.git glsl: Permit non-ubo input interface arrays to use non-const indexing. From the GLSL ES 3.00 spec: "All indexes used to index a uniform block array must be constant integral expressions." Similar text exists in GLSL specs since 1.50. When we implemented this, the only type of interface block supported by Mesa was uniform blocks, so we required all indexes used to index any interface block to be constant integral expressions. Now that we are adding interface block support for GLSL 1.50, we need a more specific check. Reviewed-by: Ian Romanick Reviewed-by: Kenneth Graunke --- diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp index 4baeb6f9dc6..51f6b10f365 100644 --- a/src/glsl/ast_array_index.cpp +++ b/src/glsl/ast_array_index.cpp @@ -117,7 +117,8 @@ _mesa_ast_array_index_to_hir(void *mem_ctx, } else if (const_index == NULL && array->type->is_array()) { if (array->type->array_size() == 0) { _mesa_glsl_error(&loc, state, "unsized array index must be constant"); - } else if (array->type->fields.array->is_interface()) { + } else if (array->type->fields.array->is_interface() + && array->variable_referenced()->mode == ir_var_uniform) { /* 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