summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_array_index.cpp
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-07-22 11:44:24 -0700
committerPaul Berry <stereotype441@gmail.com>2013-08-01 20:24:27 -0700
commitc1f1d8522c4650f55fac3a57466c9788f80f82f6 (patch)
tree55ffe81c2216b6d7762ec367e6ab616eaee0a7b3 /src/glsl/ast_array_index.cpp
parent6065a87bce0c3fb0d9694c381c5a31b63e1f0300 (diff)
downloadexternal_mesa3d-c1f1d8522c4650f55fac3a57466c9788f80f82f6.zip
external_mesa3d-c1f1d8522c4650f55fac3a57466c9788f80f82f6.tar.gz
external_mesa3d-c1f1d8522c4650f55fac3a57466c9788f80f82f6.tar.bz2
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 <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl/ast_array_index.cpp')
-rw-r--r--src/glsl/ast_array_index.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp
index 4baeb6f..51f6b10 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