@@ -30,8 +30,14 @@ pub enum GroupOperation {
3030 /// A binary operation with an identity I and n (where n is the size of the workgroup)
3131 /// elements[a0, a1, … an-1] resulting in [I, a0, (a0 op a1), … (a0 op a1 op … op an-2)].
3232 ExclusiveScan = 2 ,
33- // /// See [`GROUP_OPERATION_CLUSTERED_REDUCE`]
34- // ClusteredReduce = 3,
33+ /// The [`GroupOperation`] `ClusteredReduce`.
34+ ///
35+ /// All instructions with a [`GroupOperation`] require an additional `ClusterSize` parameter when [`GroupOperation`] is
36+ /// `ClusteredReduce`. To map this requirement into rust, all function have a base version accepting [`GroupOperation`]
37+ /// as a const generic, and a `_clustered` variant that is fixed to `ClusteredReduce` and takes the additional
38+ /// `ClusterSize` parameter as a const generic. To not accidentally use a `ClusteredReduce` in the base variant of the
39+ /// function, it was removed from the [`GroupOperation`] enum and instead resides individually.
40+ ClusteredReduce = 3 ,
3541 /// Reserved.
3642 ///
3743 /// Requires Capability `GroupNonUniformPartitionedNV`.
@@ -46,15 +52,6 @@ pub enum GroupOperation {
4652 PartitionedExclusiveScanNV = 8 ,
4753}
4854
49- /// The [`GroupOperation`] `ClusteredReduce`.
50- ///
51- /// All instructions with a [`GroupOperation`] require an additional `ClusterSize` parameter when [`GroupOperation`] is
52- /// `ClusteredReduce`. To map this requirement into rust, all function have a base version accepting [`GroupOperation`]
53- /// as a const generic, and a `_clustered` variant that is fixed to `ClusteredReduce` and takes the additional
54- /// `ClusterSize` parameter as a const generic. To not accidentally use a `ClusteredReduce` in the base variant of the
55- /// function, it was removed from the [`GroupOperation`] enum and instead resides individually.
56- pub const GROUP_OPERATION_CLUSTERED_REDUCE : u32 = 3 ;
57-
5855/// Only usable if the extension GL_KHR_shader_subgroup_basic is enabled.
5956///
6057/// The function subgroupBarrier() enforces that all active invocations within a
@@ -782,7 +779,7 @@ macro_rules! macro_subgroup_op_clustered {
782779 concat!( "%result = " , $asm_op, " _ %subgroup {groupop} %value %clustersize" ) ,
783780 "OpStore {result} %result" ,
784781 subgroup = const SUBGROUP ,
785- groupop = const GROUP_OPERATION_CLUSTERED_REDUCE ,
782+ groupop = const ( GroupOperation :: ClusteredReduce as u32 ) ,
786783 clustersize = const CLUSTER_SIZE ,
787784 value = in( reg) & value,
788785 result = in( reg) & mut result,
0 commit comments