nir: fix packing components with arrays
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 15 Apr 2019 05:00:02 +0000 (15:00 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 15 Apr 2019 09:25:12 +0000 (19:25 +1000)
When gathering info for unmovable types we need to handle arrays.
While we dont support packing/moving arrays we do support packing
scalar components with these arrays.

Fixes piglit:
tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-interleave-range.shader_test

Fixes: 5eb17506e159 ("nir: do not pack varying with different types")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/compiler/nir/nir_linking_helpers.c

index 7594728e25e114679e40035baef09e5d6d419f50..f4494c78f9850fe5e67f4d9c56c83d95800f158d 100644 (file)
@@ -309,7 +309,8 @@ get_unmoveable_components_masks(struct exec_list *var_list,
             comps[location + i].interp_type =
                get_interp_type(var, type, default_to_smooth_interp);
             comps[location + i].interp_loc = get_interp_loc(var);
-            comps[location + i].is_32bit = glsl_type_is_32bit(type);
+            comps[location + i].is_32bit =
+               glsl_type_is_32bit(glsl_without_array(type));
          }
       }
    }