spirv: Support EXT_mesh_shader SetMeshOutputsEXT.

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 <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>
This commit is contained in:
Timur Kristóf 2022-01-20 16:35:23 +01:00 committed by Marge Bot
parent b3cc09cff3
commit c5c6cef893
1 changed files with 5 additions and 0 deletions

View File

@ -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);
}