Skip to content

Commit 63a03d4

Browse files
committed
subgroup ops refactor, matches glsl more closely
1 parent 18b9f75 commit 63a03d4

14 files changed

+490
-1230
lines changed

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

Lines changed: 476 additions & 1216 deletions
Large diffs are not rendered by default.

tests/ui/arch/subgroup/subgroup_ballot.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
%1 = OpFunction %2 None %3
22
%4 = OpFunctionParameter %2
33
%5 = OpLabel
4-
OpLine %6 379 8
4+
OpLine %6 380 8
55
%7 = OpGroupNonUniformBallot %8 %9 %4
6-
OpLine %6 415 8
6+
OpLine %6 416 8
77
%10 = OpGroupNonUniformInverseBallot %2 %9 %7
88
OpNoLine
99
OpReturnValue %10

tests/ui/arch/subgroup/subgroup_ballot_bit_count.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use spirv_std::arch::{GroupOperation, SubgroupMask};
66
use spirv_std::spirv;
77

88
unsafe fn subgroup_ballot_bit_count(ballot: SubgroupMask) -> u32 {
9-
spirv_std::arch::subgroup_ballot_bit_count::<{ GroupOperation::Reduce as u32 }>(ballot)
9+
spirv_std::arch::subgroup_ballot_bit_count(ballot)
1010
}
1111

1212
#[spirv(compute(threads(1, 1, 1)))]

tests/ui/arch/subgroup/subgroup_ballot_bit_count.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%1 = OpFunction %2 None %3
22
%4 = OpFunctionParameter %5
33
%6 = OpLabel
4-
OpLine %7 491 8
4+
OpLine %7 512 0
55
%8 = OpGroupNonUniformBallotBitCount %2 %9 Reduce %4
66
OpNoLine
77
OpReturnValue %8

tests/ui/arch/subgroup/subgroup_broadcast_first.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%1 = OpFunction %2 None %3
22
%4 = OpFunctionParameter %2
33
%5 = OpLabel
4-
OpLine %6 346 8
4+
OpLine %6 347 8
55
%7 = OpGroupNonUniformBroadcastFirst %2 %8 %4
66
OpNoLine
77
OpReturnValue %7

tests/ui/arch/subgroup/subgroup_elect.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%1 = OpFunction %2 None %3
22
%4 = OpLabel
3-
OpLine %5 181 8
3+
OpLine %5 182 8
44
%6 = OpGroupNonUniformElect %2 %7
55
OpNoLine
66
OpReturnValue %6

tests/ui/arch/subgroup/subgroup_i_add_clustered.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use spirv_std::arch::{GroupOperation, SubgroupMask};
77
use spirv_std::spirv;
88

99
unsafe fn subgroup_i_add_clustered(value: u32) -> u32 {
10-
spirv_std::arch::subgroup_i_add_clustered::<8, _>(value)
10+
spirv_std::arch::subgroup_clustered_i_add::<8, _>(value)
1111
}
1212

1313
#[spirv(compute(threads(32, 1, 1)))]

tests/ui/arch/subgroup/subgroup_i_add_clustered.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%1 = OpFunction %2 None %3
22
%4 = OpFunctionParameter %2
33
%5 = OpLabel
4-
OpLine %6 782 8
4+
OpLine %6 810 0
55
%7 = OpGroupNonUniformIAdd %2 %8 ClusteredReduce %4 %9
66
OpNoLine
77
OpReturnValue %7

tests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use spirv_std::arch::{GroupOperation, SubgroupMask};
77
use spirv_std::spirv;
88

99
unsafe fn subgroup_i_add_exclusive_scan(value: u32) -> u32 {
10-
spirv_std::arch::subgroup_i_add::<{ GroupOperation::ExclusiveScan as u32 }, _>(value)
10+
spirv_std::arch::subgroup_exclusive_i_add(value)
1111
}
1212

1313
#[spirv(compute(threads(32, 1, 1)))]

tests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%1 = OpFunction %2 None %3
22
%4 = OpFunctionParameter %2
33
%5 = OpLabel
4-
OpLine %6 741 8
4+
OpLine %6 797 0
55
%7 = OpGroupNonUniformIAdd %2 %8 ExclusiveScan %4
66
OpNoLine
77
OpReturnValue %7

0 commit comments

Comments
 (0)