nir: Add AMD specific intrinsics for NGG shader based culling.
authorTimur Kristóf <timur.kristof@gmail.com>
Tue, 4 May 2021 11:41:14 +0000 (13:41 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Jul 2021 23:56:33 +0000 (23:56 +0000)
commit48e638ab296ca68fe9b4edc7bdb78bb8cdaf5f17
treee02a069e4eeef9b9eee39ed43edd25fcec566904
parentc071187dbbe6bb7ad11440b4d9fe5c96fcf45193
nir: Add AMD specific intrinsics for NGG shader based culling.

The new intrinsics fall into the following categories:

1. New viewport intrinsics:
For missing components that we need.
RADV will emit new SGPR arguments which will contain the
viewport information for culling shaders. These are used to
compute the screen space coordinates for small primitive culling.

2. load_cull_xxx:
Load the culling settings in runtime.
These will be a new SGPR argument in RADV.

3. overwrite_xxx:
These are needed because system values such as vertex and
instance ID are not writeable, but we need to change them
after repacking shader invocations of VS and TES.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>
src/compiler/nir/nir_divergence_analysis.c
src/compiler/nir/nir_intrinsics.py