diff options
author | Ruslan Teliuk <ruslantproductengine@lindenlab.com> | 2018-07-02 15:10:54 +0300 |
---|---|---|
committer | Ruslan Teliuk <ruslantproductengine@lindenlab.com> | 2018-07-02 15:10:54 +0300 |
commit | 27b5ee16f29e2fd3377b343362443075638e059a (patch) | |
tree | 6f4d1d3dc6c8146f44dafcb03656c45adfc32adf | |
parent | 3991a0f765d3d493bcc08ac2aadc707934f4d640 (diff) | |
parent | 3008962f0c990f4bfd270bee38152d2531ddfcd2 (diff) |
Merged lindenlab/viewer-cougar into default
-rw-r--r-- | indra/llmath/llvolume.cpp | 7 | ||||
-rw-r--r-- | indra/llprimitive/llmaterial.cpp | 457 | ||||
-rw-r--r-- | indra/llprimitive/llmaterial.h | 213 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 3 | ||||
-rw-r--r-- | indra/newview/lllogininstance.cpp | 5 | ||||
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 72 | ||||
-rw-r--r-- | indra/newview/lltexturefetch.h | 9 | ||||
-rw-r--r-- | indra/newview/lltextureview.cpp | 42 | ||||
-rw-r--r-- | indra/newview/llviewernetwork.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 8 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_tools_texture.xml | 25 |
11 files changed, 594 insertions, 266 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 6b6cd65ce2..a34999b6fd 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2192,6 +2192,13 @@ BOOL LLVolume::generate() LLVector4a* end_profile = profile+sizeT; LLVector4a offset = mPathp->mPath[s].mPos; + // hack to work around MAINT-5660 for debug until we can suss out + // what is wrong with the path generated that inserts NaNs... + if (!offset.isFinite3()) + { + offset.clear(); + } + LLVector4a tmp; // Run along the profile. diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 57ceb3e11b..c0fefaae73 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -65,23 +65,23 @@ const F32 MATERIALS_MULTIPLIER = 10000.f; template<typename T> T getMaterialField(const LLSD& data, const std::string& field, const LLSD::Type field_type) { - if ( (data.has(field)) && (field_type == data[field].type()) ) - { - return (T)data[field]; - } - LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL; - return (T)LLSD(); + if ( (data.has(field)) && (field_type == data[field].type()) ) + { + return (T)data[field]; + } + LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL; + return (T)LLSD(); } // GCC didn't like the generic form above for some reason template<> LLUUID getMaterialField(const LLSD& data, const std::string& field, const LLSD::Type field_type) { - if ( (data.has(field)) && (field_type == data[field].type()) ) - { - return data[field].asUUID(); - } - LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL; - return LLUUID::null; + if ( (data.has(field)) && (field_type == data[field].type()) ) + { + return data[field].asUUID(); + } + LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL; + return LLUUID::null; } /** @@ -91,137 +91,378 @@ template<> LLUUID getMaterialField(const LLSD& data, const std::string& field, c const LLMaterial LLMaterial::null; LLMaterial::LLMaterial() - : mNormalOffsetX(0.0f) - , mNormalOffsetY(0.0f) - , mNormalRepeatX(1.0f) - , mNormalRepeatY(1.0f) - , mNormalRotation(0.0f) - , mSpecularOffsetX(0.0f) - , mSpecularOffsetY(0.0f) - , mSpecularRepeatX(1.0f) - , mSpecularRepeatY(1.0f) - , mSpecularRotation(0.0f) - , mSpecularLightColor(LLMaterial::DEFAULT_SPECULAR_LIGHT_COLOR) - , mSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT) - , mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY) - , mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) - , mAlphaMaskCutoff(0) + : mNormalOffsetX(0.0f) + , mNormalOffsetY(0.0f) + , mNormalRepeatX(1.0f) + , mNormalRepeatY(1.0f) + , mNormalRotation(0.0f) + , mSpecularOffsetX(0.0f) + , mSpecularOffsetY(0.0f) + , mSpecularRepeatX(1.0f) + , mSpecularRepeatY(1.0f) + , mSpecularRotation(0.0f) + , mSpecularLightColor(LLMaterial::DEFAULT_SPECULAR_LIGHT_COLOR) + , mSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT) + , mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY) + , mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) + , mAlphaMaskCutoff(0) { } LLMaterial::LLMaterial(const LLSD& material_data) { - fromLLSD(material_data); + fromLLSD(material_data); } -LLSD LLMaterial::asLLSD() const +const LLUUID& LLMaterial::getNormalID() const +{ + return mNormalID; +} + +void LLMaterial::setNormalID(const LLUUID& normal_id) +{ + mNormalID = normal_id; +} + +void LLMaterial::getNormalOffset(F32& offset_x, F32& offset_y) const +{ + offset_x = mNormalOffsetX; + offset_y = mNormalOffsetY; +} + +F32 LLMaterial::getNormalOffsetX() const +{ + return mNormalOffsetX; +} + +F32 LLMaterial::getNormalOffsetY() const +{ + return mNormalOffsetY; +} + +void LLMaterial::setNormalOffset(F32 offset_x, F32 offset_y) +{ + mNormalOffsetX = offset_x; + mNormalOffsetY = offset_y; +} + +void LLMaterial::setNormalOffsetX(F32 offset_x) +{ + mNormalOffsetX = offset_x; +} + +void LLMaterial::setNormalOffsetY(F32 offset_y) +{ + mNormalOffsetY = offset_y; +} + +void LLMaterial::getNormalRepeat(F32& repeat_x, F32& repeat_y) const +{ + repeat_x = mNormalRepeatX; + repeat_y = mNormalRepeatY; +} + +F32 LLMaterial::getNormalRepeatX() const +{ + return mNormalRepeatX; +} + +F32 LLMaterial::getNormalRepeatY() const +{ + return mNormalRepeatY; +} + +void LLMaterial::setNormalRepeat(F32 repeat_x, F32 repeat_y) +{ + mNormalRepeatX = repeat_x; + mNormalRepeatY = repeat_y; +} + +void LLMaterial::setNormalRepeatX(F32 repeat_x) +{ + mNormalRepeatX = repeat_x; +} + +void LLMaterial::setNormalRepeatY(F32 repeat_y) +{ + mNormalRepeatY = repeat_y; +} + +F32 LLMaterial::getNormalRotation() const +{ + return mNormalRotation; +} + +void LLMaterial::setNormalRotation(F32 rot) +{ + mNormalRotation = rot; +} + +const LLUUID& LLMaterial::getSpecularID() const +{ + return mSpecularID; +} + +void LLMaterial::setSpecularID(const LLUUID& specular_id) +{ + mSpecularID = specular_id; +} + +void LLMaterial::getSpecularOffset(F32& offset_x, F32& offset_y) const +{ + offset_x = mSpecularOffsetX; + offset_y = mSpecularOffsetY; +} + +F32 LLMaterial::getSpecularOffsetX() const +{ + return mSpecularOffsetX; +} + +F32 LLMaterial::getSpecularOffsetY() const +{ + return mSpecularOffsetY; +} + +void LLMaterial::setSpecularOffset(F32 offset_x, F32 offset_y) +{ + mSpecularOffsetX = offset_x; + mSpecularOffsetY = offset_y; +} + +void LLMaterial::setSpecularOffsetX(F32 offset_x) { - LLSD material_data; + mSpecularOffsetX = offset_x; +} - material_data[MATERIALS_CAP_NORMAL_MAP_FIELD] = mNormalID; - material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = ll_round(mNormalOffsetX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = ll_round(mNormalOffsetY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = ll_round(mNormalRepeatX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = ll_round(mNormalRepeatY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = ll_round(mNormalRotation * MATERIALS_MULTIPLIER); +void LLMaterial::setSpecularOffsetY(F32 offset_y) +{ + mSpecularOffsetY = offset_y; +} - material_data[MATERIALS_CAP_SPECULAR_MAP_FIELD] = mSpecularID; - material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = ll_round(mSpecularOffsetX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = ll_round(mSpecularOffsetY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = ll_round(mSpecularRepeatX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = ll_round(mSpecularRepeatY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = ll_round(mSpecularRotation * MATERIALS_MULTIPLIER); +void LLMaterial::getSpecularRepeat(F32& repeat_x, F32& repeat_y) const +{ + repeat_x = mSpecularRepeatX; + repeat_y = mSpecularRepeatY; +} - material_data[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = mSpecularLightColor.getValue(); - material_data[MATERIALS_CAP_SPECULAR_EXP_FIELD] = mSpecularLightExponent; - material_data[MATERIALS_CAP_ENV_INTENSITY_FIELD] = mEnvironmentIntensity; - material_data[MATERIALS_CAP_DIFFUSE_ALPHA_MODE_FIELD] = mDiffuseAlphaMode; - material_data[MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD] = mAlphaMaskCutoff; +F32 LLMaterial::getSpecularRepeatX() const +{ + return mSpecularRepeatX; +} - return material_data; +F32 LLMaterial::getSpecularRepeatY() const +{ + return mSpecularRepeatY; +} + +void LLMaterial::setSpecularRepeat(F32 repeat_x, F32 repeat_y) +{ + mSpecularRepeatX = repeat_x; mSpecularRepeatY = repeat_y; +} + +void LLMaterial::setSpecularRepeatX(F32 repeat_x) +{ + mSpecularRepeatX = repeat_x; +} + +void LLMaterial::setSpecularRepeatY(F32 repeat_y) +{ + mSpecularRepeatY = repeat_y; +} + +F32 LLMaterial::getSpecularRotation() const +{ + return mSpecularRotation; +} + +void LLMaterial::setSpecularRotation(F32 rot) +{ + mSpecularRotation = rot; +} + +const LLColor4U LLMaterial::getSpecularLightColor() const +{ + return mSpecularLightColor; +} + +void LLMaterial::setSpecularLightColor(const LLColor4U& color) +{ + mSpecularLightColor = color; +} + +U8 LLMaterial::getSpecularLightExponent() const +{ + return mSpecularLightExponent; +} + +void LLMaterial::setSpecularLightExponent(U8 exponent) +{ + mSpecularLightExponent = exponent; +} + +U8 LLMaterial::getEnvironmentIntensity() const +{ + return mEnvironmentIntensity; +} + +void LLMaterial::setEnvironmentIntensity(U8 intensity) +{ + mEnvironmentIntensity = intensity; +} + +U8 LLMaterial::getDiffuseAlphaMode() const +{ + return mDiffuseAlphaMode; +} + +void LLMaterial::setDiffuseAlphaMode(U8 alpha_mode) +{ + mDiffuseAlphaMode = alpha_mode; +} + +U8 LLMaterial::getAlphaMaskCutoff() const +{ + return mAlphaMaskCutoff; +} + +void LLMaterial::setAlphaMaskCutoff(U8 cutoff) +{ + mAlphaMaskCutoff = cutoff; +} + +LLSD LLMaterial::asLLSD() const +{ + LLSD material_data; + + S32 normalOffsetXInt = ll_round(mNormalOffsetX * MATERIALS_MULTIPLIER); + S32 normalOffsetYInt = ll_round(mNormalOffsetY * MATERIALS_MULTIPLIER); + S32 normalRotInt = ll_round(mNormalRotation * MATERIALS_MULTIPLIER); + + material_data[MATERIALS_CAP_NORMAL_MAP_FIELD] = mNormalID; + material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = normalOffsetXInt; + material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = normalOffsetYInt; + material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = ll_round(mNormalRepeatX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = ll_round(mNormalRepeatY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = normalRotInt; + + material_data[MATERIALS_CAP_SPECULAR_MAP_FIELD] = mSpecularID; + + S32 specularOffsetXInt = ll_round(mSpecularOffsetX * MATERIALS_MULTIPLIER); + S32 specularOffsetYInt = ll_round(mSpecularOffsetY * MATERIALS_MULTIPLIER); + S32 specularRotInt = ll_round(mSpecularRotation * MATERIALS_MULTIPLIER); + + material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = specularOffsetXInt; + material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = specularOffsetYInt; + material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = ll_round(mSpecularRepeatX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = ll_round(mSpecularRepeatY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = specularRotInt; + + material_data[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = mSpecularLightColor.getValue(); + material_data[MATERIALS_CAP_SPECULAR_EXP_FIELD] = mSpecularLightExponent; + material_data[MATERIALS_CAP_ENV_INTENSITY_FIELD] = mEnvironmentIntensity; + material_data[MATERIALS_CAP_DIFFUSE_ALPHA_MODE_FIELD] = mDiffuseAlphaMode; + material_data[MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD] = mAlphaMaskCutoff; + + return material_data; } void LLMaterial::fromLLSD(const LLSD& material_data) { - mNormalID = getMaterialField<LLSD::UUID>(material_data, MATERIALS_CAP_NORMAL_MAP_FIELD, LLSD::TypeUUID); - mNormalOffsetX = (F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mNormalOffsetY = (F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mNormalRepeatX = (F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mNormalRepeatY = (F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mNormalRotation = (F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; + mNormalID = getMaterialField<LLSD::UUID>(material_data, MATERIALS_CAP_NORMAL_MAP_FIELD, LLSD::TypeUUID); + + S32 normalOffsetXInt = getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD, LLSD::TypeInteger); + S32 normalOffsetYInt = getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger); + S32 normalRotInt = getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD, LLSD::TypeInteger); + + mNormalOffsetX = F32(normalOffsetXInt) / MATERIALS_MULTIPLIER; + mNormalOffsetY = F32(normalOffsetYInt) / MATERIALS_MULTIPLIER; + mNormalRotation = F32(normalRotInt) / MATERIALS_MULTIPLIER; + + mNormalOffsetY = ((F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mNormalRepeatX = ((F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mNormalRepeatY = ((F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + + mSpecularID = getMaterialField<LLSD::UUID>(material_data, MATERIALS_CAP_SPECULAR_MAP_FIELD, LLSD::TypeUUID); + + S32 specularOffsetXInt = getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD, LLSD::TypeInteger); + S32 specularOffsetYInt = getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger); + S32 specularRotInt = getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger); + + mSpecularOffsetX = F32(specularOffsetXInt) / MATERIALS_MULTIPLIER; + mSpecularOffsetY = F32(specularOffsetYInt) / MATERIALS_MULTIPLIER; + mSpecularRotation = F32(specularRotInt) / MATERIALS_MULTIPLIER; - mSpecularID = getMaterialField<LLSD::UUID>(material_data, MATERIALS_CAP_SPECULAR_MAP_FIELD, LLSD::TypeUUID); - mSpecularOffsetX = (F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mSpecularOffsetY = (F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mSpecularRepeatX = (F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mSpecularRepeatY = (F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mSpecularRotation = (F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; + mSpecularOffsetY = ((F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularRepeatX = ((F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularRepeatY = ((F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularRotation = ((F32)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mSpecularLightColor.setValue(getMaterialField<LLSD>(material_data, MATERIALS_CAP_SPECULAR_COLOR_FIELD, LLSD::TypeArray)); - mSpecularLightExponent = (U8)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_EXP_FIELD, LLSD::TypeInteger); - mEnvironmentIntensity = (U8)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_ENV_INTENSITY_FIELD, LLSD::TypeInteger); - mDiffuseAlphaMode = (U8)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_DIFFUSE_ALPHA_MODE_FIELD, LLSD::TypeInteger); - mAlphaMaskCutoff = (U8)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD, LLSD::TypeInteger); + mSpecularLightColor.setValue(getMaterialField<LLSD>(material_data, MATERIALS_CAP_SPECULAR_COLOR_FIELD, LLSD::TypeArray)); + mSpecularLightExponent = (U8)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_SPECULAR_EXP_FIELD, LLSD::TypeInteger); + mEnvironmentIntensity = (U8)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_ENV_INTENSITY_FIELD, LLSD::TypeInteger); + mDiffuseAlphaMode = (U8)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_DIFFUSE_ALPHA_MODE_FIELD, LLSD::TypeInteger); + mAlphaMaskCutoff = (U8)getMaterialField<LLSD::Integer>(material_data, MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD, LLSD::TypeInteger); } bool LLMaterial::isNull() const { - return (*this == null); + return (*this == null); } bool LLMaterial::operator == (const LLMaterial& rhs) const { - return - (mNormalID == rhs.mNormalID) && (mNormalOffsetX == rhs.mNormalOffsetX) && (mNormalOffsetY == rhs.mNormalOffsetY) && - (mNormalRepeatX == rhs.mNormalRepeatX) && (mNormalRepeatY == rhs.mNormalRepeatY) && (mNormalRotation == rhs.mNormalRotation) && - (mSpecularID == rhs.mSpecularID) && (mSpecularOffsetX == rhs.mSpecularOffsetX) && (mSpecularOffsetY == rhs.mSpecularOffsetY) && - (mSpecularRepeatX == rhs.mSpecularRepeatX) && (mSpecularRepeatY == rhs.mSpecularRepeatY) && (mSpecularRotation == rhs.mSpecularRotation) && - (mSpecularLightColor == rhs.mSpecularLightColor) && (mSpecularLightExponent == rhs.mSpecularLightExponent) && - (mEnvironmentIntensity == rhs.mEnvironmentIntensity) && (mDiffuseAlphaMode == rhs.mDiffuseAlphaMode) && (mAlphaMaskCutoff == rhs.mAlphaMaskCutoff); + return + (mNormalID == rhs.mNormalID) && (mNormalOffsetX == rhs.mNormalOffsetX) && (mNormalOffsetY == rhs.mNormalOffsetY) && + (mNormalRepeatX == rhs.mNormalRepeatX) && (mNormalRepeatY == rhs.mNormalRepeatY) && (mNormalRotation == rhs.mNormalRotation) && + (mSpecularID == rhs.mSpecularID) && (mSpecularOffsetX == rhs.mSpecularOffsetX) && (mSpecularOffsetY == rhs.mSpecularOffsetY) && + (mSpecularRepeatX == rhs.mSpecularRepeatX) && (mSpecularRepeatY == rhs.mSpecularRepeatY) && (mSpecularRotation == rhs.mSpecularRotation) && + (mSpecularLightColor == rhs.mSpecularLightColor) && (mSpecularLightExponent == rhs.mSpecularLightExponent) && + (mEnvironmentIntensity == rhs.mEnvironmentIntensity) && (mDiffuseAlphaMode == rhs.mDiffuseAlphaMode) && (mAlphaMaskCutoff == rhs.mAlphaMaskCutoff); } bool LLMaterial::operator != (const LLMaterial& rhs) const { - return !(*this == rhs); + return !(*this == rhs); } U32 LLMaterial::getShaderMask(U32 alpha_mode) { //NEVER incorporate this value into the message system -- this function will vary depending on viewer implementation - U32 ret = 0; - - //two least significant bits are "diffuse alpha mode" - if (alpha_mode != DIFFUSE_ALPHA_MODE_DEFAULT) - { - ret = alpha_mode; - } - else - { - ret = getDiffuseAlphaMode(); - } - - llassert(ret < SHADER_COUNT); - - //next bit is whether or not specular map is present - const U32 SPEC_BIT = 0x4; - - if (getSpecularID().notNull()) - { - ret |= SPEC_BIT; - } - - llassert(ret < SHADER_COUNT); - - //next bit is whether or not normal map is present - const U32 NORM_BIT = 0x8; - if (getNormalID().notNull()) - { - ret |= NORM_BIT; - } - - llassert(ret < SHADER_COUNT); - - return ret; + U32 ret = 0; + + //two least significant bits are "diffuse alpha mode" + if (alpha_mode != DIFFUSE_ALPHA_MODE_DEFAULT) + { + ret = alpha_mode; + } + else + { + ret = getDiffuseAlphaMode(); + } + + llassert(ret < SHADER_COUNT); + + //next bit is whether or not specular map is present + const U32 SPEC_BIT = 0x4; + + if (getSpecularID().notNull()) + { + ret |= SPEC_BIT; + } + + llassert(ret < SHADER_COUNT); + + //next bit is whether or not normal map is present + const U32 NORM_BIT = 0x8; + if (getNormalID().notNull()) + { + ret |= NORM_BIT; + } + + llassert(ret < SHADER_COUNT); + + return ret; } diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index 9f52a3f6c1..d58b7ee812 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -39,114 +39,115 @@ class LLMaterial : public LLRefCount { public: - typedef enum - { - DIFFUSE_ALPHA_MODE_NONE = 0, - DIFFUSE_ALPHA_MODE_BLEND = 1, - DIFFUSE_ALPHA_MODE_MASK = 2, - DIFFUSE_ALPHA_MODE_EMISSIVE = 3, - DIFFUSE_ALPHA_MODE_DEFAULT = 4, - } eDiffuseAlphaMode; - - typedef enum - { - SHADER_COUNT = 16, - ALPHA_SHADER_COUNT = 4 - } eShaderCount; - - - - static const U8 DEFAULT_SPECULAR_LIGHT_EXPONENT = ((U8)(0.2f * 255)); - static const LLColor4U DEFAULT_SPECULAR_LIGHT_COLOR; - static const U8 DEFAULT_ENV_INTENSITY = 0; - - LLMaterial(); - LLMaterial(const LLSD& material_data); - - LLSD asLLSD() const; - void fromLLSD(const LLSD& material_data); - - const LLUUID& getNormalID() const { return mNormalID; } - void setNormalID(const LLUUID& normal_id) { mNormalID = normal_id; } - void getNormalOffset(F32& offset_x, F32& offset_y) const { offset_x = mNormalOffsetX; offset_y = mNormalOffsetY; } - F32 getNormalOffsetX() const { return mNormalOffsetX; } - F32 getNormalOffsetY() const { return mNormalOffsetY; } - - void setNormalOffset(F32 offset_x, F32 offset_y) { mNormalOffsetX = offset_x; mNormalOffsetY = offset_y; } - void setNormalOffsetX(F32 offset_x) { mNormalOffsetX = offset_x; } - void setNormalOffsetY(F32 offset_y) { mNormalOffsetY = offset_y; } - - void getNormalRepeat(F32& repeat_x, F32& repeat_y) const { repeat_x = mNormalRepeatX; repeat_y = mNormalRepeatY; } - F32 getNormalRepeatX() const { return mNormalRepeatX; } - F32 getNormalRepeatY() const { return mNormalRepeatY; } - - void setNormalRepeat(F32 repeat_x, F32 repeat_y) { mNormalRepeatX = repeat_x; mNormalRepeatY = repeat_y; } - void setNormalRepeatX(F32 repeat_x) { mNormalRepeatX = repeat_x; } - void setNormalRepeatY(F32 repeat_y) { mNormalRepeatY = repeat_y; } - - F32 getNormalRotation() const { return mNormalRotation; } - void setNormalRotation(F32 rot) { mNormalRotation = rot; } - - const LLUUID& getSpecularID() const { return mSpecularID; } - void setSpecularID(const LLUUID& specular_id) { mSpecularID = specular_id; } - void getSpecularOffset(F32& offset_x, F32& offset_y) const { offset_x = mSpecularOffsetX; offset_y = mSpecularOffsetY; } - F32 getSpecularOffsetX() const { return mSpecularOffsetX; } - F32 getSpecularOffsetY() const { return mSpecularOffsetY; } - - void setSpecularOffset(F32 offset_x, F32 offset_y) { mSpecularOffsetX = offset_x; mSpecularOffsetY = offset_y; } - void setSpecularOffsetX(F32 offset_x) { mSpecularOffsetX = offset_x; } - void setSpecularOffsetY(F32 offset_y) { mSpecularOffsetY = offset_y; } - - void getSpecularRepeat(F32& repeat_x, F32& repeat_y) const { repeat_x = mSpecularRepeatX; repeat_y = mSpecularRepeatY; } - F32 getSpecularRepeatX() const { return mSpecularRepeatX; } - F32 getSpecularRepeatY() const { return mSpecularRepeatY; } - - void setSpecularRepeat(F32 repeat_x, F32 repeat_y) { mSpecularRepeatX = repeat_x; mSpecularRepeatY = repeat_y; } - void setSpecularRepeatX(F32 repeat_x) { mSpecularRepeatX = repeat_x; } - void setSpecularRepeatY(F32 repeat_y) { mSpecularRepeatY = repeat_y; } - - F32 getSpecularRotation() const { return mSpecularRotation; } - void setSpecularRotation(F32 rot) { mSpecularRotation = rot; } - - const LLColor4U getSpecularLightColor() const { return mSpecularLightColor; } - void setSpecularLightColor(const LLColor4U& color) { mSpecularLightColor = color; } - U8 getSpecularLightExponent() const { return mSpecularLightExponent; } - void setSpecularLightExponent(U8 exponent) { mSpecularLightExponent = exponent; } - U8 getEnvironmentIntensity() const { return mEnvironmentIntensity; } - void setEnvironmentIntensity(U8 intensity) { mEnvironmentIntensity = intensity; } - U8 getDiffuseAlphaMode() const { return mDiffuseAlphaMode; } - void setDiffuseAlphaMode(U8 alpha_mode) { mDiffuseAlphaMode = alpha_mode; } - U8 getAlphaMaskCutoff() const { return mAlphaMaskCutoff; } - void setAlphaMaskCutoff(U8 cutoff) { mAlphaMaskCutoff = cutoff; } - - bool isNull() const; - static const LLMaterial null; - - bool operator == (const LLMaterial& rhs) const; - bool operator != (const LLMaterial& rhs) const; - - U32 getShaderMask(U32 alpha_mode = DIFFUSE_ALPHA_MODE_DEFAULT); + typedef enum + { + DIFFUSE_ALPHA_MODE_NONE = 0, + DIFFUSE_ALPHA_MODE_BLEND = 1, + DIFFUSE_ALPHA_MODE_MASK = 2, + DIFFUSE_ALPHA_MODE_EMISSIVE = 3, + DIFFUSE_ALPHA_MODE_DEFAULT = 4, + } eDiffuseAlphaMode; + + typedef enum + { + SHADER_COUNT = 16, + ALPHA_SHADER_COUNT = 4 + } eShaderCount; + + + + static const U8 DEFAULT_SPECULAR_LIGHT_EXPONENT = ((U8)(0.2f * 255)); + static const LLColor4U DEFAULT_SPECULAR_LIGHT_COLOR; + static const U8 DEFAULT_ENV_INTENSITY = 0; + + LLMaterial(); + LLMaterial(const LLSD& material_data); + + LLSD asLLSD() const; + void fromLLSD(const LLSD& material_data); + + const LLUUID& getNormalID() const; + void setNormalID(const LLUUID& normal_id); + + void getNormalOffset(F32& offset_x, F32& offset_y) const; + F32 getNormalOffsetX() const; + F32 getNormalOffsetY() const; + + void setNormalOffset(F32 offset_x, F32 offset_y); + void setNormalOffsetX(F32 offset_x); + void setNormalOffsetY(F32 offset_y); + + void getNormalRepeat(F32& repeat_x, F32& repeat_y) const; + F32 getNormalRepeatX() const; + F32 getNormalRepeatY() const; + + void setNormalRepeat(F32 repeat_x, F32 repeat_y); + void setNormalRepeatX(F32 repeat_x); + void setNormalRepeatY(F32 repeat_y); + + F32 getNormalRotation() const; + void setNormalRotation(F32 rot); + + const LLUUID& getSpecularID() const; + void setSpecularID(const LLUUID& specular_id); + void getSpecularOffset(F32& offset_x, F32& offset_y) const; + F32 getSpecularOffsetX() const; + F32 getSpecularOffsetY() const; + + void setSpecularOffset(F32 offset_x, F32 offset_y); + void setSpecularOffsetX(F32 offset_x); + void setSpecularOffsetY(F32 offset_y); + + void getSpecularRepeat(F32& repeat_x, F32& repeat_y) const; + F32 getSpecularRepeatX() const; + F32 getSpecularRepeatY() const; + + void setSpecularRepeat(F32 repeat_x, F32 repeat_y); + void setSpecularRepeatX(F32 repeat_x); + void setSpecularRepeatY(F32 repeat_y); + + F32 getSpecularRotation() const; + void setSpecularRotation(F32 rot); + + const LLColor4U getSpecularLightColor() const; + void setSpecularLightColor(const LLColor4U& color); + U8 getSpecularLightExponent() const; + void setSpecularLightExponent(U8 exponent); + U8 getEnvironmentIntensity() const; + void setEnvironmentIntensity(U8 intensity); + U8 getDiffuseAlphaMode() const; + void setDiffuseAlphaMode(U8 alpha_mode); + U8 getAlphaMaskCutoff() const; + void setAlphaMaskCutoff(U8 cutoff); + + bool isNull() const; + static const LLMaterial null; + + bool operator == (const LLMaterial& rhs) const; + bool operator != (const LLMaterial& rhs) const; + + U32 getShaderMask(U32 alpha_mode = DIFFUSE_ALPHA_MODE_DEFAULT); protected: - LLUUID mNormalID; - F32 mNormalOffsetX; - F32 mNormalOffsetY; - F32 mNormalRepeatX; - F32 mNormalRepeatY; - F32 mNormalRotation; - - LLUUID mSpecularID; - F32 mSpecularOffsetX; - F32 mSpecularOffsetY; - F32 mSpecularRepeatX; - F32 mSpecularRepeatY; - F32 mSpecularRotation; - - LLColor4U mSpecularLightColor; - U8 mSpecularLightExponent; - U8 mEnvironmentIntensity; - U8 mDiffuseAlphaMode; - U8 mAlphaMaskCutoff; + LLUUID mNormalID; + F32 mNormalOffsetX; + F32 mNormalOffsetY; + F32 mNormalRepeatX; + F32 mNormalRepeatY; + F32 mNormalRotation; + + LLUUID mSpecularID; + F32 mSpecularOffsetX; + F32 mSpecularOffsetY; + F32 mSpecularRepeatX; + F32 mSpecularRepeatY; + F32 mSpecularRotation; + + LLColor4U mSpecularLightColor; + U8 mSpecularLightExponent; + U8 mEnvironmentIntensity; + U8 mDiffuseAlphaMode; + U8 mAlphaMaskCutoff; }; typedef LLPointer<LLMaterial> LLMaterialPtr; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f705084bdb..261a78b2dc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1082,6 +1082,8 @@ bool LLAppViewer::init() } } +// do not pester devs who need to run the executable directly to debug +#if LL_RELEASE_FOR_DOWNLOAD // MAINT-8305: If we're processing a SLURL, skip the launcher check. if (gSavedSettings.getString("CmdLineLoginLocation").empty()) { @@ -1098,6 +1100,7 @@ bool LLAppViewer::init() LLNotificationsUtil::add("RunLauncher"); } } +#endif #if LL_WINDOWS if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion()) diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index bc93fa2c20..deef3dbce7 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -113,6 +113,11 @@ void LLLoginInstance::connect(LLPointer<LLCredential> credentials) { std::vector<std::string> uris; LLGridManager::getInstance()->getLoginURIs(uris); + if (uris.size() < 1) + { + LL_WARNS() << "Failed to get login URIs during connect. No connect for you!" << LL_ENDL; + return; + } connect(uris.front(), credentials); } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 1f69939c46..f8849bf997 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -60,13 +60,16 @@ #include "bufferarray.h" #include "bufferstream.h" #include "llcorehttputil.h" - #include "llhttpretrypolicy.h" bool LLTextureFetchDebugger::sDebuggerEnabled = false ; -LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > LLTextureFetch::sCacheHitRate("texture_cache_hits"); -LLTrace::EventStatHandle<F64Milliseconds > LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); +LLTrace::CountStatHandle<F64> LLTextureFetch::sCacheHit("texture_cache_hit"); +LLTrace::CountStatHandle<F64> LLTextureFetch::sCacheAttempt("texture_cache_attempt"); + +LLTrace::SampleStatHandle<F32Seconds> LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); +LLTrace::SampleStatHandle<F32Seconds> LLTextureFetch::sTexDecodeLatency("texture_decode_latency"); +LLTrace::SampleStatHandle<F32Seconds> LLTextureFetch::sTexFetchLatency("texture_fetch_latency"); ////////////////////////////////////////////////////////////////////////////// // @@ -564,15 +567,21 @@ private: F32 mImagePriority; U32 mWorkPriority; F32 mRequestedPriority; - S32 mDesiredDiscard, - mSimRequestedDiscard, - mRequestedDiscard, - mLoadedDiscard, - mDecodedDiscard; - LLFrameTimer mRequestedTimer, - mFetchTimer; - LLTimer mCacheReadTimer; - F32 mCacheReadTime; + S32 mDesiredDiscard; + S32 mSimRequestedDiscard; + S32 mRequestedDiscard; + S32 mLoadedDiscard; + S32 mDecodedDiscard; + S32 mFullWidth; + S32 mFullHeight; + LLFrameTimer mRequestedDeltaTimer; + LLFrameTimer mFetchDeltaTimer; + LLTimer mCacheReadTimer; + LLTimer mDecodeTimer; + LLTimer mFetchTimer; + F32 mCacheReadTime; // time for cache read only + F32 mDecodeTime; // time for decode only + F32 mFetchTime; // total time from req to finished fetch LLTextureCache::handle_t mCacheReadHandle, mCacheWriteHandle; S32 mRequestedSize, @@ -906,6 +915,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mLoadedDiscard(-1), mDecodedDiscard(-1), mCacheReadTime(0.f), + mDecodeTime(0.f), + mFetchTime(0.f), mCacheReadHandle(LLTextureCache::nullHandle()), mCacheWriteHandle(LLTextureCache::nullHandle()), mRequestedSize(0), @@ -1167,7 +1178,7 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState != DONE) { - mFetchTimer.reset(); + mFetchDeltaTimer.reset(); } if (mState == INIT) @@ -1218,7 +1229,9 @@ bool LLTextureFetchWorker::doWork(S32 param) } mFileSize = 0; mLoaded = FALSE; - + + add(LLTextureFetch::sCacheAttempt, 1.0); + if (mUrl.compare(0, 7, "file://") == 0) { setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it @@ -1229,7 +1242,7 @@ bool LLTextureFetchWorker::doWork(S32 param) CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage); mCacheReadHandle = mFetcher->mTextureCache->readFromCache(filename, mID, cache_priority, offset, size, responder); - mCacheReadTimer.reset(); + mCacheReadTimer.reset(); } else if ((mUrl.empty() || mFTType==FTT_SERVER_BAKE) && mFetcher->canLoadFromCache()) { @@ -1260,6 +1273,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { mCacheReadHandle = LLTextureCache::nullHandle(); setState(CACHE_POST); + add(LLTextureFetch::sCacheHit, 1.0); // fall through } else @@ -1297,7 +1311,6 @@ bool LLTextureFetchWorker::doWork(S32 param) LL_DEBUGS(LOG_TXT) << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize() << " Size: " << llformat("%dx%d",mFormattedImage->getWidth(),mFormattedImage->getHeight()) << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL; - record(LLTextureFetch::sCacheHitRate, LLUnits::Ratio::fromValue(1)); } else { @@ -1315,7 +1328,6 @@ bool LLTextureFetchWorker::doWork(S32 param) } // fall through - record(LLTextureFetch::sCacheHitRate, LLUnits::Ratio::fromValue(0)); } } @@ -1571,7 +1583,7 @@ bool LLTextureFetchWorker::doWork(S32 param) return true; // failed } - mRequestedTimer.reset(); + mRequestedDeltaTimer.reset(); mLoaded = FALSE; mGetStatus = LLCore::HttpStatus(); mGetReason.clear(); @@ -1898,6 +1910,8 @@ bool LLTextureFetchWorker::doWork(S32 param) mFetcher->getFetchDebugger()->addHistoryEntry(this); } + mDecodeTime = mDecodeTimer.getElapsedTimeF32(); + if (mDecodedDiscard < 0) { if (mCachedSize > 0 && !mInLocalCache && mRetryAttempt == 0) @@ -2002,6 +2016,7 @@ bool LLTextureFetchWorker::doWork(S32 param) else { setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); + mFetchTime = mFetchTimer.getElapsedTimeF32(); return true; } } @@ -2945,11 +2960,12 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, discard_level = worker->mDecodedDiscard; raw = worker->mRawImage; aux = worker->mAuxImage; - F32Seconds cache_read_time(worker->mCacheReadTime); - if (cache_read_time != (F32Seconds)0.f) - { - record(sCacheReadLatency, cache_read_time); - } + sample(sTexDecodeLatency, worker->mDecodeTime); + sample(sTexFetchLatency, worker->mFetchTime); + sample(sCacheReadLatency, worker->mCacheReadTime); + worker->mCacheReadTimer.reset(); + worker->mDecodeTimer.reset(); + worker->mFetchTimer.reset(); res = true; LL_DEBUGS(LOG_TXT) << id << ": Request Finished. State: " << worker->mState << " Discard: " << discard_level << LL_ENDL; worker->unlockWorkMutex(); // -Mw @@ -3253,7 +3269,7 @@ void LLTextureFetch::sendRequestListToSimulators() // req->setPriority(LLWorkerThread::PRIORITY_HIGH | req->mWorkPriority); continue; } - F32 elapsed = req->mRequestedTimer.getElapsedTimeF32(); + F32 elapsed = req->mRequestedDeltaTimer.getElapsedTimeF32(); { F32 delta_priority = llabs(req->mRequestedPriority - req->mImagePriority); if ((req->mSimRequestedDiscard != req->mDesiredDiscard) || @@ -3322,7 +3338,7 @@ void LLTextureFetch::sendRequestListToSimulators() req->mSentRequest = LLTextureFetchWorker::SENT_SIM; req->mSimRequestedDiscard = req->mDesiredDiscard; req->mRequestedPriority = req->mImagePriority; - req->mRequestedTimer.reset(); + req->mRequestedDeltaTimer.reset(); req->unlockWorkMutex(); // -Mw sim_request_count++; if (sim_request_count >= IMAGES_PER_REQUEST) @@ -3397,7 +3413,7 @@ void LLTextureFetch::sendRequestListToSimulators() // Locks: Mw bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size) { - mRequestedTimer.reset(); + mRequestedDeltaTimer.reset(); if (index >= mTotalPackets) { // LL_WARNS(LOG_TXT) << "Received Image Packet " << index << " > max: " << mTotalPackets << " for image: " << mID << LL_ENDL; @@ -3606,8 +3622,8 @@ S32 LLTextureFetch::getFetchState(const LLUUID& id, F32& data_progress_p, F32& r { worker->lockWorkMutex(); // +Mw state = worker->mState; - fetch_dtime = worker->mFetchTimer.getElapsedTimeF32(); - request_dtime = worker->mRequestedTimer.getElapsedTimeF32(); + fetch_dtime = worker->mFetchDeltaTimer.getElapsedTimeF32(); + request_dtime = worker->mRequestedDeltaTimer.getElapsedTimeF32(); if (worker->mFileSize > 0) { if (state == LLTextureFetchWorker::LOAD_FROM_SIMULATOR) diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index cfa312ccd9..a2155bde1f 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -308,13 +308,16 @@ public: S32 mPacketCount; S32 mBadPacketCount; + static LLTrace::CountStatHandle<F64> sCacheHit; + static LLTrace::CountStatHandle<F64> sCacheAttempt; + static LLTrace::SampleStatHandle<F32Seconds> sCacheReadLatency; + static LLTrace::SampleStatHandle<F32Seconds> sTexDecodeLatency; + static LLTrace::SampleStatHandle<F32Seconds> sTexFetchLatency; + private: LLMutex mQueueMutex; //to protect mRequestMap and mCommands only LLMutex mNetworkQueueMutex; //to protect mNetworkQueue, mHTTPTextureQueue and mCancelQueue. - static LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > sCacheHitRate; - static LLTrace::EventStatHandle<F64Milliseconds > sCacheReadLatency; - LLTextureCache* mTextureCache; LLImageDecodeThread* mImageDecodeThread; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index d7b95db94f..0d2edc0268 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -240,9 +240,9 @@ void LLTextureBar::draw() { "REQ", LLColor4::yellow },// SEND_HTTP_REQ { "HTP", LLColor4::green }, // WAIT_HTTP_REQ { "DEC", LLColor4::yellow },// DECODE_IMAGE - { "DEC", LLColor4::green }, // DECODE_IMAGE_UPDATE + { "DEU", LLColor4::green }, // DECODE_IMAGE_UPDATE { "WRT", LLColor4::purple },// WRITE_TO_CACHE - { "WRT", LLColor4::orange },// WAIT_ON_WRITE + { "WWT", LLColor4::orange },// WAIT_ON_WRITE { "END", LLColor4::red }, // DONE #define LAST_STATE 14 { "CRE", LLColor4::magenta }, // LAST_STATE+1 @@ -530,6 +530,25 @@ void LLGLTexMemBar::draw() LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6, text_color, LLFontGL::LEFT, LLFontGL::TOP); + LLTrace::Recording& recording = LLViewerStats::instance().getRecording(); + + F64 cacheHits = recording.getSampleCount(LLTextureFetch::sCacheHit); + F64 cacheAttempts = recording.getSampleCount(LLTextureFetch::sCacheAttempt); + + F32 cacheHitRate = (cacheAttempts > 0.0) ? F32((cacheHits / cacheAttempts) * 100.0f) : 0.0f; + + U32 cacheReadLatMin = U32(recording.getMin(LLTextureFetch::sCacheReadLatency).value() * 1000.0f); + U32 cacheReadLatMed = U32(recording.getMean(LLTextureFetch::sCacheReadLatency).value() * 1000.0f); + U32 cacheReadLatMax = U32(recording.getMax(LLTextureFetch::sCacheReadLatency).value() * 1000.0f); + + U32 texDecodeLatMin = U32(recording.getMin(LLTextureFetch::sTexDecodeLatency).value() * 1000.0f); + U32 texDecodeLatMed = U32(recording.getMean(LLTextureFetch::sTexDecodeLatency).value() * 1000.0f); + U32 texDecodeLatMax = U32(recording.getMax(LLTextureFetch::sTexDecodeLatency).value() * 1000.0f); + + U32 texFetchLatMin = U32(recording.getMin(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); + U32 texFetchLatMed = U32(recording.getMean(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); + U32 texFetchLatMax = U32(recording.getMax(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); + text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB", total_mem.value(), max_total_mem.value(), @@ -542,7 +561,7 @@ void LLGLTexMemBar::draw() cache_max_usage); //, cache_entries, cache_max_entries - LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*5, + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6, text_color, LLFontGL::LEFT, LLFontGL::TOP); U32 cache_read(0U), cache_write(0U), res_wait(0U); @@ -558,6 +577,21 @@ void LLGLTexMemBar::draw() cache_write, res_wait); + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*5, + text_color, LLFontGL::LEFT, LLFontGL::TOP); + + text = llformat("CacheHitRate: %3.2f Read: %d/%d/%d Decode: %d/%d/%d Fetch: %d/%d/%d", + cacheHitRate, + cacheReadLatMin, + cacheReadLatMed, + cacheReadLatMax, + texDecodeLatMin, + texDecodeLatMed, + texDecodeLatMax, + texFetchLatMin, + texFetchLatMed, + texFetchLatMax); + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*4, text_color, LLFontGL::LEFT, LLFontGL::TOP); @@ -640,7 +674,7 @@ BOOL LLGLTexMemBar::handleMouseDown(S32 x, S32 y, MASK mask) LLRect LLGLTexMemBar::getRequiredRect() { LLRect rect; - rect.mTop = 68; //LLFontGL::getFontMonospace()->getLineHeight() * 6; + rect.mTop = 78; //LLFontGL::getFontMonospace()->getLineHeight() * 6; return rect; } diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 6937d064f9..0072baa02c 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -484,12 +484,19 @@ void LLGridManager::getLoginURIs(const std::string& grid, std::vector<std::strin std::string grid_name = getGrid(grid); if (!grid_name.empty()) { - for (LLSD::array_iterator llsd_uri = mGridList[grid_name][GRID_LOGIN_URI_VALUE].beginArray(); - llsd_uri != mGridList[grid_name][GRID_LOGIN_URI_VALUE].endArray(); - llsd_uri++) - { - uris.push_back(llsd_uri->asString()); - } + if (mGridList[grid_name][GRID_LOGIN_URI_VALUE].isArray()) + { + for (LLSD::array_iterator llsd_uri = mGridList[grid_name][GRID_LOGIN_URI_VALUE].beginArray(); + llsd_uri != mGridList[grid_name][GRID_LOGIN_URI_VALUE].endArray(); + llsd_uri++) + { + uris.push_back(llsd_uri->asString()); + } + } + else + { + uris.push_back(mGridList[grid_name][GRID_LOGIN_URI_VALUE].asString()); + } } else { diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 39ffbfc989..712d0883d3 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1189,9 +1189,17 @@ void LLViewerFetchedTexture::loadFromFastCache() } mInFastCacheList = FALSE; + add(LLTextureFetch::sCacheAttempt, 1.0); + + LLTimer fastCacheTimer; mRawImage = LLAppViewer::getTextureCache()->readFromFastCache(getID(), mRawDiscardLevel); if(mRawImage.notNull()) { + F32 cachReadTime = fastCacheTimer.getElapsedTimeF32(); + + add(LLTextureFetch::sCacheHit, 1.0); + sample(LLTextureFetch::sCacheReadLatency, cachReadTime); + mFullWidth = mRawImage->getWidth() << mRawDiscardLevel; mFullHeight = mRawImage->getHeight() << mRawDiscardLevel; setTexelsPerImage(); diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml index 8c769d87de..67b99ca588 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -603,11 +603,10 @@ layout="topleft" label_width="205" left="10" - max_val="9999" - min_val="-9999" + max_val="360" + min_val="-360" name="TexRot" width="265" /> - <spinner follows="left|top" height="19" @@ -617,6 +616,7 @@ layout="topleft" left="10" min_val="-1" + max_val="1" name="TexOffsetU" width="265" /> <spinner @@ -628,6 +628,7 @@ layout="topleft" left="10" min_val="-1" + max_val="1" name="TexOffsetV" width="265" /> <spinner @@ -667,10 +668,9 @@ label_width="205" left="10" max_val="360" - min_val="0" + min_val="-360" name="bumpyRot" width="265" /> - <spinner follows="left|top" height="19" @@ -679,7 +679,8 @@ label_width="205" layout="topleft" left="10" - min_val="0" + min_val="-1" + max_val="1" name="bumpyOffsetU" width="265" /> <spinner @@ -690,7 +691,8 @@ label_width="205" layout="topleft" left="10" - min_val="0" + min_val="-1" + max_val="1" name="bumpyOffsetV" width="265" /> <spinner @@ -730,10 +732,9 @@ label_width="205" left="10" max_val="360" - min_val="0" + min_val="-360" name="shinyRot" width="265" /> - <spinner follows="left|top" height="19" @@ -742,7 +743,8 @@ label_width="205" layout="topleft" left="10" - min_val="0" + min_val="-1" + max_val="1" name="shinyOffsetU" width="265" /> <spinner @@ -753,7 +755,8 @@ label_width="205" layout="topleft" left="10" - min_val="0" + min_val="-1" + max_val="1" name="shinyOffsetV" width="265" /> <check_box |