Mesa (glsl2): glsl2: Disallow non-constant array indexing for unsized arrays.

Ian Romanick idr at kemper.freedesktop.org
Wed Jul 21 00:21:54 UTC 2010


Module: Mesa
Branch: glsl2
Commit: 2b7c42b40ae459f7b290eb134d6dabd075aab9f0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2b7c42b40ae459f7b290eb134d6dabd075aab9f0

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Jul 16 18:28:44 2010 -0700

glsl2: Disallow non-constant array indexing for unsized arrays.

Fixes piglit test unsized-array-non-const-index.vert.

---

 src/glsl/ast_to_hir.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 98090d2..41371e7 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)




More information about the mesa-commit mailing list