Skip to content

Commit 3455bb3

Browse files
committed
scalar or vector: add ScalarOrVectorComposite for subgroup intrinsics
1 parent 750705d commit 3455bb3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

crates/spirv-std/src/scalar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ macro_rules! impl_scalar {
6363
impl Sealed for $ty {}
6464
impl ScalarOrVectorComposite for $ty {
6565
#[inline]
66-
fn transform<F: ScalarOrVectorTransform>(&self, f: &mut F) -> Self {
67-
f.transform_scalar(*self)
66+
fn transform<F: ScalarOrVectorTransform>(self, f: &mut F) -> Self {
67+
f.transform_scalar(self)
6868
}
6969
}
7070
unsafe impl ScalarOrVector for $ty {

crates/spirv-std/src/scalar_or_vector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub trait ScalarOrVectorComposite: Copy + Send + Sync + 'static {
4141
/// Transform the individual [`Scalar`] and [`Vector`] values of this type to a different value.
4242
///
4343
/// See [`Self`] for more detail.
44-
fn transform<F: ScalarOrVectorTransform>(&self, f: &mut F) -> Self;
44+
fn transform<F: ScalarOrVectorTransform>(self, f: &mut F) -> Self;
4545
}
4646

4747
/// A transform operation for [`ScalarOrVectorComposite::transform`]
@@ -65,7 +65,7 @@ pub trait ScalarOrVectorTransform {
6565
/// `Default` is unfortunately necessary until rust-gpu improves
6666
impl<T: ScalarOrVectorComposite + Default, const N: usize> ScalarOrVectorComposite for [T; N] {
6767
#[inline]
68-
fn transform<F: ScalarOrVectorTransform>(&self, f: &mut F) -> Self {
68+
fn transform<F: ScalarOrVectorTransform>(self, f: &mut F) -> Self {
6969
let mut out = [T::default(); N];
7070
for i in 0..N {
7171
out[i] = self[i].transform(f);

crates/spirv-std/src/vector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ macro_rules! impl_vector {
5959
impl Sealed for $ty {}
6060
impl ScalarOrVectorComposite for $ty {
6161
#[inline]
62-
fn transform<F: ScalarOrVectorTransform>(&self, f: &mut F) -> Self {
63-
f.transform_vector(*self)
62+
fn transform<F: ScalarOrVectorTransform>(self, f: &mut F) -> Self {
63+
f.transform_vector(self)
6464
}
6565
}
6666
unsafe impl ScalarOrVector for $ty {

0 commit comments

Comments
 (0)