diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2010-12-03 22:16:16 -0700 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2010-12-03 22:16:16 -0700 |
commit | f4ff1430f0d6ae7dd5a6be0bd665678b30a63aca (patch) | |
tree | 868824676d294f2b47dd33a4cfdc21b6459f977c /indra/newview/llviewertexture.cpp | |
parent | 219cd6ecda60e1c48852f582f0994573fd0e10ae (diff) |
first iteration of memory pool code
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r-- | indra/newview/llviewertexture.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index f96b93da4d..260023a802 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -3068,9 +3068,16 @@ void LLViewerLODTexture::processTextureStats() { mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel) ; } + else if(LLPipeline::sMemAllocationThrottled)//release memory of large textures by decrease their resolutions. + { + if(scaleDown()) + { + mDesiredDiscardLevel = mCachedRawDiscardLevel ; + } + } } -void LLViewerLODTexture::scaleDown() +bool LLViewerLODTexture::scaleDown() { if(hasGLTexture() && mCachedRawDiscardLevel > getDiscardLevel()) { @@ -3080,7 +3087,10 @@ void LLViewerLODTexture::scaleDown() { LLViewerTextureManager::sTesterp->setStablizingTime() ; } + + return true ; } + return false ; } //---------------------------------------------------------------------------------------------- //end of LLViewerLODTexture |