i965: add arrays of arrays support for varyings
authorTimothy Arceri <t_arceri@yahoo.com.au>
Sat, 18 Jul 2015 07:24:22 +0000 (17:24 +1000)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Thu, 15 Oct 2015 09:44:26 +0000 (20:44 +1100)
V2: get the correct vector elements value for outputs

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index d000f16..01a7c99 100644 (file)
@@ -1048,11 +1048,11 @@ fs_visitor::emit_general_interpolation(fs_reg attr, const char *name,
    unsigned int array_elements;
 
    if (type->is_array()) {
-      array_elements = type->length;
+      array_elements = type->arrays_of_arrays_size();
       if (array_elements == 0) {
          fail("dereferenced array '%s' has length 0\n", name);
       }
-      type = type->fields.array;
+      type = type->without_array();
    } else {
       array_elements = 1;
    }
index 05f3f63..0e044d0 100644 (file)
@@ -89,9 +89,7 @@ fs_visitor::nir_setup_outputs()
    nir_foreach_variable(var, &nir->outputs) {
       fs_reg reg = offset(nir_outputs, bld, var->data.driver_location);
 
-      int vector_elements =
-         var->type->is_array() ? var->type->fields.array->vector_elements
-                               : var->type->vector_elements;
+      int vector_elements = var->type->without_array()->vector_elements;
 
       switch (stage) {
       case MESA_SHADER_VERTEX: