<div dir="ltr">On 22 January 2013 00:52, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
<br>
Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
---<br>
 src/glsl/ast_to_hir.cpp | 17 ++++++++++++++---<br>
 1 file changed, 14 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp<br>
index d485bc8..c922a84 100644<br>
--- a/src/glsl/ast_to_hir.cpp<br>
+++ b/src/glsl/ast_to_hir.cpp<br>
@@ -4259,9 +4259,20 @@ ast_uniform_block::hir(exec_list *instructions,<br>
     *     field selector ( . ) operator (analogously to structures)."<br>
     */<br>
    if (this->instance_name) {<br>
-      ir_variable *var = new(state) ir_variable(block_type,<br>
-                                                this->instance_name,<br>
-                                                ir_var_uniform);<br>
+      ir_variable *var;<br>
+<br>
+      if (this->array_size != NULL) {<br>
+         const glsl_type *block_array_type =<br>
+            process_array_type(&loc, block_type, this->array_size, state);<br>
+<br>
+         var = new(state) ir_variable(block_array_type,<br>
+                                      this->instance_name,<br>
+                                      ir_var_uniform);<br>
+      } else {<br>
+         var = new(state) ir_variable(block_type,<br>
+                                      this->instance_name,<br>
+                                      ir_var_uniform);<br>
+      }<br>
<br>
       var->interface_type = block_type;<br>
       state->symbols->add_variable(var);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.11.7<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div><div class="gmail_extra">Immediately below this hunk there's an else branch, to deal with the case where the uniform block doesn't have an instance name.  Why don't we need to add similar array-handling logic to the else branch?  I'm guessing that the grammar prevents instance blocks without names from being arrays, but since I'm not too familiar with UBO's I'm not very certain about it.<br>
<br>If my guess is right, it would be nice to put an explanatory comment in the else branch, and maybe an "assert(this->array_size == NULL);" just to drive the point home.<br><br></div><div class="gmail_extra">
But I won't be a stickler about it.  With or without my suggested change, this patch is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br></div></div>