SL-17510: Fix frequently updating meshes (ex: sculpties) causing expensive octree updates by removing them from the static octree via makeActive
parent
f4f7a0a773
commit
97c54c9715
|
|
@ -247,6 +247,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;
|
||||
|
|
@ -447,6 +448,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
if (setVolume(volume_params, 0))
|
||||
{
|
||||
markForUpdate(TRUE);
|
||||
onVolumeUpdateFromServer();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -533,6 +535,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
if (setVolume(volume_params, 0))
|
||||
{
|
||||
markForUpdate(TRUE);
|
||||
onVolumeUpdateFromServer();
|
||||
}
|
||||
S32 res2 = unpackTEMessage(*dp);
|
||||
if (TEM_INVALID == res2)
|
||||
|
|
@ -671,6 +674,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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ public:
|
|||
const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const;
|
||||
|
||||
void markForUpdate(BOOL priority);
|
||||
void onVolumeUpdateFromServer();
|
||||
void markForUnload() { LLViewerObject::markForUnload(TRUE); mVolumeChanged = TRUE; }
|
||||
void faceMappingChanged() { mFaceMappingChanged=TRUE; };
|
||||
|
||||
|
|
@ -434,6 +435,7 @@ private:
|
|||
LLPointer<LLViewerFetchedTexture> mLightTexture;
|
||||
media_list_t mMediaImplList;
|
||||
S32 mLastFetchedMediaVersion; // as fetched from the server, starts as -1
|
||||
U64 mServerVolumeUpdateCount;
|
||||
S32 mIndexInTex[LLRender::NUM_VOLUME_TEXTURE_CHANNELS];
|
||||
S32 mMDCImplCount;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue