nir: Fix overlapping vars in nir_assign_io_var_locations()
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 24 Sep 2019 15:29:53 +0000 (17:29 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Wed, 25 Sep 2019 13:53:50 +0000 (15:53 +0200)
commit36e000d8321814de11454c8574f2d3a8da01db8a
tree42edeb299d0a275e5c5e2ceba5e92ac75663641f
parent66456b8d49ba2ccfe36e3dd2d7dadefaae392636
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>
src/compiler/nir/nir_linking_helpers.c