ir3: Switch tess lowering to use location
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 24 Sep 2020 14:24:55 +0000 (16:24 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 23 Oct 2020 11:09:18 +0000 (11:09 +0000)
commit9e063b01b77059d13756794f95fa0eb0e5ef6633
tree2657d66f97a3331c65cf2ec96bbf1b25e92e7286
parent4ca38a19957f88523aef8761d68db413ebb1d562
ir3: Switch tess lowering to use location

Clip & cull distances, which are compact arrays, exposed a lot of holes
because they can take up multiple slots and partially overlap.

I wanted to eliminate our dependence on knowing the layout of the
variables, as this can get complicated with things like partially
overlapping arrays, which can happen with ARB_enhanced_layouts or with
clip/cull distance arrays. This means no longer changing the layout
based on whether the i/o is part of an array or not, and no longer
matching producer <-> consumer based on the variables. At the end of the
day we have to match things based on the user-specified location, so for
simplicity this switches the entire i/o handling to be based off the
user location rather than the driver location. This means that the
primitive map may be a little bigger, but it reduces the complexity
because we never have to build a table mapping user location to driver
location, and it reduces the amount of work done at link time in the SSO
case. It also brings us closer to what the other drivers do.

While here, I also fixed the handling of component qualifiers, which was
another thing broken with clip/cull distances.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6959>
src/freedreno/ir3/ir3_nir.c
src/freedreno/ir3/ir3_nir.h
src/freedreno/ir3/ir3_nir_lower_tess.c
src/freedreno/ir3/ir3_shader.h
src/freedreno/vulkan/tu_pipeline.c
src/gallium/drivers/freedreno/ir3/ir3_const.h