Skip to content

Commit de03e8d

Browse files
committed
add summarising safety contracts to mesh_shading intrinsics
1 parent 5b52374 commit de03e8d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/spirv-std/src/arch/mesh_shading.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ use core::arch::asm;
1717
/// by this instruction.
1818
///
1919
/// This instruction is only valid in the *`MeshEXT`* Execution Model.
20+
///
21+
/// # Safety
22+
/// * Must be called **exactly once** in mesh shaders
23+
/// * Must be called in uniform control flow
24+
/// * Must not write any output before this instruction in invoked
2025
#[spirv_std_macros::gpu_only]
2126
#[doc(alias = "OpSetMeshOutputsEXT")]
2227
#[inline]
@@ -54,6 +59,10 @@ pub unsafe fn set_mesh_outputs_ext(vertex_count: u32, primitive_count: u32) {
5459
/// This instruction must be the last instruction in a block.
5560
///
5661
/// This instruction is only valid in the *`TaskEXT`* Execution Model.
62+
///
63+
/// # Safety
64+
/// * Must be called **exactly once** in task shaders
65+
/// * Must be called in uniform control flow
5766
#[spirv_std_macros::gpu_only]
5867
#[doc(alias = "OpEmitMeshTasksEXT")]
5968
#[inline]
@@ -93,6 +102,10 @@ pub unsafe fn emit_mesh_tasks_ext(group_count_x: u32, group_count_y: u32, group_
93102
/// This instruction must be the last instruction in a block.
94103
///
95104
/// This instruction is only valid in the *`TaskEXT`* Execution Model.
105+
///
106+
/// # Safety
107+
/// * Must be called **exactly once** in task shaders
108+
/// * Must be called in uniform control flow
96109
#[spirv_std_macros::gpu_only]
97110
#[doc(alias = "OpEmitMeshTasksEXT")]
98111
#[inline]

0 commit comments

Comments
 (0)