[Mesa-dev] [PATCH 19/32] glsl: Handle instance array declarations

Ian Romanick idr at freedesktop.org
Tue Jan 22 00:52:10 PST 2013


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/ast_to_hir.cpp | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index d485bc8..c922a84 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -4259,9 +4259,20 @@ ast_uniform_block::hir(exec_list *instructions,
     *     field selector ( . ) operator (analogously to structures)."
     */
    if (this->instance_name) {
-      ir_variable *var = new(state) ir_variable(block_type,
-                                                this->instance_name,
-                                                ir_var_uniform);
+      ir_variable *var;
+
+      if (this->array_size != NULL) {
+         const glsl_type *block_array_type =
+            process_array_type(&loc, block_type, this->array_size, state);
+
+         var = new(state) ir_variable(block_array_type,
+                                      this->instance_name,
+                                      ir_var_uniform);
+      } else {
+         var = new(state) ir_variable(block_type,
+                                      this->instance_name,
+                                      ir_var_uniform);
+      }
 
       var->interface_type = block_type;
       state->symbols->add_variable(var);
-- 
1.7.11.7



More information about the mesa-dev mailing list