diff options
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r-- | indra/newview/llviewertexture.cpp | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 1863992a22..2e1dc95483 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -422,10 +422,18 @@ static LLFastTimer::DeclareTimer FTM_TEXTURE_MEMORY_CHECK("Memory Check"); //static bool LLViewerTexture::isMemoryForTextureLow() { + const F32 WAIT_TIME = 1.0f ; //second LLFastTimer t(FTM_TEXTURE_MEMORY_CHECK); + static LLFrameTimer timer ; - const static S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB - const static S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB + if(timer.getElapsedTimeF32() < WAIT_TIME) //call this once per second. + { + return false; + } + timer.reset() ; + + const S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB + const S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB bool low_mem = false ; if (gGLManager.mHasATIMemInfo) @@ -437,6 +445,15 @@ bool LLViewerTexture::isMemoryForTextureLow() { low_mem = true ; } + + if(!low_mem) //check main memory, only works for windows. + { + LLMemory::updateMemoryInfo() ; + if(LLMemory::getAvailableMemKB() / 1024 < MIN_FREE_MAIN_MEMORy) + { + low_mem = true ; + } + } } #if 0 //ignore nVidia cards else if (gGLManager.mHasNVXMemInfo) @@ -449,16 +466,7 @@ bool LLViewerTexture::isMemoryForTextureLow() low_mem = true ; } } -#endif - - if(!low_mem) //check main memory, only works for windows. - { - LLMemory::updateMemoryInfo() ; - if(LLMemory::getAvailableMemKB() / 1024 < MIN_FREE_MAIN_MEMORy) - { - low_mem = true ; - } - } +#endif return low_mem ; } @@ -2321,18 +2329,18 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s bool LLViewerFetchedTexture::doLoadedCallbacks() { - static const F32 MAX_INACTIVE_TIME = 120.f ; //seconds + static const F32 MAX_INACTIVE_TIME = 900.f ; //seconds - if(mPauseLoadedCallBacks) - { - destroyRawImage(); - return false; //paused - } if (mNeedsCreateTexture) { return false; } - if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME) + if(mPauseLoadedCallBacks) + { + destroyRawImage(); + return false; //paused + } + if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME && !mIsFetching) { clearCallbackEntryList() ; //remove all callbacks. return false ; @@ -2355,6 +2363,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() // Remove ourself from the global list of textures with callbacks gTextureList.mCallbackList.erase(this); + return false ; } S32 gl_discard = getDiscardLevel(); |