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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/gltfio/src/extended/AssetLoaderExtended.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

if (!mCgltfBuffersLoaded) return false;
mbalajee marked this conversation as resolved.
Show resolved Hide resolved
}

utility::decodeDracoMeshes(gltf, prim, input->dracoCache);
utility::decodeMeshoptCompression(gltf);

auto slots = computeGeometries(prim, jobType, attributesMap, morphTargets, out->uvmap, mEngine);

Expand Down
Loading