SL-17691: Make objects active if there are too many material updates from the server
parent
254cef763d
commit
460d3ddcb2
|
|
@ -247,7 +247,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
|
|||
|
||||
mMediaImplList.resize(getNumTEs());
|
||||
mLastFetchedMediaVersion = -1;
|
||||
mServerVolumeUpdateCount = 0;
|
||||
mServerDrawableUpdateCount = 0;
|
||||
memset(&mIndexInTex, 0, sizeof(S32) * LLRender::NUM_VOLUME_TEXTURE_CHANNELS);
|
||||
mMDCImplCount = 0;
|
||||
mLastRiggingInfoLOD = -1;
|
||||
|
|
@ -409,6 +409,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
}
|
||||
|
||||
gPipeline.markTextured(mDrawable);
|
||||
onDrawableUpdateFromServer();
|
||||
mFaceMappingChanged = TRUE;
|
||||
mTexAnimMode = 0;
|
||||
}
|
||||
|
|
@ -448,7 +449,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
if (setVolume(volume_params, 0))
|
||||
{
|
||||
markForUpdate(TRUE);
|
||||
onVolumeUpdateFromServer();
|
||||
onDrawableUpdateFromServer();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -483,6 +484,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
}
|
||||
}
|
||||
// </FS:Beq>
|
||||
onDrawableUpdateFromServer();
|
||||
if (result & teDirtyBits)
|
||||
{
|
||||
updateTEData();
|
||||
|
|
@ -535,9 +537,10 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
if (setVolume(volume_params, 0))
|
||||
{
|
||||
markForUpdate(TRUE);
|
||||
onVolumeUpdateFromServer();
|
||||
onDrawableUpdateFromServer();
|
||||
}
|
||||
S32 res2 = unpackTEMessage(*dp);
|
||||
onDrawableUpdateFromServer();
|
||||
if (TEM_INVALID == res2)
|
||||
{
|
||||
// There's something bogus in the data that we're unpacking.
|
||||
|
|
@ -618,6 +621,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
}
|
||||
|
||||
gPipeline.markTextured(mDrawable);
|
||||
onDrawableUpdateFromServer();
|
||||
mFaceMappingChanged = TRUE;
|
||||
mTexAnimMode = 0;
|
||||
}
|
||||
|
|
@ -636,6 +640,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
LLDataPackerBinaryBuffer tdp(tdpbuffer, 1024);
|
||||
mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_TextureEntry, tdpbuffer, 0, block_num, 1024);
|
||||
S32 result = unpackTEMessage(tdp);
|
||||
onDrawableUpdateFromServer();
|
||||
if (result & teDirtyBits)
|
||||
{
|
||||
updateTEData();
|
||||
|
|
@ -674,11 +679,15 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
return retval;
|
||||
}
|
||||
|
||||
void LLVOVolume::onVolumeUpdateFromServer()
|
||||
// Called when a volume, material, etc is updated by the server, possibly by a
|
||||
// script. If this occurs too often for this object, mark it as active so that
|
||||
// it doesn't disrupt the octree/render batches, thereby potentially causing a
|
||||
// big performance penalty.
|
||||
void LLVOVolume::onDrawableUpdateFromServer()
|
||||
{
|
||||
constexpr U32 UPDATES_UNTIL_ACTIVE = 8;
|
||||
++mServerVolumeUpdateCount;
|
||||
if (mDrawable && !mDrawable->isActive() && mServerVolumeUpdateCount > UPDATES_UNTIL_ACTIVE)
|
||||
++mServerDrawableUpdateCount;
|
||||
if (mDrawable && !mDrawable->isActive() && mServerDrawableUpdateCount > UPDATES_UNTIL_ACTIVE)
|
||||
{
|
||||
mDrawable->makeActive();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,6 @@ public:
|
|||
const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const;
|
||||
|
||||
void markForUpdate(BOOL priority);
|
||||
void onVolumeUpdateFromServer();
|
||||
void markForUnload() { LLViewerObject::markForUnload(TRUE); mVolumeChanged = TRUE; }
|
||||
void faceMappingChanged() { mFaceMappingChanged=TRUE; };
|
||||
|
||||
|
|
@ -392,6 +391,7 @@ protected:
|
|||
static S32 mRenderComplexity_last;
|
||||
static S32 mRenderComplexity_current;
|
||||
|
||||
void onDrawableUpdateFromServer();
|
||||
void requestMediaDataUpdate(bool isNew);
|
||||
void cleanUpMediaImpls();
|
||||
void addMediaImpl(LLViewerMediaImpl* media_impl, S32 texture_index) ;
|
||||
|
|
@ -435,7 +435,7 @@ private:
|
|||
LLPointer<LLViewerFetchedTexture> mLightTexture;
|
||||
media_list_t mMediaImplList;
|
||||
S32 mLastFetchedMediaVersion; // as fetched from the server, starts as -1
|
||||
U64 mServerVolumeUpdateCount;
|
||||
U64 mServerDrawableUpdateCount;
|
||||
S32 mIndexInTex[LLRender::NUM_VOLUME_TEXTURE_CHANNELS];
|
||||
S32 mMDCImplCount;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue