Mesa (main): nir: Add new launch_mesh_workgroups intrinsic.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 27 08:45:39 UTC 2022


Module: Mesa
Branch: main
Commit: 9eaf918ed29def18162a83fcf8f312561a739d59
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9eaf918ed29def18162a83fcf8f312561a739d59

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Thu May 26 13:24:58 2022 +0200

nir: Add new launch_mesh_workgroups intrinsic.

The new intrinsic launches mesh shader workgroups
from a task shader, with explicit task_payload.

Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16720>

---

 src/compiler/nir/nir_intrinsics.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py
index 5487a46548a..ed9b3d0948c 100644
--- a/src/compiler/nir/nir_intrinsics.py
+++ b/src/compiler/nir/nir_intrinsics.py
@@ -487,6 +487,19 @@ intrinsic("end_primitive_with_counter", src_comp=[1, 1], indices=[STREAM_ID])
 # Contains the final total vertex and primitive counts in the current GS thread.
 intrinsic("set_vertex_and_primitive_count", src_comp=[1, 1], indices=[STREAM_ID])
 
+# Launches mesh shader workgroups from a task shader, with explicit task_payload.
+# Rules:
+# - This is a terminating instruction.
+# - May only occur in workgroup-uniform control flow.
+# - Dispatch sizes may be divergent (in which case the values
+#   from the first invocation are used).
+# Meaning of indices:
+# - BASE: address of the task_payload variable used.
+# - RANGE: size of the task_payload variable used.
+#
+# src[] = {vec(x, y, z)}
+intrinsic("launch_mesh_workgroups", src_comp=[3], indices=[BASE, RANGE])
+
 # Trace a ray through an acceleration structure
 #
 # This instruction has a lot of parameters:



More information about the mesa-commit mailing list