From: Kenneth Graunke Date: Sat, 17 Jul 2010 01:28:44 +0000 (-0700) Subject: glsl2: Disallow non-constant array indexing for unsized arrays. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b7c42b40ae459f7b290eb134d6dabd075aab9f0;p=mesa.git glsl2: Disallow non-constant array indexing for unsized arrays. Fixes piglit test unsized-array-non-const-index.vert. --- 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)