#[repr(C)]pub struct AnimQuadVertex {
pub position: [f32; 2],
pub uv: [f32; 2],
pub slot: u32,
pub _pad: u32,
}Expand description
Vertex for the shader-driven animated-quad pipeline (procedural
and sprite kinds). All four vertices of a quad carry the same
slot, which the fragment shader uses to look up per-frame state
(phase, resolved colors, atlas dims) in the anim_uniforms buffer.
No color or timing is baked in the vertex — that’s the whole point:
rebuilding the vertex batch is unnecessary when only the phase
changes, so the widget’s paint() doesn’t re-run per frame.
Fields§
§position: [f32; 2]Pixel position; converted to NDC in the render loop.
uv: [f32; 2]Local UV within the quad (0..1 across each axis). The fragment
shader uses uv.x to decide sweep inclusion; the sprite shader
combines it with AnimParams::atlas_cols/atlas_rows to sample
the atlas cell.
slot: u32Index into the renderer’s AnimParams uniform array. Same for
all four vertices of a quad; declared @interpolate(flat) in
WGSL to preserve the integer across rasterization.
_pad: u32Struct padding to keep stride a multiple of 8 bytes (matches
QuadVertex convention for wgpu vertex-buffer layouts).
Implementations§
Source§impl AnimQuadVertex
impl AnimQuadVertex
pub fn from_animated_quad( draw: &AnimatedQuadDraw, scale_factor: f32, ) -> [AnimQuadVertex; 4]
Trait Implementations§
Source§impl Clone for AnimQuadVertex
impl Clone for AnimQuadVertex
Source§fn clone(&self) -> AnimQuadVertex
fn clone(&self) -> AnimQuadVertex
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AnimQuadVertex
Source§impl Debug for AnimQuadVertex
impl Debug for AnimQuadVertex
impl Pod for AnimQuadVertex
Auto Trait Implementations§
impl Freeze for AnimQuadVertex
impl RefUnwindSafe for AnimQuadVertex
impl Send for AnimQuadVertex
impl Sync for AnimQuadVertex
impl Unpin for AnimQuadVertex
impl UnsafeUnpin for AnimQuadVertex
impl UnwindSafe for AnimQuadVertex
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
bits
as &Self.