fn pack_geometry<'a>(
primitives: impl IntoIterator<Item = (Source, &'a ClippedPrimitive)>,
screen: ScreenDescriptor,
texture_options: &HashMap<TextureKey, TextureOptions>,
counts: GeometryCounts,
vertices: &mut Vec<u8>,
indices: &mut Vec<u8>,
draws: &mut Vec<UiDraw>,
)Available on crate feature
egui only.Expand description
Pack primitives into vertices and indices, and fill draws with where
each one landed.
Both byte buffers are cleared and resized rather than reallocated, so a caller that keeps them across frames reuses the allocation. The vertex buffer holds the primary stream first and the interleaved secondary stream second: wgpu binds one stride per slot and the two differ.
counts must be what measure returned for primitives: it is both how
much is written and where the two vertex streams meet.