diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 92b3ee4a267bdaf04950ba787c85fd6c6e7b4c8d..0b935ced31f37d5921560077f3f84fd86f1fd2bc 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1101,7 +1101,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() } //virtual -S32 LLDrawable::getMinVisFrameRange() const +S32 LLDrawable::getMinFrameRange() const { const S32 MIN_VIS_FRAME_RANGE = 2 ; //two frames:the current one and the last one. diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index e400a8b5f21eb53f154102518da68639433ff353..4d31356ede1c8d39391ed8869bc12a530b73b9e8 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -193,7 +193,7 @@ class LLDrawable LLSpatialPartition* getSpatialPartition(); - virtual S32 getMinVisFrameRange()const; + virtual S32 getMinFrameRange()const; void removeFromOctree(); void setSpatialBridge(LLSpatialBridge* bridge) { mSpatialBridge = (LLDrawable*) bridge; } diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index d9e1774c6daa4e9b30a403c880d25fe9e94af1ad..d631985e8207b53d3b94d415596be01c36d27f1d 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -409,7 +409,7 @@ bool LLViewerOctreeEntryData::isRecentlyVisible() const return true; } - return (sCurVisible - mEntry->mVisible < getMinVisFrameRange()); + return (sCurVisible - mEntry->mVisible < getMinFrameRange()); } void LLViewerOctreeEntryData::setVisible() const diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h index 1d3533e95cd1bb12c9c22c7b900a3c4f5d2abc7f..0a96676be100211a0bef722711a731bdb9ceee83 100644 --- a/indra/newview/llvieweroctree.h +++ b/indra/newview/llvieweroctree.h @@ -149,7 +149,7 @@ class LLViewerOctreeEntryData : public LLRefCount virtual void setOctreeEntry(LLViewerOctreeEntry* entry); - virtual S32 getMinVisFrameRange()const = 0; + virtual S32 getMinFrameRange()const = 0; F32 getBinRadius() const {return mEntry->getBinRadius();} const LLVector4a* getSpatialExtents() const; diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index fdb14aa8d2827b49f9e5d4e649ff675a4f2862c2..bcd9dda65291febef3be6b9569c3e2070134f76f 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -60,8 +60,7 @@ LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer & mDupeCount(0), mCRCChangeCount(0), mState(INACTIVE), - mRepeatedVisCounter(0), - mVisFrameRange(64), + mMinFrameRange(64), mSceneContrib(0.f), mTouched(TRUE), mParentID(0) @@ -81,8 +80,7 @@ LLVOCacheEntry::LLVOCacheEntry() mCRCChangeCount(0), mBuffer(NULL), mState(INACTIVE), - mRepeatedVisCounter(0), - mVisFrameRange(64), + mMinFrameRange(64), mSceneContrib(0.f), mTouched(TRUE), mParentID(0) @@ -95,8 +93,7 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) mBuffer(NULL), mUpdateFlags(-1), mState(INACTIVE), - mRepeatedVisCounter(0), - mVisFrameRange(64), + mMinFrameRange(64), mSceneContrib(0.f), mTouched(FALSE), mParentID(0) @@ -215,35 +212,26 @@ void LLVOCacheEntry::setState(U32 state) if(getState() == ACTIVE) { - const S32 MIN_REAVTIVE_INTERVAL = 20; + const S32 MIN_REAVTIVE_INTERVAL = 32; U32 last_visible = getVisible(); setVisible(); - if(getVisible() - last_visible < MIN_REAVTIVE_INTERVAL + mVisFrameRange) + if(getVisible() - last_visible < MIN_REAVTIVE_INTERVAL + mMinFrameRange) { - mRepeatedVisCounter++; + mMinFrameRange = llmin(mMinFrameRange * 2, 2048); } else { - mRepeatedVisCounter = 0; - mVisFrameRange = 64; - } - - if(mRepeatedVisCounter > 2) - { - //if repeatedly becomes visible immediately after invisible, enlarge the visible frame range - - mRepeatedVisCounter = 0; - mVisFrameRange *= 2; + mMinFrameRange = 64; //reset } } } //virtual -S32 LLVOCacheEntry::getMinVisFrameRange()const +S32 LLVOCacheEntry::getMinFrameRange()const { - return mVisFrameRange; + return mMinFrameRange; } void LLVOCacheEntry::addChild(LLVOCacheEntry* entry) diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 7409b94d60f1b29ed57311ecca4657560132ae90..8a4975c7867182fdff9f42c885e621b0ba38a88f 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -87,7 +87,7 @@ class LLVOCacheEntry : public LLViewerOctreeEntryData U32 getCRC() const { return mCRC; } S32 getHitCount() const { return mHitCount; } S32 getCRCChangeCount() const { return mCRCChangeCount; } - S32 getMinVisFrameRange()const; + S32 getMinFrameRange()const; void calcSceneContribution(const LLVector3& camera_origin, bool needs_update, U32 last_update); void setSceneContribution(F32 scene_contrib) {mSceneContrib = scene_contrib;} @@ -116,7 +116,7 @@ class LLVOCacheEntry : public LLViewerOctreeEntryData void setTouched(BOOL touched = TRUE) {mTouched = touched;} BOOL isTouched() const {return mTouched;} - + void setUpdateFlags(U32 flags) {mUpdateFlags = flags;} U32 getUpdateFlags() const {return mUpdateFlags;} @@ -137,8 +137,7 @@ class LLVOCacheEntry : public LLViewerOctreeEntryData U8 *mBuffer; F32 mSceneContrib; //projected scene contributuion of this object. - S32 mVisFrameRange; - S32 mRepeatedVisCounter; //number of repeatedly visible within a short time. + S32 mMinFrameRange; U32 mState; //high 16 bits reserved for special use. std::vector<LLVOCacheEntry*> mChildrenList; //children entries in a linked set.