summaryrefslogtreecommitdiff
path: root/indra/newview/llvocache.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-06-17 15:24:15 -0600
committerXiaohong Bao <bao@lindenlab.com>2013-06-17 15:24:15 -0600
commit9ed2f4d3cb02d5161bd8bb77cb7befa7feedf2d9 (patch)
treecf8d2c90a4f8a17f27b565ea3d0087c78302b9af /indra/newview/llvocache.cpp
parent1bc1d532cff1539bb5366f87b602970f1d2a8929 (diff)
add a debug setting "InvisibleObjectsInMemoryTime" to adjust the time invisible objects stay in memory.
Diffstat (limited to 'indra/newview/llvocache.cpp')
-rwxr-xr-xindra/newview/llvocache.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 68f21ed2b3..93daf2e171 100755
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -50,6 +50,14 @@ BOOL check_write(LLAPRFile* apr_file, void* src, S32 n_bytes)
//---------------------------------------------------------------------------
// LLVOCacheEntry
//---------------------------------------------------------------------------
+//return number of frames invisible objects should stay in memory
+//static
+U32 LLVOCacheEntry::getInvisibleObjectsLiveTime()
+{
+ static LLCachedControl<U32> inv_obj_time(gSavedSettings,"InvisibleObjectsInMemoryTime");
+
+ return inv_obj_time - 1; //make 0 to be the maximum
+}
LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &dp)
: LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY),
@@ -60,7 +68,6 @@ LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &
mDupeCount(0),
mCRCChangeCount(0),
mState(INACTIVE),
- mMinFrameRange(64),
mSceneContrib(0.f),
mTouched(TRUE),
mParentID(0)
@@ -68,6 +75,7 @@ LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &
mBuffer = new U8[dp.getBufferSize()];
mDP.assignBuffer(mBuffer, dp.getBufferSize());
mDP = dp;
+ mMinFrameRange = getInvisibleObjectsLiveTime();
}
LLVOCacheEntry::LLVOCacheEntry()
@@ -80,12 +88,12 @@ LLVOCacheEntry::LLVOCacheEntry()
mCRCChangeCount(0),
mBuffer(NULL),
mState(INACTIVE),
- mMinFrameRange(64),
mSceneContrib(0.f),
mTouched(TRUE),
mParentID(0)
{
mDP.assignBuffer(mBuffer, 0);
+ mMinFrameRange = getInvisibleObjectsLiveTime();
}
LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
@@ -93,7 +101,6 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
mBuffer(NULL),
mUpdateFlags(-1),
mState(INACTIVE),
- mMinFrameRange(64),
mSceneContrib(0.f),
mTouched(FALSE),
mParentID(0)
@@ -101,6 +108,7 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
S32 size = -1;
BOOL success;
+ mMinFrameRange = getInvisibleObjectsLiveTime();
mDP.assignBuffer(mBuffer, 0);
success = check_read(apr_file, &mLocalID, sizeof(U32));
@@ -218,17 +226,17 @@ void LLVOCacheEntry::setState(U32 state)
if(getVisible() - last_visible < MIN_REAVTIVE_INTERVAL + mMinFrameRange)
{
- mMinFrameRange = llmin(mMinFrameRange * 2, 2048);
+ mMinFrameRange = llmin(mMinFrameRange * 2, getInvisibleObjectsLiveTime() * 32);
}
else
{
- mMinFrameRange = 64; //reset
+ mMinFrameRange = getInvisibleObjectsLiveTime(); //reset
}
}
}
//virtual
-S32 LLVOCacheEntry::getMinFrameRange()const
+U32 LLVOCacheEntry::getMinFrameRange()const
{
return mMinFrameRange;
}