-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
decoding meshoptimized gltf just once #8071
decoding meshoptimized gltf just once #8071
Conversation
@@ -527,11 +527,11 @@ bool AssetLoaderExtended::createPrimitive(Input* input, Output* out, | |||
|
|||
if (!mCgltfBuffersLoaded) { | |||
mCgltfBuffersLoaded = utility::loadCgltfBuffers(gltf, mGltfPath.c_str(), mUriDataCache); | |||
utility::decodeMeshoptCompression(gltf); |
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.
What if this function is called with a different input->gltf
?
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.
that would be true for line 529 too right? this function is called from only one place, at-least with the current implementation, FAssetLoader::createPrimitives
which passes the gltf
from root asset.
May be do both loadCgltfBuffers
& decodeMeshoptCompression
at the calling site (FAssetLoader::createPrimitives) similar to ResourceLoader::loadResources
?
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.
yeah, I need to look at this closer I think. For now, this patch is good to go.
Co-authored-by: Powei Feng <[email protected]>
Decoding the mesh optimized gltf in a loop slows down the extended algo drastically & crashes the app with larger primitives