pub fn encode_vertex_buffer<Vertex>(
buffer: &mut [u8],
vertices: &[Vertex],
version: VertexEncodingVersion,
) -> Option<usize>
Expand description
Encodes vertex data into an array of bytes that is generally smaller and compresses better compared to original.
Returns encoded data size on success, None
on error; the only error condition is if buffer doesn’t have enough space.
This function works for a single vertex stream; for multiple vertex streams, call encode_vertex_buffer for each stream.
Note that all bytes of each vertex are encoded verbatim, including padding which should be zero-initialized.
§Arguments
buffer
: must contain enough space for the encoded vertex buffer (use encode_vertex_buffer_bound to compute worst case size)