diff options
author | Ian Romanick <[email protected]> | 2013-01-21 22:07:34 -0500 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-01-25 09:07:34 -0500 |
commit | 3b09603dda7108f7f7d58c903b15510262f845c0 (patch) | |
tree | b5ae29f8475e94ffe4b36bb3b40e4d743bbecf57 /src/glsl/ast_to_hir.cpp | |
parent | 7a7b44b329c8090969587d1dab23721d47f82e4a (diff) |
glsl: Require that indices into uniform block arrays be constants
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Carl Worth <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 372ffde1b16..e2d7265a6a2 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1622,6 +1622,15 @@ ast_expression::hir(exec_list *instructions, } } else if (array->type->array_size() == 0) { _mesa_glsl_error(&loc, state, "unsized array index must be constant"); + } else if (array->type->is_array() + && array->type->fields.array->is_interface()) { + /* 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 + * constant integral expressions." + */ + _mesa_glsl_error(&loc, state, + "uniform block array index must be constant"); } else { if (array->type->is_array()) { /* whole_variable_referenced can return NULL if the array is a |