#[repr(u8)]pub enum PositionLayout {
Packed3 = 1,
Padded4 = 2,
}Expand description
How to interleave atom positions for upload.
Variants§
Packed3 = 1
Tightly packed [x, y, z], 12-byte stride. Suits vertex buffers
(Float32x3).
Padded4 = 2
[x, y, z, 1.0], 16-byte stride. Required for storage/uniform buffers,
where WGSL array<vec3<f32>> and std140/std430 vec3 arrays use a
16-byte stride; uploading Packed3 there silently misreads every atom
after the first.
Implementations§
Source§impl PositionLayout
impl PositionLayout
Sourcepub const fn components(self) -> u32
pub const fn components(self) -> u32
Components per position.
Sourcepub const fn stride_bytes(self) -> u32
pub const fn stride_bytes(self) -> u32
Bytes per position.
Sourcepub const fn buffer_layout(self, count: u32) -> BufferLayout
pub const fn buffer_layout(self, count: u32) -> BufferLayout
Layout of a buffer holding count positions.
Trait Implementations§
Source§impl Clone for PositionLayout
impl Clone for PositionLayout
Source§fn clone(&self) -> PositionLayout
fn clone(&self) -> PositionLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PositionLayout
Source§impl Debug for PositionLayout
impl Debug for PositionLayout
impl Eq for PositionLayout
Source§impl Hash for PositionLayout
impl Hash for PositionLayout
Source§impl PartialEq for PositionLayout
impl PartialEq for PositionLayout
impl StructuralPartialEq for PositionLayout
Auto Trait Implementations§
impl Freeze for PositionLayout
impl RefUnwindSafe for PositionLayout
impl Send for PositionLayout
impl Sync for PositionLayout
impl Unpin for PositionLayout
impl UnsafeUnpin for PositionLayout
impl UnwindSafe for PositionLayout
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> 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> ⓘ
Converts
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> ⓘ
Converts
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