diff options
| author | Xiaohong Bao <bao@lindenlab.com> | 2011-12-05 16:28:39 -0700 | 
|---|---|---|
| committer | Xiaohong Bao <bao@lindenlab.com> | 2011-12-05 16:28:39 -0700 | 
| commit | 66c72be939012ddacdf0831f380e758569172b15 (patch) | |
| tree | 6f1da2c3a7212f608ac2dd6b18efefa38c6c0d88 | |
| parent | b4e106ec35920fdc7aa3c98d7de1778ed309c906 (diff) | |
| parent | 01d68a9f1572fba971ace6944a91a85e7c379d1e (diff) | |
Automated merge with https://bitbucket.org/VirLinden/viewer-development-shining-fixes
| -rw-r--r-- | indra/newview/llviewertexture.cpp | 33 | 
1 files changed, 21 insertions, 12 deletions
| diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index f4bbc2b067..addf1147f2 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -420,8 +420,17 @@ F32 texmem_middle_bound_scale = 0.925f;  //static   bool LLViewerTexture::isMemoryForTextureLow()  { -	const static S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB -	const static S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB +	const F32 WAIT_TIME = 1.0f ; //second +	static LLFrameTimer timer ; + +	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) @@ -433,6 +442,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) @@ -445,16 +463,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 ;  } | 
