pub struct AlphaAddress {
pub x: u32,
pub y: u32,
pub channel: u32,
pub byte: u32,
}Expand description
Where one alpha value lives in an alpha texture: its texel, the channel within that texel, and the byte within that channel.
The shader reconstructs the same address from a strip’s col_idx with
shifts and masks, using GpuConfig::alphas_tex_width_bits for the row
stride.
Fields§
§x: u32Texel column.
y: u32Texel row.
channel: u32Channel within the texel (0-3).
byte: u32Byte within the channel (0-3).
Implementations§
Source§impl AlphaAddress
impl AlphaAddress
Sourcepub const fn byte_offset(self, width: u32) -> u32
pub const fn byte_offset(self, width: u32) -> u32
The offset of this address in an upload buffer of a texture width
texels wide — the inverse of alpha_address, which is what makes
the packing round-trippable.
Trait Implementations§
Source§impl Clone for AlphaAddress
impl Clone for AlphaAddress
impl Copy for AlphaAddress
Source§impl Debug for AlphaAddress
impl Debug for AlphaAddress
impl Eq for AlphaAddress
Source§impl PartialEq for AlphaAddress
impl PartialEq for AlphaAddress
impl StructuralPartialEq for AlphaAddress
Auto Trait Implementations§
impl Freeze for AlphaAddress
impl RefUnwindSafe for AlphaAddress
impl Send for AlphaAddress
impl Sync for AlphaAddress
impl Unpin for AlphaAddress
impl UnsafeUnpin for AlphaAddress
impl UnwindSafe for AlphaAddress
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.