#[repr(C, align(16))]pub struct ArrayMember<T>(pub T);
Expand description
Pads an element to be in an array in a shader.
All elements in arrays need to be aligned to 16 bytes. This automatically aligns your types to 16 bytes.
This glsl:
struct FloatArray {
float array[45];
};
turns into:
#[repr(C)]
struct FloatArray {
array: [shader_types::ArrayMember<f32>; 45]
}
Tuple Fields§
§0: T
Trait Implementations§
Source§impl<T: Clone> Clone for ArrayMember<T>
impl<T: Clone> Clone for ArrayMember<T>
Source§fn clone(&self) -> ArrayMember<T>
fn clone(&self) -> ArrayMember<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for ArrayMember<T>
impl<T: Debug> Debug for ArrayMember<T>
Source§impl<T: Default> Default for ArrayMember<T>
impl<T: Default> Default for ArrayMember<T>
Source§fn default() -> ArrayMember<T>
fn default() -> ArrayMember<T>
Returns the “default value” for a type. Read more
Source§impl<T: Hash> Hash for ArrayMember<T>
impl<T: Hash> Hash for ArrayMember<T>
Source§impl<T: Ord> Ord for ArrayMember<T>
impl<T: Ord> Ord for ArrayMember<T>
Source§fn cmp(&self, other: &ArrayMember<T>) -> Ordering
fn cmp(&self, other: &ArrayMember<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for ArrayMember<T>
impl<T: PartialEq> PartialEq for ArrayMember<T>
Source§impl<T: PartialOrd> PartialOrd for ArrayMember<T>
impl<T: PartialOrd> PartialOrd for ArrayMember<T>
Source§impl<T: Zeroable> Zeroable for ArrayMember<T>
impl<T: Zeroable> Zeroable for ArrayMember<T>
impl<T: Copy> Copy for ArrayMember<T>
impl<T: Eq> Eq for ArrayMember<T>
impl<T: Pod> Pod for ArrayMember<T>
impl<T> StructuralPartialEq for ArrayMember<T>
Auto Trait Implementations§
impl<T> Freeze for ArrayMember<T>where
T: Freeze,
impl<T> RefUnwindSafe for ArrayMember<T>where
T: RefUnwindSafe,
impl<T> Send for ArrayMember<T>where
T: Send,
impl<T> Sync for ArrayMember<T>where
T: Sync,
impl<T> Unpin for ArrayMember<T>where
T: Unpin,
impl<T> UnwindSafe for ArrayMember<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<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.