From 804c207dcc07b9ae39922a3475de7e9a513f3e16 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Wed, 1 Mar 2023 09:51:08 -0800 Subject: Partial solution for SL-18458 Materials override cache not working and related SL-18684/SL-19206/SL-19173 --- indra/newview/llviewerregion.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index e3ac1767fb..afe48f01b5 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -785,7 +785,7 @@ void LLViewerRegion::loadObjectCache() if(LLVOCache::instanceExists()) { LLVOCache & vocache = LLVOCache::instance(); - vocache.readFromCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap) ; + vocache.readFromCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap); vocache.readGenericExtrasFromCache(mHandle, mImpl->mCacheID, mImpl->mGLTFOverridesJson); if (mImpl->mCacheMap.empty()) @@ -814,7 +814,8 @@ void LLViewerRegion::saveObjectCache() bool removal_enabled = sVOCacheCullingEnabled && (mRegionTimer.getElapsedTimeF32() > start_time_threshold); //allow to remove invalid objects from object cache file. LLVOCache & instance = LLVOCache::instance(); - instance.writeToCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap, mCacheDirty, removal_enabled) ; + + instance.writeToCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap, mCacheDirty, removal_enabled); instance.writeGenericExtrasToCache(mHandle, mImpl->mCacheID, mImpl->mGLTFOverridesJson, mCacheDirty, removal_enabled); mCacheDirty = FALSE; } @@ -822,6 +823,7 @@ void LLViewerRegion::saveObjectCache() // Map of LLVOCacheEntry takes time to release, store map for cleanup on idle sRegionCacheCleanup.insert(mImpl->mCacheMap.begin(), mImpl->mCacheMap.end()); mImpl->mCacheMap.clear(); + // TODO - probably need to do the same for overrides cache } void LLViewerRegion::sendMessage() @@ -2646,6 +2648,8 @@ void LLViewerRegion::cacheFullUpdateGLTFOverride(const LLGLTFOverrideCacheEntry LLViewerObject * obj = gObjectList.findObject(object_id); if (obj != nullptr) { + llassert(obj->getRegion() == this); + U32 local_id = obj->getLocalID(); mImpl->mGLTFOverridesJson[local_id] = override_data; @@ -3547,4 +3551,8 @@ void LLViewerRegion::loadCacheMiscExtras(U32 local_id, LLVOCacheEntry * entry, U { LLGLTFMaterialList::loadCacheOverrides(iter->second); } + else + { + LL_DEBUGS("GLTF") << "cache miss for handle: " << mHandle << " local_id:" << local_id << LL_ENDL; + } } -- cgit v1.2.3