Expand description
Batched glyph rendering — layer-sorted, blend-mode-separated instanced draw calls.
The renderer needs to:
- Sort all active glyphs by (RenderLayer, blend_mode) to minimize state changes
- Pack each batch into a
GlyphInstancearray for the GPU - Issue one
draw_arrays_instancedcall per batch
§Batch key
(RenderLayer, BlendMode) — changes in either require a new draw call.
Within each batch, instances are further sorted by Z (back-to-front) for
transparent geometry.
Structs§
- Atlas
Upload Tracker - Tracks which atlas pages have been uploaded this frame (avoids redundant uploads).
- Batch
Key - Determines which draw call a glyph belongs to.
- Batch
Stats - Statistics from the last
finish()call. - Glyph
Batch - A CPU-side instance buffer for one draw call.
- Glyph
Batcher - Builds and sorts batches from a flat list of glyphs each frame.
- Glyph
Instance - Per-instance GPU data. Must match the vertex shader layout exactly.
- Pending
Glyph - Pending item — a glyph to be assigned to a batch.
- Render
Layer Ord - Ordered wrapper for RenderLayer (to allow sorting by layer).
Enums§
- Blend
Mode - GPU blend mode for a batch.