Skip to content

Commit

Permalink
utility::loadCgltfBuffers is done once instead of doing for each prim…
Browse files Browse the repository at this point in the history
…itive (#7969)
  • Loading branch information
mbalajee authored Jul 12, 2024
1 parent 39cfce6 commit 3728f06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libs/gltfio/src/extended/AssetLoaderExtended.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,9 @@ bool AssetLoaderExtended::createPrimitive(Input* input, Output* out,
slotCount++};
}

if (!utility::loadCgltfBuffers(gltf, mGltfPath.c_str(), mUriDataCache)) {
return false;
if (!mCgltfBuffersLoaded) {
mCgltfBuffersLoaded = utility::loadCgltfBuffers(gltf, mGltfPath.c_str(), mUriDataCache);
if (!mCgltfBuffersLoaded) return false;
}

utility::decodeDracoMeshes(gltf, prim, input->dracoCache);
Expand Down
1 change: 1 addition & 0 deletions libs/gltfio/src/extended/AssetLoaderExtended.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ struct AssetLoaderExtended {
std::string mGltfPath;
MaterialProvider& mMaterials;
UriDataCacheHandle mUriDataCache;
bool mCgltfBuffersLoaded;
};

} // namespace filament::gltfio
Expand Down

0 comments on commit 3728f06

Please sign in to comment.