MAINT-6363 Normal and specular maps should not be downloaded if ALM is off

Tue, 06 Mar 2018 12:59:32 +0000

author
Andrey Kleshchev <andreykproductengine@lindenlab.com>
date
Tue, 06 Mar 2018 12:59:32 +0000
changeset 55327
8c5ee35b0901
parent 55326
8285df44a039
child 55328
1d9ad7f485e6

MAINT-6363 Normal and specular maps should not be downloaded if ALM is off

indra/llrender/llgltexture.h file | annotate | diff | revisions
indra/newview/lltextureview.cpp file | annotate | diff | revisions
indra/newview/llviewerobject.cpp file | annotate | diff | revisions
indra/newview/llviewertexture.cpp file | annotate | diff | revisions
indra/newview/llviewertexturelist.cpp file | annotate | diff | revisions
indra/newview/llvovolume.cpp file | annotate | diff | revisions
     1.1 --- a/indra/llrender/llgltexture.h	Tue Mar 06 11:32:28 2018 +0200
     1.2 +++ b/indra/llrender/llgltexture.h	Tue Mar 06 12:59:32 2018 +0000
     1.3 @@ -49,6 +49,7 @@
     1.4  	enum EBoostLevel
     1.5  	{
     1.6  		BOOST_NONE 			= 0,
     1.7 +		BOOST_ALM			, //acts like NONE when ALM is on, max discard when ALM is off
     1.8  		BOOST_AVATAR_BAKED	,
     1.9  		BOOST_AVATAR		,
    1.10  		BOOST_CLOUDS		,
     2.1 --- a/indra/newview/lltextureview.cpp	Tue Mar 06 11:32:28 2018 +0200
     2.2 +++ b/indra/newview/lltextureview.cpp	Tue Mar 06 12:59:32 2018 +0000
     2.3 @@ -173,9 +173,9 @@
     2.4  	{
     2.5  		color = LLColor4::green4;
     2.6  	}
     2.7 -	else if (mImagep->getBoostLevel() > LLGLTexture::BOOST_NONE)
     2.8 +	else if (mImagep->getBoostLevel() > LLGLTexture::BOOST_ALM)
     2.9  	{
    2.10 -		color = LLColor4::magenta;
    2.11 +		color = LLColor4::magenta; // except none and alm
    2.12  	}
    2.13  	else if (mImagep->getDecodePriority() <= 0.0f)
    2.14  	{
     3.1 --- a/indra/newview/llviewerobject.cpp	Tue Mar 06 11:32:28 2018 +0200
     3.2 +++ b/indra/newview/llviewerobject.cpp	Tue Mar 06 12:59:32 2018 +0000
     3.3 @@ -4376,10 +4376,10 @@
     3.4  	if (getTE(te)->getMaterialParams().notNull())
     3.5  	{
     3.6  		const LLUUID& norm_id = getTE(te)->getMaterialParams()->getNormalID();
     3.7 -		mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(norm_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
     3.8 +		mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(norm_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE);
     3.9  		
    3.10  		const LLUUID& spec_id = getTE(te)->getMaterialParams()->getSpecularID();
    3.11 -		mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
    3.12 +		mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE);
    3.13  	}
    3.14  }
    3.15  
    3.16 @@ -4502,14 +4502,14 @@
    3.17  S32 LLViewerObject::setTENormalMap(const U8 te, const LLUUID& uuid)
    3.18  {
    3.19  	LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? NULL : LLViewerTextureManager::getFetchedTexture(
    3.20 -		uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost());
    3.21 +		uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost());
    3.22  	return setTENormalMapCore(te, image);
    3.23  }
    3.24  
    3.25  S32 LLViewerObject::setTESpecularMap(const U8 te, const LLUUID& uuid)
    3.26  {
    3.27  	LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? NULL : LLViewerTextureManager::getFetchedTexture(
    3.28 -		uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost());
    3.29 +		uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost());
    3.30  	return setTESpecularMapCore(te, image);
    3.31  }
    3.32  
     4.1 --- a/indra/newview/llviewertexture.cpp	Tue Mar 06 11:32:28 2018 +0200
     4.2 +++ b/indra/newview/llviewertexture.cpp	Tue Mar 06 12:59:32 2018 +0000
     4.3 @@ -718,6 +718,7 @@
     4.4  	{
     4.5  		mBoostLevel = level;
     4.6  		if(mBoostLevel != LLViewerTexture::BOOST_NONE && 
     4.7 +			mBoostLevel != LLViewerTexture::BOOST_ALM && 
     4.8  			mBoostLevel != LLViewerTexture::BOOST_SELECTED && 
     4.9  			mBoostLevel != LLViewerTexture::BOOST_ICON)
    4.10  		{
    4.11 @@ -1557,6 +1558,10 @@
    4.12  		{
    4.13  			mDesiredDiscardLevel = 0;
    4.14  		}
    4.15 +		else if (!LLPipeline::sRenderDeferred && mBoostLevel == LLGLTexture::BOOST_ALM)
    4.16 +		{
    4.17 +			mDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
    4.18 +		}
    4.19          else if (mDontDiscard && mBoostLevel == LLGLTexture::BOOST_ICON)
    4.20          {
    4.21              if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
    4.22 @@ -1824,8 +1829,9 @@
    4.23  			{
    4.24  				if(drawable->isRecentlyVisible())
    4.25  				{
    4.26 -					if (getBoostLevel() == LLViewerTexture::BOOST_NONE && 
    4.27 -						drawable->getVObj() && drawable->getVObj()->isSelected())
    4.28 +					if ((getBoostLevel() == LLViewerTexture::BOOST_NONE || getBoostLevel() == LLViewerTexture::BOOST_ALM)
    4.29 +						&& drawable->getVObj()
    4.30 +						&& drawable->getVObj()->isSelected())
    4.31  					{
    4.32  						setBoostLevel(LLViewerTexture::BOOST_SELECTED);
    4.33  					}
    4.34 @@ -1842,6 +1848,7 @@
    4.35  	if (getBoostLevel() ==  LLViewerTexture::BOOST_SELECTED && 
    4.36  		gFrameTimeSeconds - mSelectedTime > SELECTION_RESET_TIME)
    4.37  	{
    4.38 +		// Could have been BOOST_ALM, but if user was working with this texture, better keep it as NONE
    4.39  		setBoostLevel(LLViewerTexture::BOOST_NONE);
    4.40  	}
    4.41  
    4.42 @@ -2115,7 +2122,7 @@
    4.43  		// Load the texture progressively: we try not to rush to the desired discard too fast.
    4.44  		// If the camera is not moving, we do not tweak the discard level notch by notch but go to the desired discard with larger boosted steps
    4.45  		// This mitigates the "textures stay blurry" problem when loading while not killing the texture memory while moving around
    4.46 -		S32 delta_level = (mBoostLevel > LLGLTexture::BOOST_NONE) ? 2 : 1; 
    4.47 +		S32 delta_level = (mBoostLevel > LLGLTexture::BOOST_ALM) ? 2 : 1; 
    4.48  		if (current_discard < 0)
    4.49  		{
    4.50  			desired_discard = llmax(desired_discard, getMaxDiscardLevel() - delta_level);
    4.51 @@ -3127,6 +3134,10 @@
    4.52  		if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
    4.53  			mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
    4.54  	}
    4.55 +	else if (!LLPipeline::sRenderDeferred && mBoostLevel == LLGLTexture::BOOST_ALM)
    4.56 +	{
    4.57 +		mDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
    4.58 +	}
    4.59  	else if (mBoostLevel < LLGLTexture::BOOST_HIGH && mMaxVirtualSize <= 10.f)
    4.60  	{
    4.61  		// If the image has not been significantly visible in a while, we don't want it
     5.1 --- a/indra/newview/llviewertexturelist.cpp	Tue Mar 06 11:32:28 2018 +0200
     5.2 +++ b/indra/newview/llviewertexturelist.cpp	Tue Mar 06 12:59:32 2018 +0000
     5.3 @@ -509,6 +509,12 @@
     5.4  	LLPointer<LLViewerFetchedTexture> imagep = findImage(image_id, get_element_type(boost_priority));
     5.5  	if (!imagep.isNull())
     5.6  	{
     5.7 +		if (boost_priority != LLViewerTexture::BOOST_ALM && imagep->getBoostLevel() == LLViewerTexture::BOOST_ALM)
     5.8 +		{
     5.9 +			// Workaround: we need BOOST_ALM texture for something, 'rise' to NONE
    5.10 +			imagep->setDecodePriority(LLViewerTexture::BOOST_NONE);
    5.11 +		}
    5.12 +
    5.13  		LLViewerFetchedTexture *texture = imagep.get();
    5.14  		if (request_from_host.isOk() &&
    5.15  			!texture->getTargetHost().isOk())
     6.1 --- a/indra/newview/llvovolume.cpp	Tue Mar 06 11:32:28 2018 +0200
     6.2 +++ b/indra/newview/llvovolume.cpp	Tue Mar 06 12:59:32 2018 +0000
     6.3 @@ -830,7 +830,7 @@
     6.4  	{
     6.5  		LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
     6.6  		LLUUID id = params->getLightTexture();
     6.7 -		mLightTexture = LLViewerTextureManager::getFetchedTexture(id);
     6.8 +		mLightTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM);
     6.9  		if (mLightTexture.notNull())
    6.10  		{
    6.11  			F32 rad = getLightRadius();
    6.12 @@ -3088,7 +3088,7 @@
    6.13  	{
    6.14  		if (mLightTexture.isNull() || id != mLightTexture->getID())
    6.15  		{
    6.16 -			mLightTexture = LLViewerTextureManager::getFetchedTexture(id);
    6.17 +			mLightTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM);
    6.18  		}
    6.19  	}
    6.20  	else

mercurial