summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2022-06-28 10:00:52 -0700
committerCosmic Linden <cosmic@lindenlab.com>2022-07-01 11:19:46 -0700
commita3312328bfd211998e32985e0c4b0ff242b8c8cf (patch)
tree1f1f3e72f04026ab8a3bbebc40e282badbff67f8 /indra/newview/llvovolume.cpp
parent8488d8600905a8f5f8e80513e39a67dce7a8cc84 (diff)
SL-17510: Fix frequently updating meshes (ex: sculpties) causing expensive octree updates by removing them from the static octree via makeActive
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index bae3d540e3..eee3bbc9cc 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -230,6 +230,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
mMediaImplList.resize(getNumTEs());
mLastFetchedMediaVersion = -1;
+ mServerVolumeUpdateCount = 0;
memset(&mIndexInTex, 0, sizeof(S32) * LLRender::NUM_VOLUME_TEXTURE_CHANNELS);
mMDCImplCount = 0;
mLastRiggingInfoLOD = -1;
@@ -400,6 +401,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
if (setVolume(volume_params, 0))
{
markForUpdate(TRUE);
+ onVolumeUpdateFromServer();
}
}
@@ -436,6 +438,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
if (setVolume(volume_params, 0))
{
markForUpdate(TRUE);
+ onVolumeUpdateFromServer();
}
S32 res2 = unpackTEMessage(*dp);
if (TEM_INVALID == res2)
@@ -551,6 +554,15 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
return retval;
}
+void LLVOVolume::onVolumeUpdateFromServer()
+{
+ constexpr U32 UPDATES_UNTIL_ACTIVE = 8;
+ ++mServerVolumeUpdateCount;
+ if (mDrawable && !mDrawable->isActive() && mServerVolumeUpdateCount > UPDATES_UNTIL_ACTIVE)
+ {
+ mDrawable->makeActive();
+ }
+}
void LLVOVolume::animateTextures()
{