optimize_vertex_fetch

Function optimize_vertex_fetch 

Source
pub fn optimize_vertex_fetch<Vertex>(
    destination: &mut [Vertex],
    indices: &mut [u32],
    vertices: &[Vertex],
) -> usize
where Vertex: Position + Copy,
Expand description

Reorders vertices and changes indices to reduce the amount of GPU memory fetches during vertex processing.

Returns the number of unique vertices, which is the same as input vertex count unless some vertices are unused. This functions works for a single vertex stream; for multiple vertex streams, use optimize_vertex_fetch_remap + remap_vertex_buffer for each stream.

ยงArguments

  • destination: must contain enough space for the resulting vertex buffer (vertices.len() elements)