#[non_exhaustive]pub enum RowAlign {
Tight,
Cache64,
PixelCache64,
Samples(u16),
}Expand description
Row-start alignment policy for allocated buffers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Tight
Tightly packed rows (stride == width * bytes_per_pixel).
Cache64
64-byte row alignment (widest SIMD vector & cache line), with a +64 B
cache-set anti-aliasing bump whenever the rounded stride is a nonzero multiple of
4096 bytes (4 KiB, preventing L1 cache-set thrashing on vertical stencils/transposes).
PixelCache64
Whole-pixel 64-byte alignment (lcm(bytes_per_pixel, 64)), plus one alignment step
whenever the rounded stride is a nonzero multiple of 4096 bytes so whole-pixel
stride consumers like imgref stay aligned without 4 KiB set aliasing.
Samples(u16)
Align row stride to a multiple of N samples (0 treated as 1).
Implementations§
Source§impl RowAlign
impl RowAlign
Sourcepub const fn from_bytes(bytes: u16, sample: SampleType) -> Option<RowAlign>
pub const fn from_bytes(bytes: u16, sample: SampleType) -> Option<RowAlign>
Convert a byte pitch (such as wgpu’s 256-byte alignment) into RowAlign::Samples.
Trait Implementations§
impl Copy for RowAlign
impl Eq for RowAlign
impl StructuralPartialEq for RowAlign
Auto Trait Implementations§
impl Freeze for RowAlign
impl RefUnwindSafe for RowAlign
impl Send for RowAlign
impl Sync for RowAlign
impl Unpin for RowAlign
impl UnsafeUnpin for RowAlign
impl UnwindSafe for RowAlign
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