[Mesa-dev] [PATCH 2/4] glsl: Add SSBO's load/store/unsize-array-length-calculation support for AoA

Samuel Iglesias Gonsalvez siglesias at igalia.com
Tue Oct 6 01:26:36 PDT 2015


Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
Cc: Timothy Arceri <t_arceri at yahoo.com.au>
---
 src/glsl/lower_ubo_reference.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/glsl/lower_ubo_reference.cpp b/src/glsl/lower_ubo_reference.cpp
index 183435e..f4150df 100644
--- a/src/glsl/lower_ubo_reference.cpp
+++ b/src/glsl/lower_ubo_reference.cpp
@@ -325,17 +325,17 @@ lower_ubo_reference_visitor::setup_for_load_or_store(ir_variable *var,
       case ir_type_dereference_array: {
          ir_dereference_array *deref_array = (ir_dereference_array *) deref;
          unsigned array_stride;
-         if (deref_array->array->type->is_matrix() && *row_major) {
+         if (deref_array->type->without_array()->is_matrix() && *row_major) {
             /* When loading a vector out of a row major matrix, the
              * step between the columns (vectors) is the size of a
              * float, while the step between the rows (elements of a
              * vector) is handled below in emit_ubo_loads.
              */
             array_stride = 4;
-            if (deref_array->array->type->is_double())
+            if (deref_array->type->without_array()->is_double())
                array_stride *= 2;
             *matrix_columns = deref_array->array->type->matrix_columns;
-         } else if (deref_array->type->is_interface()) {
+         } else if (deref_array->type->without_array()->is_interface()) {
             /* We're processing an array dereference of an interface instance
              * array. The thing being dereferenced *must* be a variable
              * dereference because interfaces cannot be embedded in other
@@ -649,10 +649,10 @@ lower_ubo_reference_visitor::emit_access(bool is_write,
 
    if (deref->type->is_array()) {
       unsigned array_stride = packing == GLSL_INTERFACE_PACKING_STD430 ?
-         deref->type->fields.array->std430_array_stride(row_major) :
-         glsl_align(deref->type->fields.array->std140_size(row_major), 16);
+         deref->type->without_array()->std430_array_stride(row_major) :
+         glsl_align(deref->type->without_array()->std140_size(row_major), 16);
 
-      for (unsigned i = 0; i < deref->type->length; i++) {
+      for (unsigned i = 0; i < deref->type->arrays_of_arrays_size(); i++) {
          ir_constant *element = new(mem_ctx) ir_constant(i);
          ir_dereference *element_deref =
             new(mem_ctx) ir_dereference_array(deref->clone(mem_ctx, NULL),
-- 
2.1.4



More information about the mesa-dev mailing list