aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-07-16 18:28:44 -0700
committerIan Romanick <[email protected]>2010-07-20 17:13:17 -0700
commit2b7c42b40ae459f7b290eb134d6dabd075aab9f0 (patch)
tree16143fee0d4f06aebfb8341a33f4c34048dc2c84 /src/glsl/ast_to_hir.cpp
parente4768eecd5da6f9e955aa7c3892810813623f0dc (diff)
glsl2: Disallow non-constant array indexing for unsized arrays.
Fixes piglit test unsized-array-non-const-index.vert.
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 98090d2b01b..41371e75367 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1233,6 +1233,8 @@ ast_expression::hir(exec_list *instructions,
if ((v != NULL) && (unsigned(idx) > v->max_array_access))
v->max_array_access = idx;
}
+ } else if (array->type->array_size() == 0) {
+ _mesa_glsl_error(&loc, state, "unsized array index must be constant");
}
if (error_emitted)