@@ -30,8 +30,14 @@ pub enum GroupOperation {
30
30
/// A binary operation with an identity I and n (where n is the size of the workgroup)
31
31
/// elements[a0, a1, … an-1] resulting in [I, a0, (a0 op a1), … (a0 op a1 op … op an-2)].
32
32
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 ,
35
41
/// Reserved.
36
42
///
37
43
/// Requires Capability `GroupNonUniformPartitionedNV`.
@@ -46,15 +52,6 @@ pub enum GroupOperation {
46
52
PartitionedExclusiveScanNV = 8 ,
47
53
}
48
54
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
-
58
55
/// Only usable if the extension GL_KHR_shader_subgroup_basic is enabled.
59
56
///
60
57
/// The function subgroupBarrier() enforces that all active invocations within a
@@ -782,7 +779,7 @@ macro_rules! macro_subgroup_op_clustered {
782
779
concat!( "%result = " , $asm_op, " _ %subgroup {groupop} %value %clustersize" ) ,
783
780
"OpStore {result} %result" ,
784
781
subgroup = const SUBGROUP ,
785
- groupop = const GROUP_OPERATION_CLUSTERED_REDUCE ,
782
+ groupop = const ( GroupOperation :: ClusteredReduce as u32 ) ,
786
783
clustersize = const CLUSTER_SIZE ,
787
784
value = in( reg) & value,
788
785
result = in( reg) & mut result,
0 commit comments