Function meshopt_rs::vertex::fetch::optimize_vertex_fetch
source · [−]pub fn optimize_vertex_fetch<Vertex>(
destination: &mut [Vertex],
indices: &mut [u32],
vertices: &[Vertex]
) -> usizewhere
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)