Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
type = type->fields.array;
}
- slots = (type->is_array()
- ? (type->length * type->fields.array->matrix_columns)
- : type->matrix_columns);
+ if (type->is_array()) {
+ slots = 1;
+ while (type->is_array()) {
+ slots *= type->length;
+ type = type->fields.array;
+ }
+ slots *= type->matrix_columns;
+ } else {
+ slots = var->type->matrix_columns;
+ }
this->matches[this->num_matches].num_components = 4 * slots;
} else {
this->matches[this->num_matches].num_components