diff options
author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-05-11 21:21:01 -0700 |
---|---|---|
committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-05-11 21:21:01 -0700 |
commit | ad4118f6ceaf1c22b22d58825924aad5575319f9 (patch) | |
tree | a1227572853491f2e89fb0db128230c40248b47d /indra/newview/llworld.cpp | |
parent | 339e02ef3311ad5c1197dfca2955a0c202b7c408 (diff) | |
parent | 06bdee663433bf5b12eddcbcfcb8785546354c28 (diff) |
Merge branch 'DRTVWR-559' into DRTVWR-583
Diffstat (limited to 'indra/newview/llworld.cpp')
-rw-r--r-- | indra/newview/llworld.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 9fa3d18a40..0e0dbdc071 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -33,6 +33,7 @@ #include "llstl.h" #include "llagent.h" +#include "llagentcamera.h" #include "llviewercontrol.h" #include "lldrawpool.h" #include "llglheaders.h" @@ -1423,6 +1424,36 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi } } +F32 LLWorld::getNearbyAvatarsAndMaxGPUTime(std::vector<LLCharacter*> &valid_nearby_avs) +{ + static LLCachedControl<F32> render_far_clip(gSavedSettings, "RenderFarClip", 64); + F32 nearby_max_complexity = 0; + F32 radius = render_far_clip * render_far_clip; + std::vector<LLCharacter*>::iterator char_iter = LLCharacter::sInstances.begin(); + while (char_iter != LLCharacter::sInstances.end()) + { + LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(*char_iter); + if (avatar && !avatar->isDead() && !avatar->isControlAvatar()) + { + if ((dist_vec_squared(avatar->getPositionGlobal(), gAgent.getPositionGlobal()) > radius) && + (dist_vec_squared(avatar->getPositionGlobal(), gAgentCamera.getCameraPositionGlobal()) > radius)) + { + char_iter++; + continue; + } + + if (!avatar->isTooSlow()) + { + gPipeline.profileAvatar(avatar); + } + nearby_max_complexity = llmax(nearby_max_complexity, avatar->getGPURenderTime()); + valid_nearby_avs.push_back(*char_iter); + } + char_iter++; + } + return nearby_max_complexity; +} + bool LLWorld::isRegionListed(const LLViewerRegion* region) const { region_list_t::const_iterator it = find(mRegionList.begin(), mRegionList.end(), region); |