pub struct SwizzleExpand { /* private fields */ }Implementations§
Source§impl SwizzleExpand
impl SwizzleExpand
Sourcepub fn __expand_apply_method(
&self,
scope: &Scope,
offset: <u32 as CubeType>::ExpandType,
type_size: usize,
) -> <u32 as CubeType>::ExpandType
pub fn __expand_apply_method( &self, scope: &Scope, offset: <u32 as CubeType>::ExpandType, type_size: usize, ) -> <u32 as CubeType>::ExpandType
Apply the swizzle to a coordinate with a given item size. This is the size of the full type,
including vectorization.
offset should be in terms of vectors from the start of the buffer, and the buffer should be
aligned to repeats_after. This is to work around the fact we don’t currently support
retrieving the actual address of an offset.
If you’re using absolute/unvectorized indices, pass E::Scalar::type_size() instead of the full
vector size.
Sourcepub fn __expand_repeats_after_method(&self, scope: &Scope) -> u32
pub fn __expand_repeats_after_method(&self, scope: &Scope) -> u32
After how many elements this pattern repeats. Can be used to align the buffer (i.e. smem) so offsets match addresses.
Sourcepub fn __expand_new(scope: &Scope, bits: u32, base: u32, shift: i32) -> Self
pub fn __expand_new(scope: &Scope, bits: u32, base: u32, shift: i32) -> Self
Create a new swizzle with comptime parameters
Sourcepub fn __expand_none(scope: &Scope) -> Self
pub fn __expand_none(scope: &Scope) -> Self
Create a new noop swizzle object
Sourcepub fn __expand_apply(
scope: &Scope,
this: &Self,
offset: <u32 as CubeType>::ExpandType,
type_size: usize,
) -> <u32 as CubeType>::ExpandType
pub fn __expand_apply( scope: &Scope, this: &Self, offset: <u32 as CubeType>::ExpandType, type_size: usize, ) -> <u32 as CubeType>::ExpandType
Apply the swizzle to a coordinate with a given item size. This is the size of the full type,
including vectorization.
offset should be in terms of vectors from the start of the buffer, and the buffer should be
aligned to repeats_after. This is to work around the fact we don’t currently support
retrieving the actual address of an offset.
If you’re using absolute/unvectorized indices, pass E::Scalar::type_size() instead of the full
vector size.
Sourcepub fn __expand_repeats_after(scope: &Scope, this: &Self) -> u32
pub fn __expand_repeats_after(scope: &Scope, this: &Self) -> u32
After how many elements this pattern repeats. Can be used to align the buffer (i.e. smem) so offsets match addresses.
Trait Implementations§
Source§impl AsMutExpand for SwizzleExpand
impl AsMutExpand for SwizzleExpand
fn __expand_ref_mut_method(&mut self, _: &Scope) -> &mut Self
fn __expand_as_mut_method(&mut self, scope: &Scope) -> &mut T
Source§impl AsRefExpand for SwizzleExpand
impl AsRefExpand for SwizzleExpand
fn __expand_ref_method(&self, _: &Scope) -> &Self
fn __expand_as_ref_method(&self, scope: &Scope) -> &T
Source§impl Clone for SwizzleExpand
impl Clone for SwizzleExpand
Source§fn clone(&self) -> SwizzleExpand
fn clone(&self) -> SwizzleExpand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SwizzleExpand
Source§impl CubeDebug for SwizzleExpand
impl CubeDebug for SwizzleExpand
Source§fn set_debug_name(&self, scope: &Scope, name: &'static str)
fn set_debug_name(&self, scope: &Scope, name: &'static str)
Source§impl ExpandTypeClone for SwizzleExpand
impl ExpandTypeClone for SwizzleExpand
Source§fn clone_unchecked(&self) -> Self
fn clone_unchecked(&self) -> Self
Clone semantics and should only be used for the
conceptual expand values, never real data. Using two values in the same branch is undefined
behaviour.Source§impl IntoExpand for SwizzleExpand
impl IntoExpand for SwizzleExpand
type Expand = SwizzleExpand
fn into_expand(self, _: &Scope) -> Self
Auto Trait Implementations§
impl Freeze for SwizzleExpand
impl RefUnwindSafe for SwizzleExpand
impl Send for SwizzleExpand
impl Sync for SwizzleExpand
impl Unpin for SwizzleExpand
impl UnsafeUnpin for SwizzleExpand
impl UnwindSafe for SwizzleExpand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more