freedreno/ir3: Lower GS builtins before lowering IO
authorKristian H. Kristensen <hoegsberg@google.com>
Tue, 28 Apr 2020 19:52:42 +0000 (12:52 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 1 May 2020 16:26:31 +0000 (16:26 +0000)
commitdd8d257a30d94759fdb2891b58ec7552fcca5272
tree13a6141d6923f380948eb63c2704279af9ba3111
parent79355fd9010888fefd1ce74b88aa1d000a302754
freedreno/ir3: Lower GS builtins before lowering IO

We mostly got away with replacing a store_output with a store_var, but
for complex types like structs, that doesn't work. Once the IO has
been lowered from vars to intrinsic, we've lost the deref chains and
can't properly shadow the outputs.

This commits moves the GS lowering up so we do it before the output
variables get lowered to store_output.  This way the pass works much
like nir_lower_io_to_temporaries() and cleanly shadows the outputs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4562>
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.c