nir: Add a way to identify per-primitive variables
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 29 Apr 2021 18:51:57 +0000 (11:51 -0700)
committerMarge Bot <eric+marge@anholt.net>
Sat, 28 Aug 2021 03:56:42 +0000 (03:56 +0000)
commitf95daad3a2c5b04aff0141ee8a7de0036f4ffa6f
tree1c57410194d3b7fa94e352ca1508616993e686ec
parent927584fa67be1b644321961f32472a6f52b619f3
nir: Add a way to identify per-primitive variables

Per-primitive is similar to per-vertex attributes, but applies to all
fragments of the primitive without any interpolation involved.

Because they are regular input and outputs, keep track in shader_info
of which I/O is per-primitive so we can distinguish them after deref
lowering.  These fields can be used combined with the regular
`inputs_read`, `outputs_written` and `outputs_read`.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>
src/compiler/nir/nir.h
src/compiler/nir/nir_gather_info.c
src/compiler/nir/nir_lower_io.c
src/compiler/nir/nir_print.c
src/compiler/shader_info.h