@@ -28,8 +28,14 @@ pub enum GroupOperation {
2828 /// A binary operation with an identity I and n (where n is the size of the workgroup)
2929 /// elements[a0, a1, … an-1] resulting in [I, a0, (a0 op a1), … (a0 op a1 op … op an-2)].
3030 ExclusiveScan = 2 ,
31- // /// See [`GROUP_OPERATION_CLUSTERED_REDUCE`]
32- // ClusteredReduce = 3,
31+ /// The [`GroupOperation`] `ClusteredReduce`.
32+ ///
33+ /// All instructions with a [`GroupOperation`] require an additional `ClusterSize` parameter when [`GroupOperation`] is
34+ /// `ClusteredReduce`. To map this requirement into rust, all function have a base version accepting [`GroupOperation`]
35+ /// as a const generic, and a `_clustered` variant that is fixed to `ClusteredReduce` and takes the additional
36+ /// `ClusterSize` parameter as a const generic. To not accidentally use a `ClusteredReduce` in the base variant of the
37+ /// function, it was removed from the [`GroupOperation`] enum and instead resides individually.
38+ ClusteredReduce = 3 ,
3339 /// Reserved.
3440 ///
3541 /// Requires Capability `GroupNonUniformPartitionedNV`.
@@ -44,15 +50,6 @@ pub enum GroupOperation {
4450 PartitionedExclusiveScanNV = 8 ,
4551}
4652
47- /// The [`GroupOperation`] `ClusteredReduce`.
48- ///
49- /// All instructions with a [`GroupOperation`] require an additional `ClusterSize` parameter when [`GroupOperation`] is
50- /// `ClusteredReduce`. To map this requirement into rust, all function have a base version accepting [`GroupOperation`]
51- /// as a const generic, and a `_clustered` variant that is fixed to `ClusteredReduce` and takes the additional
52- /// `ClusterSize` parameter as a const generic. To not accidentally use a `ClusteredReduce` in the base variant of the
53- /// function, it was removed from the [`GroupOperation`] enum and instead resides individually.
54- pub const GROUP_OPERATION_CLUSTERED_REDUCE : u32 = 3 ;
55-
5653/// Only usable if the extension GL_KHR_shader_subgroup_basic is enabled.
5754///
5855/// The function subgroupBarrier() enforces that all active invocations within a
@@ -780,7 +777,7 @@ macro_rules! macro_subgroup_op_clustered {
780777 concat!( "%result = " , $asm_op, " _ %subgroup {groupop} %value %clustersize" ) ,
781778 "OpStore {result} %result" ,
782779 subgroup = const SUBGROUP ,
783- groupop = const GROUP_OPERATION_CLUSTERED_REDUCE ,
780+ groupop = const ( GroupOperation :: ClusteredReduce as u32 ) ,
784781 clustersize = const CLUSTER_SIZE ,
785782 value = in( reg) & value,
786783 result = in( reg) & mut result,
0 commit comments