Skip to content
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

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

mbalajee
Copy link
Contributor

@mbalajee mbalajee commented Aug 21, 2024

Decoding the mesh optimized gltf in a loop slows down the extended algo drastically & crashes the app with larger primitives

@mbalajee
Copy link
Contributor Author

@pirlande-fw

@@ -527,11 +527,11 @@ bool AssetLoaderExtended::createPrimitive(Input* input, Output* out,

if (!mCgltfBuffersLoaded) {
mCgltfBuffersLoaded = utility::loadCgltfBuffers(gltf, mGltfPath.c_str(), mUriDataCache);
utility::decodeMeshoptCompression(gltf);
Copy link
Collaborator

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?

Copy link
Contributor Author

@mbalajee mbalajee Aug 21, 2024

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?

Copy link
Contributor

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.

@pixelflinger pixelflinger added the internal Issue/PR does not affect clients label Aug 21, 2024
@pixelflinger pixelflinger enabled auto-merge (rebase) August 23, 2024 04:03
@pixelflinger pixelflinger disabled auto-merge August 23, 2024 18:02
@pixelflinger pixelflinger merged commit 485c057 into google:main Aug 23, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Issue/PR does not affect clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants