<div dir="ltr">On 21 January 2014 04:19, Timothy Arceri <span dir="ltr"><<a href="mailto:t_arceri@yahoo.com.au" target="_blank">t_arceri@yahoo.com.au</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-off-by: Timothy Arceri <<a href="mailto:t_arceri@yahoo.com.au">t_arceri@yahoo.com.au</a>><br>
---<br>
src/glsl/ast_to_hir.cpp | 4 ++++<br>
1 file changed, 4 insertions(+)<br>
<br>
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp<br>
index 226d128..62b7ec2 100644<br>
--- a/src/glsl/ast_to_hir.cpp<br>
+++ b/src/glsl/ast_to_hir.cpp<br>
@@ -3176,6 +3176,10 @@ ast_declarator_list::hir(exec_list *instructions,<br>
if (state->is_version(120, 300))<br>
break;<br>
/* FALLTHROUGH */<br>
+ case GLSL_TYPE_ARRAY:<br>
+ if (state->ARB_arrays_of_arrays_enable)<br>
+ break;<br>
+ /* FALLTHROUGH */<br>
default:<br>
_mesa_glsl_error(& loc, state,<br>
"vertex shader input / attribute cannot have "<br></blockquote><div><br></div><div>I see two problems with this:<br><br>1. Since the case above has a fall-through, this has an unintended side effect: if ARB_arrays_of_arrays is enabled, then integer vertex attributes will be allowed prior to GLSL 1.20. Although it's unlikely that anyone will ever try to write a GLSL 1.10 shader using ARB_arrays_of_arrays, it would be nice to get the logic right.<br>
<br></div><div>2. When the type of the input is an array of arrays, we need to recurse through it to make sure it doesn't contain any prohibited types (e.g. an array of arrays of structs should still be prohibited).<br>
<br></div><div>I think the easiest solution to this would be to replace the line:<br><br> const glsl_type *check_type = var->type->is_array()<br> ? var->type->fields.array : var->type;<br><br>
</div><div>with something like this:<br><br> const glsl_type *check_type = var->type;<br> while (check_type->is_array())<br> check_type = check_type->element_type();<br><br></div>
<div>Then we can leave the switch statement alone.<br><br></div><div>With that fixed, this patch is:<br><br></div><div>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div></div></div></div>