Fix for objects becoming gray after turning away from them

Ansariel 2012-11-06 18:38:06 +01:00
parent e8f299eda3
commit ae4aa908ca
1 changed files with 10 additions and 0 deletions

View File

@ -1404,10 +1404,20 @@ void LLViewerFetchedTexture::dump()
// ONLY called from LLViewerFetchedTextureList
void LLViewerFetchedTexture::destroyTexture()
{
// <FS:Ansariel> This was commented out as part of MAINT-775 and is a REALLY bad idea!
// It will dump textures off memory once you turn away and you
// will end up with gray textures that need to be fetched again.
// Let's do this smarter and drop textures off memory soon before
// we reach the desired max texture memory!
//if(LLImageGL::sGlobalTextureMemoryInBytes < sMaxDesiredTextureMemInBytes)//not ready to release unused memory.
//{
// return ;
//}
if(LLImageGL::sGlobalTextureMemoryInBytes < sMaxDesiredTextureMemInBytes * 0.95f)//not ready to release unused memory.
{
return ;
}
// </FS:Ansariel>
if (mNeedsCreateTexture)//return if in the process of generating a new texture.
{
return ;