From 6eb96153e65f7a7126a1921baac23f56470f261e Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 10 Jul 2023 01:35:01 +0100 Subject: [PATCH] FIRE-32688 - Area Search Improvements Part 1: These changes prevent some of the aggressive culling that has prevented area search from working. They work best in combination with changes to the aggressive culling that better fit the viewer's memory footprint. These changes are committed separately to make it easier to change them --- indra/newview/fsareasearch.cpp | 2 ++ indra/newview/llviewerregion.cpp | 1 + indra/newview/llviewerregion.h | 1 + indra/newview/llvocache.cpp | 11 +++++++++-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/indra/newview/fsareasearch.cpp b/indra/newview/fsareasearch.cpp index b3e107eb5e..b81a20454f 100644 --- a/indra/newview/fsareasearch.cpp +++ b/indra/newview/fsareasearch.cpp @@ -173,6 +173,7 @@ FSAreaSearch::FSAreaSearch(const LLSD& key) : mRequestNeedsSent(false), mRlvBehaviorCallbackConnection() { + LLViewerRegion::sFSAreaSearchActive = true; mFactoryMap["area_search_list_panel"] = LLCallbackMap(createPanelList, this); mFactoryMap["area_search_find_panel"] = LLCallbackMap(createPanelFind, this); mFactoryMap["area_search_filter_panel"] = LLCallbackMap(createPanelFilter, this); @@ -188,6 +189,7 @@ FSAreaSearch::FSAreaSearch(const LLSD& key) : FSAreaSearch::~FSAreaSearch() { + LLViewerRegion::sFSAreaSearchActive = false; if (!gIdleCallbacks.deleteFunction(idle, this)) { LL_WARNS("FSAreaSearch") << "FSAreaSearch::~FSAreaSearch() failed to delete callback" << LL_ENDL; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index a719294007..a7915bf092 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -106,6 +106,7 @@ const S32 MAX_CAP_REQUEST_ATTEMPTS = 30; const U32 DEFAULT_MAX_REGION_WIDE_PRIM_COUNT = 15000; +BOOL LLViewerRegion::sFSAreaSearchActive = FALSE; BOOL LLViewerRegion::sVOCacheCullingEnabled = FALSE; S32 LLViewerRegion::sLastCameraUpdated = 0; S32 LLViewerRegion::sNewObjectCreationThrottle = -1; diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 312b792b4f..2e53d9bef9 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -478,6 +478,7 @@ public: std::vector mMapAvatars; std::vector mMapAvatarIDs; + static BOOL sFSAreaSearchActive; // FIRE-32688 Area Search improvements static BOOL sVOCacheCullingEnabled; //vo cache culling enabled or not. static S32 sLastCameraUpdated; diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 2a2bbd09a9..be7b2b1453 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -432,6 +432,7 @@ F32 LLVOCacheEntry::getSquaredPixelThreshold(bool is_front) bool LLVOCacheEntry::isAnyVisible(const LLVector4a& camera_origin, const LLVector4a& local_camera_origin, F32 dist_threshold) { + if( LLViewerRegion::sFSAreaSearchActive ) { return true; } // FIRE-32688 Area Search improvements LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)getGroup(); if(!group) { @@ -928,7 +929,10 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion) //process back objects selection selectBackObjects(camera, LLVOCacheEntry::getSquaredPixelThreshold(mFrontCull), - do_occlusion && use_object_cache_occlusion); + // FIRE-32688 Area Search improvements + // do_occlusion && use_object_cache_occlusion); + do_occlusion && use_object_cache_occlusion && !LLViewerRegion::sFSAreaSearchActive); + // return 0; //nothing changed, reduce frequency of culling } } @@ -942,7 +946,10 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion) camera.calcRegionFrustumPlanes(region_agent, gAgentCamera.mDrawDistance); mFrontCull = TRUE; - LLVOCacheOctreeCull culler(&camera, mRegionp, region_agent, do_occlusion && use_object_cache_occlusion, + // FIRE-32688 Area Search improvements + // LLVOCacheOctreeCull culler(&camera, mRegionp, region_agent, do_occlusion && use_object_cache_occlusion, + LLVOCacheOctreeCull culler(&camera, mRegionp, region_agent, do_occlusion && use_object_cache_occlusion && !LLViewerRegion::sFSAreaSearchActive, + // LLVOCacheEntry::getSquaredPixelThreshold(mFrontCull), this); culler.traverse(mOctree);