Skip to content

Conversation

@zeux
Copy link
Contributor

@zeux zeux commented May 11, 2025

Previously we have supported sparse accessors for cgltf_accessor_unpack_floats but not for various read_ functions. This could lead to applications using read_ functions for specific cases and the code would work for most glTF files but fail on files with sparse data.

This change supports sparse indices by using binary search to find the index; the keys in sparse accessors are guaranteed to monotonically increase. This is still slower than a single linear pass that unpack_floats does, but will work correctly and have acceptable performance.

Previously we have supported sparse accessors for cgltf_accessor_unpack_floats
but not for various read_ functions. This could lead to applications using
read_ functions for specific cases and the code would work for most glTF files
but fail on files with sparse data.

This change supports sparse indices by using a binary search to find the index;
the keys in sparse accessors are guaranteed to monotonically increase. This is
still slower than a single linear pass that unpack_floats does, but will work
correctly and have acceptable performance.
@jkuhlmann jkuhlmann merged commit c32e779 into jkuhlmann:master May 23, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants