From 58ee2a30ce5fb83186392693c7b014aa667e02cf Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 13 Nov 2013 09:40:48 -0700 Subject: more fix for SH-4607: Create new object cache tuning parameters --- indra/newview/llviewerregion.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index afc00764b8..06f9af8751 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1131,6 +1131,8 @@ void LLViewerRegion::updateVisibleEntries(F32 max_time) // //object projected area threshold F32 projection_threshold = LLVOCacheEntry::getSquaredPixelThreshold(mImpl->mVOCachePartition->isFrontCull()); + F32 dist_threshold = mImpl->mVOCachePartition->isFrontCull() ? gAgentCamera.mDrawDistance : LLVOCacheEntry::sRearFarRadius; + std::set< LLPointer >::iterator group_iter = mImpl->mVisibleGroups.begin(); for(; group_iter != mImpl->mVisibleGroups.end(); ++group_iter) { @@ -1153,7 +1155,7 @@ void LLViewerRegion::updateVisibleEntries(F32 max_time) continue; } - vo_entry->calcSceneContribution(local_origin, needs_update, last_update); + vo_entry->calcSceneContribution(local_origin, needs_update, last_update, dist_threshold); if(vo_entry->getSceneContribution() > projection_threshold) { mImpl->mWaitingList.insert(vo_entry); @@ -1389,10 +1391,9 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time) LLTimer update_timer; LLVector4a camera_origin; - camera_origin.load3(LLViewerCamera::getInstance()->getOrigin().mV); - F32 squared_back_threshold = LLVOCacheEntry::sRearFarRadius; - squared_back_threshold *= squared_back_threshold; - + camera_origin.load3(LLViewerCamera::getInstance()->getOrigin().mV); + F32 back_threshold = LLVOCacheEntry::sRearFarRadius; + bool unstable = sNewObjectCreationThrottle < 0; size_t max_update = unstable ? mImpl->mActiveSet.size() : 64; if(!mInvisibilityCheckHistory && isViewerCameraStatic()) @@ -1411,8 +1412,12 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time) { iter = mImpl->mActiveSet.begin(); } + if((*iter)->getParentID() > 0) + { + continue; //skip child objects, they are removed with their parent. + } - if(!(*iter)->isAnyVisible(camera_origin, squared_back_threshold) && (unstable || (*iter)->mLastCameraUpdated < sLastCameraUpdated)) + if(!(*iter)->isAnyVisible(camera_origin, back_threshold) && (unstable || (*iter)->mLastCameraUpdated < sLastCameraUpdated)) { killObject((*iter), delete_list); } -- cgit v1.2.3