encode_index_buffer

Function encode_index_buffer 

Source
pub fn encode_index_buffer(
    buffer: &mut [u8],
    indices: &[u32],
    version: IndexEncodingVersion,
) -> Option<usize>
Expand description

Encodes index data into an array of bytes that is generally much smaller (<1.5 bytes/triangle) and compresses better (<1 bytes/triangle) compared to original.

Input index buffer must represent a triangle list.

Returns encoded data size on success, None on error; the only error condition is if buffer doesn’t have enough space.

For maximum efficiency the index buffer being encoded has to be optimized for vertex cache and vertex fetch first.

§Arguments