Mesa (master): glsl: Allow arrays of arrays as input to vertex shader

Timothy Arceri tarceri at kemper.freedesktop.org
Thu Jan 23 12:45:48 UTC 2014


Module: Mesa
Branch: master
Commit: 3d492f19f6e1a50a645cfa3b04d64808d44af5e3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3d492f19f6e1a50a645cfa3b04d64808d44af5e3

Author: Timothy Arceri <t_arceri at yahoo.com.au>
Date:   Thu Jan 23 23:20:25 2014 +1100

glsl: Allow arrays of arrays as input to vertex shader

Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>

---

 src/glsl/ast_to_hir.cpp |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index be12f97..f13ac51 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -3143,8 +3143,9 @@ ast_declarator_list::hir(exec_list *instructions,
              *    vectors. Vertex shader inputs cannot be arrays or
              *    structures."
 	     */
-	    const glsl_type *check_type = var->type->is_array()
-	       ? var->type->fields.array : var->type;
+            const glsl_type *check_type = var->type;
+            while (check_type->is_array())
+               check_type = check_type->element_type();
 
 	    switch (check_type->base_type) {
 	    case GLSL_TYPE_FLOAT:




More information about the mesa-commit mailing list