pub struct RenderMesh<V> {
pub glyphs: Vec<GlyphMesh<V>>,
pub total_vertices: usize,
pub total_indices: usize,
}Expand description
A collection of glyph meshes ready for GPU rendering.
This is the Stage 5 output format for GPU pipelines. Each glyph has its own mesh with position offset applied.
§Memory Layout
All vertex types are #[repr(C)] with documented sizes:
Vertex2D: 8 bytes (2 × f32)VertexUV: 16 bytes (4 × f32)VertexColor: 24 bytes (6 × f32)- Indices: 4 bytes each (u32)
§Merging Meshes
For batch rendering, use merge_all() to combine glyphs into a single mesh:
ⓘ
let render_mesh = RenderMesh::<Vertex2D>::new();
// ... add glyph meshes ...
let (vertices, indices) = render_mesh.merge_all();Fields§
§glyphs: Vec<GlyphMesh<V>>Individual glyph meshes
total_vertices: usizeTotal vertex count across all glyphs
total_indices: usizeTotal index count across all glyphs
Implementations§
Source§impl<V> RenderMesh<V>
impl<V> RenderMesh<V>
Sourcepub fn with_capacity(glyph_count: usize) -> Self
pub fn with_capacity(glyph_count: usize) -> Self
Creates a render mesh with pre-allocated capacity.
Sourcepub fn glyph_count(&self) -> usize
pub fn glyph_count(&self) -> usize
Returns the number of glyphs in this mesh.
Sourcepub fn total_triangles(&self) -> usize
pub fn total_triangles(&self) -> usize
Returns the total triangle count across all glyphs.
Source§impl<V: Copy> RenderMesh<V>
impl<V: Copy> RenderMesh<V>
Trait Implementations§
Source§impl<V: Clone> Clone for RenderMesh<V>
impl<V: Clone> Clone for RenderMesh<V>
Source§fn clone(&self) -> RenderMesh<V>
fn clone(&self) -> RenderMesh<V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<V: Debug> Debug for RenderMesh<V>
impl<V: Debug> Debug for RenderMesh<V>
Auto Trait Implementations§
impl<V> Freeze for RenderMesh<V>
impl<V> RefUnwindSafe for RenderMesh<V>where
V: RefUnwindSafe,
impl<V> Send for RenderMesh<V>where
V: Send,
impl<V> Sync for RenderMesh<V>where
V: Sync,
impl<V> Unpin for RenderMesh<V>where
V: Unpin,
impl<V> UnsafeUnpin for RenderMesh<V>
impl<V> UnwindSafe for RenderMesh<V>where
V: UnwindSafe,
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