generate_vertex_remap

Function generate_vertex_remap 

Source
pub fn generate_vertex_remap(
    destination: &mut [u32],
    indices: Option<&[u32]>,
    vertices: &Stream<'_>,
) -> usize
Expand description

Generates a vertex remap table from the vertex buffer and an optional index buffer and returns number of unique vertices.

As a result, all vertices that are binary equivalent map to the same (new) location, with no gaps in the resulting sequence. Resulting remap table maps old vertices to new vertices and can be used in remap_vertex_buffer/remap_index_buffer.

Note that binary equivalence considers all Stream::subset bytes, including padding which should be zero-initialized.

ยงArguments

  • destination: must contain enough space for the resulting remap table (vertex_count elements defined by vertices)
  • indices: can be None if the input is unindexed