From c5c6cef893af37c95ee3a0a82f6fc73a1fa02406 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Thu, 20 Jan 2022 16:35:23 +0100 Subject: [PATCH] spirv: Support EXT_mesh_shader SetMeshOutputsEXT. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use the set_vertex_and_primitive_count intrinsic to express the number of vertices and primitives that the mesh shader workgroup outputs. Signed-off-by: Timur Kristóf Reviewed-by: Jason Ekstrand Reviewed-by: Caio Oliveira Part-of: --- src/compiler/spirv/spirv_to_nir.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index a227e4c..a25843c 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -6284,6 +6284,11 @@ vtn_handle_body_instruction(struct vtn_builder *b, SpvOp opcode, vtn_handle_write_packed_primitive_indices(b, opcode, w, count); break; + case SpvOpSetMeshOutputsEXT: + nir_set_vertex_and_primitive_count( + &b->nb, vtn_get_nir_ssa(b, w[1]), vtn_get_nir_ssa(b, w[2])); + break; + default: vtn_fail_with_opcode("Unhandled opcode", opcode); } -- 2.7.4