Skip to main content

Module vertex

Module vertex 

Source

Structs§

AnimQuadVertex
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.
PathGradientVertex
Vertex for the gradient-filled path pipeline (Tier 3 arbitrary paths filled with a Paint gradient — linear/radial/conic). Solid-filled paths keep using the lean QuadVertex/quad_pipeline, tinted by a flat vertex color (see path_quad_verts in renderer.rs); this vertex type is only built when PathEntry::paint_data is a gradient variant, and is drawn by the dedicated path_gradient pipeline (shaders/path_gradient.wgsl).
QuadVertex
Vertex for the textured quad pipeline (glyphs, images).
RectVertex
Vertex for the colored rectangle pipeline (decorations).
SdfVertex
Vertex for the SDF shape pipeline (rounded rects, circles).
ShadowVertex
Vertex for the shadow pipeline (box shadows with Gaussian blur).

Constants§

QUAD_FLAG_COLOR_GLYPH
Per-vertex flag: sample atlas texture.rgb directly (color emoji) instead of using the texture as an alpha mask tinted by vertex color.
QUAD_INDICES
Standard quad indices for two triangles from 4 vertices.

Functions§

generate_quad_indices
Generate indices for N quads.
srgb_to_linear_rgba
Linearize an RGBA color for GPU upload. Alpha passes through unchanged because Rgba8UnormSrgb only gamma-encodes RGB.