aco/ngg: Implement NGG VS and TES.
authorTimur Kristóf <timur.kristof@gmail.com>
Wed, 1 Apr 2020 10:29:30 +0000 (12:29 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 7 Apr 2020 11:29:35 +0000 (11:29 +0000)
commitc633edad72dbc65fb8ba30a623163fcf1840361a
tree5092f659bf8eb72345a248d7b6f543921a3a4513
parentc5ed0883fc78d72bd5ec5bf5de4b66a6c905a546
aco/ngg: Implement NGG VS and TES.

When NGG is used, vertex and tess eval shaders are executed on the
hardware NGG geometry stage. There is a series of steps they
must perform:

* Request GS space using GS_ALLOC_REQ
* Export the primitive
* Finally, export the normal VS outputs

In this commit, two modes are implemented:

* "late" which matches what the RADV LLVM backend currently does
* "early" which is an optimized version as seen in radeonsi

Vulkan doesn't allow the shader to write the edge flags, so we can
currently always use the "early" mode.

Exporting the primitive ID is also supported by having the GS threads
write that into LDS and reading them from LDS in the ES threads.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3576>
src/amd/compiler/aco_instruction_selection.cpp
src/amd/compiler/aco_instruction_selection_setup.cpp