Skip to content

Commit 51435b9

Browse files
committed
subgroup: make SubgroupMask a struct to prevent implicit casts to and from UVec4
1 parent 26b23ad commit 51435b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ use core::arch::asm;
88

99
const SUBGROUP: u32 = Scope::Subgroup as u32;
1010

11-
/// GroupMask is a [`glam::UVec4`] representing a bitmask of all invocations within a subgroup.
11+
/// SubgroupMask is a [`glam::UVec4`] representing a bitmask of all invocations within a subgroup.
1212
/// Mostly used in group ballot operations.
13-
pub type SubgroupMask = glam::UVec4;
13+
#[derive(Copy, Clone, Default, Eq, PartialEq)]
14+
pub struct SubgroupMask(pub glam::UVec4);
1415

1516
/// Defines the class of group operation.
1617
#[non_exhaustive]
@@ -24,7 +25,6 @@ pub enum GroupOperation {
2425
/// A binary operation with an identity I and n (where n is the size of the workgroup)
2526
/// elements[a0, a1, … an-1] resulting in [I, a0, (a0 op a1), … (a0 op a1 op … op an-2)].
2627
ExclusiveScan = 2,
27-
2828
// /// See [`GROUP_OPERATION_CLUSTERED_REDUCE`]
2929
// ClusteredReduce = 3,
3030
/// Reserved.

0 commit comments

Comments
 (0)