radv: Add support for per-primitive mesh shader outputs.
authorTimur Kristóf <timur.kristof@gmail.com>
Thu, 28 Oct 2021 14:52:35 +0000 (16:52 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 31 Dec 2021 13:05:09 +0000 (13:05 +0000)
commite3a80d9d29bcf1ac0f9457cb7c1dfd834bddc5bf
treed589377745f0c246cfe13221f42642f2c9cf6651
parentc7027156ea3eb1f4739af8bb63e1aa04d522af90
radv: Add support for per-primitive mesh shader outputs.

Generic per-primitive outputs:

They work similarly to other NGG outputs.
In the ISA they are param export instructions that are executed
on the primitive threads. These per-primitive params must be
sorted last among both mesh shader outputs and pixel shader inputs.

PS can read these inputs using the same old VINTRP instructions.
They use the same amount of LDS space as per-vertex PS inputs.

Special per-primitive outputs:

The VRS rate x, y, viewport and layer are special per-primitive
outputs which must go to the second channel of the primitive
export instruction, which is enabled by EN_PRIM_PAYLOAD.

If the PS wants to read these, they must also be exported as
a generic param.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13580>
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_shader.h
src/amd/vulkan/radv_shader_info.c