optimize_vertex_cache

Function optimize_vertex_cache 

Source
pub fn optimize_vertex_cache(
    destination: &mut [u32],
    indices: &[u32],
    vertex_count: usize,
)
Expand description

Reorders indices to reduce the number of GPU vertex shader invocations.

If index buffer contains multiple ranges for multiple draw calls, this functions needs to be called on each range individually.

ยงArguments

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