From fe0f1be17bfd83323f2fcda124f3327cc14b0cad Mon Sep 17 00:00:00 2001 From: Beq Janus Date: Thu, 8 Aug 2024 17:10:03 +0100 Subject: Auto-scaling amortisation of dynamic BB calcs (#2226) * Auto-scaling amortisation of dynamic BB calcs This fix limits the overhead of the dynamic BB calcs to AvatarExtentRefreshMaxPerBatch per AvatarExtentRefreshPeriodBatch frames default is 5 avatar per 4 frames. Thus a standard busy region 25 avatars would take 20 frames to refresh the BBs. * Add comments to give context to the amortised BB recalcs explain the frequency of updates given the number of avatars present as to how that limits the impact on frame rate in busy scenes --- indra/newview/llviewerobjectlist.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llviewerobjectlist.cpp') diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index ae64ee7b92..435bd60917 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -889,6 +889,7 @@ void LLViewerObjectList::update(LLAgent &agent) static std::vector idle_list; U32 idle_count = 0; + mNumAvatars = 0; { for (std::vector >::iterator active_iter = mActiveObjects.begin(); @@ -906,6 +907,10 @@ void LLViewerObjectList::update(LLAgent &agent) idle_list[idle_count] = objectp; } ++idle_count; + if (objectp->isAvatar()) + { + mNumAvatars++; + } } else { // There shouldn't be any NULL pointers in the list, but they have caused -- cgit v1.2.3