spirv, nir: Handle EmitMeshTasksEXT opcode.
authorTimur Kristóf <timur.kristof@gmail.com>
Sat, 19 Feb 2022 11:37:06 +0000 (12:37 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Sep 2022 16:18:33 +0000 (16:18 +0000)
commit7d1bcf1f55ba98616671a0a5c182516cbfb19d41
tree1073310c46f14cd71c22fc0bc8d84f2efa8d7106
parent42e906485c4cb27a4d53777a7fcaeabc5109ce65
spirv, nir: Handle EmitMeshTasksEXT opcode.

A task shader must use this instruction to specify the dimensions
of the launched mesh shader workgroups.
It is a terminating instruction.

When the task shader doesn't have the optional payload, use the
pre-existing launch_mesh_workgroups intrinsics.

When the task shader has a payload, use a new
launch_mesh_workgroups_with_payload_deref intrinsics which has
a deref that refers to the payload variable.

We also add this new intrinsic to nir_lower_io which lowers this
to the pre-existing explicit intrinsic.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>
src/compiler/nir/nir_intrinsics.py
src/compiler/nir/nir_lower_io.c
src/compiler/spirv/spirv_to_nir.c