Trait bevy_crevice::std140::Std140
source · [−]pub unsafe trait Std140: Copy + Zeroable + Pod {
type Padded: Std140Convertible<Self>;
const ALIGNMENT: usize;
const PAD_AT_END: bool = false;
fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
{ ... }
}
Expand description
Trait implemented for all std140
primitives. Generally should not be
implemented outside this crate.
Required Associated Types
type Padded: Std140Convertible<Self>
type Padded: Std140Convertible<Self>
Padded type (Std140Padded specialization)
The usual implementation is
type Padded = Std140Padded<Self, {align_offset(size_of::
Required Associated Constants
The required alignment of the type. Must be a power of two.
This is distinct from the value returned by std::mem::align_of
because
AsStd140
structs do not use Rust’s alignment. This enables them to
control and zero their padding bytes, making converting them to and from
slices safe.
Provided Associated Constants
const PAD_AT_END: bool = false
const PAD_AT_END: bool = false
Whether this type requires a padding at the end (ie, is a struct or an array of primitives). See https://www.khronos.org/registry/OpenGL/specs/gl/glspec45.core.pdf#page=159 (rule 4 and 9)
Provided Methods
Casts the type to a byte array. Implementors should not override this method.
Safety
This is always safe due to the requirements of bytemuck::Pod
being a
prerequisite for this trait.