Skip to content

Commit 8e155ee

Browse files
committed
abi layout: change Subgroup from transparent struct to typedef
1 parent e2e3365 commit 8e155ee

11 files changed

+38
-41
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ const SUBGROUP: u32 = Scope::Subgroup as u32;
1313

1414
/// `SubgroupMask` is a [`glam::UVec4`] representing a bitmask of all invocations within a subgroup.
1515
/// Mostly used in group ballot operations.
16-
#[repr(transparent)]
17-
#[derive(Copy, Clone, Default, Eq, PartialEq)]
18-
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Zeroable, bytemuck::Pod))]
19-
pub struct SubgroupMask(pub glam::UVec4);
16+
pub type SubgroupMask = glam::UVec4;
2017

2118
/// Defines the class of group operation.
2219
#[non_exhaustive]

tests/compiletests/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 378 13
4+
OpLine %6 375 13
55
%7 = OpGroupNonUniformBallot %8 %9 %4
6-
OpLine %6 417 13
6+
OpLine %6 414 13
77
%10 = OpGroupNonUniformInverseBallot %2 %9 %7
88
OpNoLine
99
OpReturnValue %10

tests/compiletests/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 512 0
4+
OpLine %7 509 0
55
%8 = OpGroupNonUniformBallotBitCount %2 %9 Reduce %4
66
OpNoLine
77
OpReturnValue %8

tests/compiletests/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 344 13
4+
OpLine %6 341 13
55
%7 = OpGroupNonUniformBroadcastFirst %2 %8 %4
66
OpNoLine
77
OpReturnValue %7

tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.stderr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
error[E0080]: evaluation panicked: `ClusterSize` must be at least 1
2-
--> $SPIRV_STD_SRC/arch/subgroup.rs:840:1
2+
--> $SPIRV_STD_SRC/arch/subgroup.rs:837:1
33
|
4-
840 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
5-
841 | | An integer add group operation of all `value` operands contributed by active invocations in the group.
6-
842 | |
7-
843 | | Result Type must be a scalar or vector of integer type.
4+
837 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
5+
838 | | An integer add group operation of all `value` operands contributed by active invocations in the group.
6+
839 | |
7+
840 | | Result Type must be a scalar or vector of integer type.
88
... |
9-
856 | | * `ClusterSize` must not be greater than the size of the group
10-
857 | | ");
9+
853 | | * `ClusterSize` must not be greater than the size of the group
10+
854 | | ");
1111
| |__^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<0, u32, u32>::{constant#0}` failed here
1212
|
1313
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info)
1414

1515
note: erroneous constant encountered
16-
--> $SPIRV_STD_SRC/arch/subgroup.rs:840:1
16+
--> $SPIRV_STD_SRC/arch/subgroup.rs:837:1
1717
|
18-
840 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
19-
841 | | An integer add group operation of all `value` operands contributed by active invocations in the group.
20-
842 | |
21-
843 | | Result Type must be a scalar or vector of integer type.
18+
837 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
19+
838 | | An integer add group operation of all `value` operands contributed by active invocations in the group.
20+
839 | |
21+
840 | | Result Type must be a scalar or vector of integer type.
2222
... |
23-
856 | | * `ClusterSize` must not be greater than the size of the group
24-
857 | | ");
23+
853 | | * `ClusterSize` must not be greater than the size of the group
24+
854 | | ");
2525
| |__^
2626
|
2727
= note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info)

tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.stderr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
error[E0080]: evaluation panicked: `ClusterSize` must be a power of 2
2-
--> $SPIRV_STD_SRC/arch/subgroup.rs:840:1
2+
--> $SPIRV_STD_SRC/arch/subgroup.rs:837:1
33
|
4-
840 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
5-
841 | | An integer add group operation of all `value` operands contributed by active invocations in the group.
6-
842 | |
7-
843 | | Result Type must be a scalar or vector of integer type.
4+
837 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
5+
838 | | An integer add group operation of all `value` operands contributed by active invocations in the group.
6+
839 | |
7+
840 | | Result Type must be a scalar or vector of integer type.
88
... |
9-
856 | | * `ClusterSize` must not be greater than the size of the group
10-
857 | | ");
9+
853 | | * `ClusterSize` must not be greater than the size of the group
10+
854 | | ");
1111
| |__^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<5, u32, u32>::{constant#0}` failed here
1212
|
1313
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info)
1414

1515
note: erroneous constant encountered
16-
--> $SPIRV_STD_SRC/arch/subgroup.rs:840:1
16+
--> $SPIRV_STD_SRC/arch/subgroup.rs:837:1
1717
|
18-
840 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
19-
841 | | An integer add group operation of all `value` operands contributed by active invocations in the group.
20-
842 | |
21-
843 | | Result Type must be a scalar or vector of integer type.
18+
837 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
19+
838 | | An integer add group operation of all `value` operands contributed by active invocations in the group.
20+
839 | |
21+
840 | | Result Type must be a scalar or vector of integer type.
2222
... |
23-
856 | | * `ClusterSize` must not be greater than the size of the group
24-
857 | | ");
23+
853 | | * `ClusterSize` must not be greater than the size of the group
24+
854 | | ");
2525
| |__^
2626
|
2727
= note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info)

tests/compiletests/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 174 13
3+
OpLine %5 171 13
44
%6 = OpGroupNonUniformElect %2 %7
55
OpNoLine
66
OpReturnValue %6

tests/compiletests/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 840 0
4+
OpLine %6 837 0
55
%7 = OpGroupNonUniformIAdd %2 %8 ClusteredReduce %4 %9
66
OpNoLine
77
OpReturnValue %7

tests/compiletests/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 827 0
4+
OpLine %6 824 0
55
%7 = OpGroupNonUniformIAdd %2 %8 ExclusiveScan %4
66
OpNoLine
77
OpReturnValue %7

tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_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 827 0
4+
OpLine %6 824 0
55
%7 = OpGroupNonUniformIAdd %2 %8 InclusiveScan %4
66
OpNoLine
77
OpReturnValue %7

0 commit comments

Comments
 (0)