Struct crevice::std140::DynamicUniform
source · pub struct DynamicUniform<T>(pub T);
Expand description
Wrapper type that aligns the inner type to at least 256 bytes.
This type is useful for ensuring correct alignment when creating dynamic uniform buffers in APIs like WebGPU.
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T: AsStd140> AsStd140 for DynamicUniform<T>
impl<T: AsStd140> AsStd140 for DynamicUniform<T>
§type Output = DynamicUniformStd140<<T as AsStd140>::Output>
type Output = DynamicUniformStd140<<T as AsStd140>::Output>
The
std140
version of this value.source§fn from_std140(value: Self::Output) -> Self
fn from_std140(value: Self::Output) -> Self
Converts from
std140
version of self to self.source§fn std140_size_static() -> usize
fn std140_size_static() -> usize
Returns the size of the
std140
version of this type. Useful for
pre-sizing buffers.Auto Trait Implementations§
impl<T> Freeze for DynamicUniform<T>where
T: Freeze,
impl<T> RefUnwindSafe for DynamicUniform<T>where
T: RefUnwindSafe,
impl<T> Send for DynamicUniform<T>where
T: Send,
impl<T> Sync for DynamicUniform<T>where
T: Sync,
impl<T> Unpin for DynamicUniform<T>where
T: Unpin,
impl<T> UnwindSafe for DynamicUniform<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.source§impl<T> WriteStd140 for Twhere
T: AsStd140,
impl<T> WriteStd140 for Twhere
T: AsStd140,
source§fn std140_size(&self) -> usize
fn std140_size(&self) -> usize
The space required to write this value using
std140
layout rules. This
does not include alignment padding that may be needed before or after
this type when written as part of a larger buffer.