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.
meow-7.2.2
Graham Linden 2019-02-07 16:00:21 -08:00
parent 43327798de
commit 90f9078d1f
5 changed files with 17 additions and 22 deletions

View File

@ -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()

View File

@ -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;

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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
}