gltfio: Clear texture caches before loading resources (#5580)

* gltfio: Clear texture caches before loading resources

* iOS gltf-viewer: add double-tap to reload model for debugging

* iOS samples: add instructions on ASan / UBSan debugging
This commit is contained in:
Ben Doherty
2022-05-20 11:41:24 -07:00
committed by GitHub
parent 035f162ebc
commit 3461ec863b
3 changed files with 32 additions and 2 deletions

View File

@@ -342,6 +342,11 @@ bool ResourceLoader::loadResources(FFilamentAsset* asset, bool async) {
SYSTRACE_CONTEXT();
SYSTRACE_ASYNC_END("addResourceData", 1);
// Clear our texture caches. Previous calls to loadResources may have populated these, but the
// Texture objects could have since been destroyed.
pImpl->mBufferTextureCache.clear();
pImpl->mFilepathTextureCache.clear();
if (asset->mResourcesLoaded) {
return false;
}