diff options
| author | Graham Linden <graham@lindenlab.com> | 2019-02-07 16:00:21 -0800 | 
|---|---|---|
| committer | Graham Linden <graham@lindenlab.com> | 2019-02-07 16:00:21 -0800 | 
| commit | 90f9078d1f931774b5a6e866e26f4e0294f1e2d1 (patch) | |
| tree | cda33deb2d8c4c9c5458aae4c39a60a6de09ca9b | |
| parent | 43327798dec61590dc256697771e0423eb1ece9c (diff) | |
SL-10486, SL-10501, SL-10487
Make moon texture from default daycycle the default moon texture id and use it for the default and blank assets in the picker.
Fix handling of MM_TEXTURE to correctly detect when texture units outside the range 0-3
are used with texture matrix ops to prevent mem overwrite bug and/or asserts.
| -rw-r--r-- | indra/llinventory/llsettingssky.cpp | 11 | ||||
| -rw-r--r-- | indra/llinventory/llsettingssky.h | 3 | ||||
| -rw-r--r-- | indra/llrender/llrender.cpp | 7 | ||||
| -rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 7 | ||||
| -rw-r--r-- | indra/newview/llweb.cpp | 11 | 
5 files changed, 17 insertions, 22 deletions
| diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 612c97168c..48352d685b 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -140,7 +140,7 @@ const std::string LLSettingsSky::SETTING_SKY_ICE_LEVEL("ice_level");  const LLUUID LLSettingsSky::DEFAULT_ASSET_ID("eb3a7080-831f-9f37-10f0-7b1f9ea4043c");  static const LLUUID DEFAULT_SUN_ID("32bfbcea-24b1-fb9d-1ef9-48a28a63730f"); // dataserver -static const LLUUID DEFAULT_MOON_ID("db13b827-7e6a-7ace-bed4-4419ee00984d"); // dataserver +static const LLUUID DEFAULT_MOON_ID("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver  static const LLUUID DEFAULT_CLOUD_ID("1dc1368f-e8fe-f02d-a08d-9d9f11c1af6b");  const std::string LLSettingsSky::SETTING_LEGACY_HAZE("legacy_haze"); @@ -1238,12 +1238,6 @@ LLVector3 LLSettingsSky::getMoonDirection() const      return mMoonDirection;  } -LLColor4U LLSettingsSky::getFadeColor() const -{ -    update(); -    return mFadeColor; -} -  LLColor4 LLSettingsSky::getMoonAmbient() const  {      update(); @@ -1308,9 +1302,6 @@ void LLSettingsSky::calculateLightSettings() const      mMoonDiffuse  = gammaCorrect(componentMult(LLColor3::white, light_transmittance));      mMoonAmbient  = gammaCorrect(componentMult(LLColor3::white, light_transmittance) * 0.5f);      mTotalAmbient = mSunAmbient; - -    mFadeColor = mTotalAmbient + (mSunDiffuse + mMoonDiffuse) * 0.5f; -    mFadeColor.setAlpha(0);  }  LLUUID LLSettingsSky::GetDefaultAssetId() diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 65c0f2c581..cd173a6b18 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -280,7 +280,7 @@ public:      LLVector3 getSunDirection() const;      LLVector3 getMoonDirection() const; -    LLColor4U getFadeColor() const; +      LLColor4  getMoonAmbient() const;      LLColor3  getMoonDiffuse() const;      LLColor4  getSunAmbient() const; @@ -347,7 +347,6 @@ private:      static const F32 DOME_RADIUS;      static const F32 DOME_OFFSET; -    mutable LLColor4U   mFadeColor;      mutable LLColor4    mMoonAmbient;      mutable LLColor3    mMoonDiffuse;      mutable LLColor4    mSunAmbient; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 173444f708..de04ea601a 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1477,6 +1477,13 @@ void LLRender::matrixMode(U32 mode)  {  	if (mode == MM_TEXTURE)  	{ +        U32 tex_index = gGL.getCurrentTexUnitIndex(); +        // the shaders don't actually reference anything beyond texture_matrix0/1 +        if (tex_index > 3) +        { +            LL_WARNS_ONCE("render") << "Cannot use texture matrix with texture unit " << tex_index << " forcing texture matrix 3!" << LL_ENDL; +            tex_index = 3; +        }  		mode = MM_TEXTURE0 + gGL.getCurrentTexUnitIndex();  	} diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index eaf5b7dd68..9fa76c0d97 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1999,13 +1999,14 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)  			if (face->mTextureMatrix && vobj->mTexAnimMode)  			{ +                // we don't support tex matrix ops on anything but texture_matrix0 and texture_matrix1 +                // if you hit this assert, you most likely need to fix your content +                llassert(gGL.getCurrentTexUnitIndex() <= 1); +  				gGL.matrixMode(LLRender::MM_TEXTURE);  				gGL.loadMatrix((F32*) face->mTextureMatrix->mMatrix); -  				buff->setBuffer(data_mask);  				buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); - -                gGL.matrixMode(LLRender::MM_TEXTURE);  				gGL.loadIdentity();  			} diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 768db047a4..2760ebd1df 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -268,12 +268,9 @@ bool LLWeb::useExternalBrowser(const std::string &url)  		boost::match_results<std::string::const_iterator> matches;  		return !(boost::regex_search(uri_string, matches, pattern));  	} -	else -	{ -		boost::regex pattern = boost::regex("^mailto:", boost::regex::perl | boost::regex::icase); -		boost::match_results<std::string::const_iterator> matches; -		return boost::regex_search(url, matches, pattern); -	} -	return false; + +	boost::regex pattern = boost::regex("^mailto:", boost::regex::perl | boost::regex::icase); +	boost::match_results<std::string::const_iterator> matches; +	return boost::regex_search(url, matches, pattern);  #endif  } | 
