From a9d22b0f585cc90ba1bb94a68cc4175b3019b062 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 9 Sep 2013 11:58:52 -0600 Subject: some fix for SH-4416: Interesting: memory footprint is larger when loading from cache while ObjectCacheViewCullingEnabled is enabled than when it's disabled. --- indra/newview/llviewerregion.cpp | 12 ++++-------- indra/newview/llvocache.cpp | 5 +++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 9c038d54d5..7cc4195a3d 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1207,12 +1207,7 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time) max_update_time -= update_timer.getElapsedTimeF32(); - if(gViewerWindow->getProgressView()->getVisible()) - { - //in case rendering pipeline is not started yet. - mImpl->mVOCachePartition->cull(*(LLViewerCamera::getInstance()), false); - } - else if(max_update_time < 0.f) + if(max_update_time < 0.f && !gViewerWindow->getProgressView()->getVisible()) { return did_update; } @@ -1279,7 +1274,8 @@ F32 LLViewerRegion::killInvisibleObjects(F32 max_time) return max_time; } - size_t max_update = sNewObjectCreationThrottle < 0 ? mImpl->mActiveSet.size() : 64; + bool unstable = sNewObjectCreationThrottle < 0; + size_t max_update = unstable ? mImpl->mActiveSet.size() : 64; if(!mInvisibilityCheckHistory && isViewerCameraStatic()) { //history is clean, reduce number of checking @@ -1299,7 +1295,7 @@ F32 LLViewerRegion::killInvisibleObjects(F32 max_time) iter = mImpl->mActiveSet.begin(); } - if(!(*iter)->isRecentlyVisible() && (*iter)->mLastCameraUpdated < sLastCameraUpdated) + if(!(*iter)->isRecentlyVisible() && (unstable || (*iter)->mLastCameraUpdated < sLastCameraUpdated)) { killObject((*iter), delete_list); } diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 1cfda038a8..35af99cd42 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -636,6 +636,11 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion) return 0; } + if(LLViewerCamera::sCurCameraID >= LLViewerCamera::CAMERA_WATER0) + { + return 0; //no need for those cameras. + } + if(mCulledTime[LLViewerCamera::sCurCameraID] == LLViewerOctreeEntryData::getCurrentFrame()) { return 0; //already culled -- cgit v1.2.3