-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utilities to extract data from accessors #20
Conversation
Signed-off-by: forenoonwatch <91013521+forenoonwatch@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few general things:
- Please adapt the
else
style to the rest of the repo, as well as the naming (currently snake_case) of the template specialisation constants. - Probably should add some static_asserts that the required ElementTraits all exist, and that certain template types meet some criteria (could use concepts with a C++20 preprocessor guard).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I'd like to see more comments around the top level functions and in some complex situations for the future.
- In Release mode on MSVC the "getAccessorElement" test fails sometimes (!) with sparse accessors. With a debugger I noticed the values are definitely wrong but I couldn't tell you why.
REQUIRE(checkValues[i] == fastgltf::getAccessorElementglm::vec3(*asset, secondAccessor, i))
with expansion:
{?} == {?}
I've been able to replicate this in my MinGW release (intermittently). Trying to see if I can actually figure out what's causing it. |
Signed-off-by: forenoonwatch <91013521+forenoonwatch@users.noreply.github.com>
This PR adds fastgltf_tools.hpp, a header containing several utility functions such as
getAccessorElement
,iterateAccessor
, andfillTargetFromAccessor
, theElementTraits<T>
struct for matching metadata about the desired type, and theDefaultBufferDataAdapter
, a minimal default implementation of theBufferDataAdapter
pattern which allows the accessor indexing functions to resolve used buffer memory.Currently this PR lacks support for compressed buffer views from EXT_meshopt_compression.