mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 11:50:09 +01:00
nir: Fix overlapping vars in nir_assign_io_var_locations()
When handling two variables with overlapping locations, we process the one with lower location first, and then extend the location -> driver_location map to guarantee that it's contiguous for the second variable too. But the loop had the wrong bound, so we weren't extending the map 100%, which could lead to problems later such as an incorrect num_inputs. The loop index i is an index into the slots of the variable, so we need to stop at the final slot of the variable (var_size) instead of the number of unassigned slots. This fixes spec@arb_enhanced_layouts@execution@component-layout@vs-fs-array-interleave-range on radeonsi NIR. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
66456b8d49
commit
36e000d832
1 changed files with 1 additions and 1 deletions
|
|
@ -1079,7 +1079,7 @@ nir_assign_io_var_locations(struct exec_list *var_list, unsigned *size,
|
|||
if (last_slot_location > location) {
|
||||
unsigned num_unallocated_slots = last_slot_location - location;
|
||||
unsigned first_unallocated_slot = var_size - num_unallocated_slots;
|
||||
for (unsigned i = first_unallocated_slot; i < num_unallocated_slots; i++) {
|
||||
for (unsigned i = first_unallocated_slot; i < var_size; i++) {
|
||||
assigned_locations[var->data.location + i] = location;
|
||||
location++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue