It was double-counting cases where multiple variables were assigned to
the same slot, and not handling the case where the last variable is a
compact variable.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
if (processed) {
unsigned driver_location = assigned_locations[var->data.location];
var->data.driver_location = driver_location;
- *size += glsl_count_attribute_slots(type, false);
/* An array may be packed such that is crosses multiple other arrays
* or variables, we need to make sure we have allocated the elements
location += var_size;
}
- *size += location;
+ if (last_partial)
+ location++;
+
+ *size = location;
}