From da86dd08c48f54641d397a1a14d4a956d302eb25 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 6 Aug 2019 00:09:59 -0500 Subject: [PATCH 1/9] Throttle avie complexity calculation frequency to once per 5s per avie. --- indra/newview/llvoavatar.cpp | 8 ++++++-- indra/newview/llvoavatar.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 26f136549..dc91b315d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10623,8 +10623,12 @@ void LLVOAvatar::idleUpdateRenderComplexity() } } - // Render Complexity - calculateUpdateRenderComplexity(); // Update mVisualComplexity if needed + if (mComplexityTimer.getElapsedTimeF32() > 5.f) + { + // Render Complexity + calculateUpdateRenderComplexity(); // Update mVisualComplexity if needed + mComplexityTimer.start(); + } if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME)) { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 7df17cc7c..928292791 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -1171,6 +1171,8 @@ public: private: S32 mIdleMinute; + LLTimer mComplexityTimer; + //CCS Nametag public: void setNameFromChat(const std::string &text); From 4091bf9da55e0151dd0a0e23f05ec11d80570cd7 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 6 Aug 2019 02:21:56 -0500 Subject: [PATCH 2/9] Template abuse to clean up llkeyframemotion. Only functional change: std::map to std::vector>. Sorry in advance Linux. --- indra/llcharacter/llkeyframemotion.cpp | 308 +++---------------------- indra/llcharacter/llkeyframemotion.h | 166 +++++++------ 2 files changed, 113 insertions(+), 361 deletions(-) diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index ed9167f74..1c842e6b8 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -138,257 +138,6 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const return total_size; } -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -// ****Curve classes -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- - - -//----------------------------------------------------------------------------- -// ScaleCurve::ScaleCurve() -//----------------------------------------------------------------------------- -LLKeyframeMotion::ScaleCurve::ScaleCurve() -{ - mInterpolationType = LLKeyframeMotion::IT_LINEAR; - mNumKeys = 0; -} - -//----------------------------------------------------------------------------- -// ScaleCurve::~ScaleCurve() -//----------------------------------------------------------------------------- -LLKeyframeMotion::ScaleCurve::~ScaleCurve() -{ - mKeys.clear(); - mNumKeys = 0; -} - -//----------------------------------------------------------------------------- -// getValue() -//----------------------------------------------------------------------------- -LLVector3 LLKeyframeMotion::ScaleCurve::getValue(F32 time, F32 duration) -{ - LLVector3 value; - - if (mKeys.empty()) - { - value.clearVec(); - return value; - } - - key_map_t::iterator right = mKeys.lower_bound(time); - if (right == mKeys.end()) - { - // Past last key - --right; - value = right->second.mScale; - } - else if (right == mKeys.begin() || right->first == time) - { - // Before first key or exactly on a key - value = right->second.mScale; - } - else - { - // Between two keys - key_map_t::iterator left = right; --left; - F32 index_before = left->first; - F32 index_after = right->first; - ScaleKey& scale_before = left->second; - ScaleKey& scale_after = right->second; - if (right == mKeys.end()) - { - scale_after = mLoopInKey; - index_after = duration; - } - - F32 u = (time - index_before) / (index_after - index_before); - value = interp(u, scale_before, scale_after); - } - return value; -} - -//----------------------------------------------------------------------------- -// interp() -//----------------------------------------------------------------------------- -LLVector3 LLKeyframeMotion::ScaleCurve::interp(F32 u, ScaleKey& before, ScaleKey& after) -{ - switch (mInterpolationType) - { - case IT_STEP: - return before.mScale; - - default: - case IT_LINEAR: - case IT_SPLINE: - return lerp(before.mScale, after.mScale, u); - } -} - -//----------------------------------------------------------------------------- -// RotationCurve::RotationCurve() -//----------------------------------------------------------------------------- -LLKeyframeMotion::RotationCurve::RotationCurve() -{ - mInterpolationType = LLKeyframeMotion::IT_LINEAR; - mNumKeys = 0; -} - -//----------------------------------------------------------------------------- -// RotationCurve::~RotationCurve() -//----------------------------------------------------------------------------- -LLKeyframeMotion::RotationCurve::~RotationCurve() -{ - mKeys.clear(); - mNumKeys = 0; -} - -//----------------------------------------------------------------------------- -// RotationCurve::getValue() -//----------------------------------------------------------------------------- -LLQuaternion LLKeyframeMotion::RotationCurve::getValue(F32 time, F32 duration) -{ - LLQuaternion value; - - if (mKeys.empty()) - { - value = LLQuaternion::DEFAULT; - return value; - } - - key_map_t::iterator right = mKeys.lower_bound(time); - if (right == mKeys.end()) - { - // Past last key - --right; - value = right->second.mRotation; - } - else if (right == mKeys.begin() || right->first == time) - { - // Before first key or exactly on a key - value = right->second.mRotation; - } - else - { - // Between two keys - key_map_t::iterator left = right; --left; - F32 index_before = left->first; - F32 index_after = right->first; - RotationKey& rot_before = left->second; - RotationKey& rot_after = right->second; - if (right == mKeys.end()) - { - rot_after = mLoopInKey; - index_after = duration; - } - - F32 u = (time - index_before) / (index_after - index_before); - value = interp(u, rot_before, rot_after); - } - return value; -} - -//----------------------------------------------------------------------------- -// interp() -//----------------------------------------------------------------------------- -LLQuaternion LLKeyframeMotion::RotationCurve::interp(F32 u, RotationKey& before, RotationKey& after) -{ - switch (mInterpolationType) - { - case IT_STEP: - return before.mRotation; - - default: - case IT_LINEAR: - case IT_SPLINE: - return nlerp(u, before.mRotation, after.mRotation); - } -} - - -//----------------------------------------------------------------------------- -// PositionCurve::PositionCurve() -//----------------------------------------------------------------------------- -LLKeyframeMotion::PositionCurve::PositionCurve() -{ - mInterpolationType = LLKeyframeMotion::IT_LINEAR; - mNumKeys = 0; -} - -//----------------------------------------------------------------------------- -// PositionCurve::~PositionCurve() -//----------------------------------------------------------------------------- -LLKeyframeMotion::PositionCurve::~PositionCurve() -{ - mKeys.clear(); - mNumKeys = 0; -} - -//----------------------------------------------------------------------------- -// PositionCurve::getValue() -//----------------------------------------------------------------------------- -LLVector3 LLKeyframeMotion::PositionCurve::getValue(F32 time, F32 duration) -{ - LLVector3 value; - - if (mKeys.empty()) - { - value.clearVec(); - return value; - } - - key_map_t::iterator right = mKeys.lower_bound(time); - if (right == mKeys.end()) - { - // Past last key - --right; - value = right->second.mPosition; - } - else if (right == mKeys.begin() || right->first == time) - { - // Before first key or exactly on a key - value = right->second.mPosition; - } - else - { - // Between two keys - key_map_t::iterator left = right; --left; - F32 index_before = left->first; - F32 index_after = right->first; - PositionKey& pos_before = left->second; - PositionKey& pos_after = right->second; - if (right == mKeys.end()) - { - pos_after = mLoopInKey; - index_after = duration; - } - - F32 u = (time - index_before) / (index_after - index_before); - value = interp(u, pos_before, pos_after); - } - - llassert(value.isFinite()); - - return value; -} - -//----------------------------------------------------------------------------- -// interp() -//----------------------------------------------------------------------------- -LLVector3 LLKeyframeMotion::PositionCurve::interp(F32 u, PositionKey& before, PositionKey& after) -{ - switch (mInterpolationType) - { - case IT_STEP: - return before.mPosition; - default: - case IT_LINEAR: - case IT_SPLINE: - return lerp(before.mPosition, after.mPosition, u); - } -} - - //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // JointMotion class @@ -1668,7 +1417,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id) success = dp.unpackVector3(rot_angles, "rot_angles") && rot_angles.isFinite(); LLQuaternion::Order ro = StringToOrder("ZYX"); - rot_key.mRotation = mayaQ(rot_angles.mV[VX], rot_angles.mV[VY], rot_angles.mV[VZ], ro); + rot_key.mValue = mayaQ(rot_angles.mV[VX], rot_angles.mV[VY], rot_angles.mV[VZ], ro); } else { @@ -1680,10 +1429,10 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id) rot_vec.mV[VX] = U16_to_F32(x, -1.f, 1.f); rot_vec.mV[VY] = U16_to_F32(y, -1.f, 1.f); rot_vec.mV[VZ] = U16_to_F32(z, -1.f, 1.f); - rot_key.mRotation.unpackFromVector3(rot_vec); + rot_key.mValue.unpackFromVector3(rot_vec); } - if( !(rot_key.mRotation.isFinite()) ) + if( !(rot_key.mValue.isFinite()) ) { LL_WARNS() << "non-finite angle in rotation key" << " for animation " << asset_id << LL_ENDL; @@ -1697,9 +1446,11 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id) return FALSE; } - rCurve->mKeys[time] = rot_key; + rCurve->mKeys.emplace_back(time, rot_key); } + std::sort(rCurve->mKeys.begin(), rCurve->mKeys.end(), [](const auto& a, const auto& b) { return a.first < b.first; }); + //--------------------------------------------------------------------- // scan position curve header //--------------------------------------------------------------------- @@ -1752,12 +1503,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id) if (old_version) { - success = dp.unpackVector3(pos_key.mPosition, "pos"); + success = dp.unpackVector3(pos_key.mValue, "pos"); //MAINT-6162 - pos_key.mPosition.mV[VX] = llclamp( pos_key.mPosition.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); - pos_key.mPosition.mV[VY] = llclamp( pos_key.mPosition.mV[VY], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); - pos_key.mPosition.mV[VZ] = llclamp( pos_key.mPosition.mV[VZ], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); + pos_key.mValue.mV[VX] = llclamp( pos_key.mValue.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); + pos_key.mValue.mV[VY] = llclamp( pos_key.mValue.mV[VY], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); + pos_key.mValue.mV[VZ] = llclamp( pos_key.mValue.mV[VZ], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); } else @@ -1768,12 +1519,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id) success &= dp.unpackU16(y, "pos_y"); success &= dp.unpackU16(z, "pos_z"); - pos_key.mPosition.mV[VX] = U16_to_F32(x, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); - pos_key.mPosition.mV[VY] = U16_to_F32(y, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); - pos_key.mPosition.mV[VZ] = U16_to_F32(z, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); + pos_key.mValue.mV[VX] = U16_to_F32(x, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); + pos_key.mValue.mV[VY] = U16_to_F32(y, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); + pos_key.mValue.mV[VZ] = U16_to_F32(z, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); } - if( !(pos_key.mPosition.isFinite()) ) + if( !(pos_key.mValue.isFinite()) ) { LL_WARNS() << "non-finite position in key" << " for animation " << asset_id << LL_ENDL; @@ -1787,14 +1538,17 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id) return FALSE; } - pCurve->mKeys[pos_key.mTime] = pos_key; + pCurve->mKeys.emplace_back(pos_key.mTime, pos_key); if (is_pelvis) { - mJointMotionList->mPelvisBBox.addPoint(pos_key.mPosition); + mJointMotionList->mPelvisBBox.addPoint(pos_key.mValue); } + } + std::sort(pCurve->mKeys.begin(), pCurve->mKeys.end(), [](const auto& a, const auto& b) { return a.first < b.first; }); + joint_motion->mUsage = joint_state->getUsage(); } @@ -2087,7 +1841,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const U16 time_short = F32_to_U16(rot_key.mTime, 0.f, mJointMotionList->mDuration); success &= dp.packU16(time_short, "time"); - LLVector3 rot_angles = rot_key.mRotation.packToVector3(); + LLVector3 rot_angles = rot_key.mValue.packToVector3(); U16 x, y, z; rot_angles.quantize16(-1.f, 1.f, -1.f, 1.f); @@ -2110,15 +1864,15 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const success &= dp.packU16(time_short, "time"); U16 x, y, z; - pos_key.mPosition.quantize16(-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); - x = F32_to_U16(pos_key.mPosition.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); - y = F32_to_U16(pos_key.mPosition.mV[VY], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); - z = F32_to_U16(pos_key.mPosition.mV[VZ], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); + pos_key.mValue.quantize16(-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); + x = F32_to_U16(pos_key.mValue.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); + y = F32_to_U16(pos_key.mValue.mV[VY], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); + z = F32_to_U16(pos_key.mValue.mV[VZ], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET); success &= dp.packU16(x, "pos_x"); success &= dp.packU16(y, "pos_y"); success &= dp.packU16(z, "pos_z"); - LL_DEBUGS("BVH") << " pos: t " << pos_key.mTime << " pos " << pos_key.mPosition.mV[VX] <<","<< pos_key.mPosition.mV[VY] <<","<< pos_key.mPosition.mV[VZ] << LL_ENDL; + LL_DEBUGS("BVH") << " pos: t " << pos_key.mTime << " pos " << pos_key.mValue.mV[VX] <<","<< pos_key.mValue.mV[VY] <<","<< pos_key.mValue.mV[VZ] << LL_ENDL; } } @@ -2296,9 +2050,9 @@ void LLKeyframeMotion::setLoopIn(F32 in_point) rot_curve->mLoopInKey.mTime = mJointMotionList->mLoopInPoint; scale_curve->mLoopInKey.mTime = mJointMotionList->mLoopInPoint; - pos_curve->mLoopInKey.mPosition = pos_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration); - rot_curve->mLoopInKey.mRotation = rot_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration); - scale_curve->mLoopInKey.mScale = scale_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration); + pos_curve->mLoopInKey.mValue = pos_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration); + rot_curve->mLoopInKey.mValue = rot_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration); + scale_curve->mLoopInKey.mValue = scale_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration); } } } @@ -2325,9 +2079,9 @@ void LLKeyframeMotion::setLoopOut(F32 out_point) rot_curve->mLoopOutKey.mTime = mJointMotionList->mLoopOutPoint; scale_curve->mLoopOutKey.mTime = mJointMotionList->mLoopOutPoint; - pos_curve->mLoopOutKey.mPosition = pos_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration); - rot_curve->mLoopOutKey.mRotation = rot_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration); - scale_curve->mLoopOutKey.mScale = scale_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration); + pos_curve->mLoopOutKey.mValue = pos_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration); + rot_curve->mLoopOutKey.mValue = rot_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration); + scale_curve->mLoopOutKey.mValue = scale_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration); } } } diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h index c68243bd4..1db66a50d 100644 --- a/indra/llcharacter/llkeyframemotion.h +++ b/indra/llcharacter/llkeyframemotion.h @@ -387,101 +387,99 @@ public: enum InterpolationType { IT_STEP, IT_LINEAR, IT_SPLINE }; - //------------------------------------------------------------------------- - // ScaleKey - //------------------------------------------------------------------------- - class ScaleKey - { - public: - ScaleKey() { mTime = 0.0f; } - ScaleKey(F32 time, const LLVector3 &scale) { mTime = time; mScale = scale; } - - F32 mTime; - LLVector3 mScale; + template + struct lerp_op { + static T lerp(F32 t, const T& before, const T& after) + { + return ::lerp(before, after, t); + } + }; + template<> + struct lerp_op { + static LLQuaternion lerp(F32 t, const LLQuaternion& before, const LLQuaternion& after) + { + return ::nlerp(t, before, after); + } }; - //------------------------------------------------------------------------- - // RotationKey - //------------------------------------------------------------------------- - class RotationKey + template + struct Curve { - public: - RotationKey() { mTime = 0.0f; } - RotationKey(F32 time, const LLQuaternion &rotation) { mTime = time; mRotation = rotation; } + struct Key + { + Key() = default; + Key(F32 time, const T& value) { mTime = time; mValue = value; } + F32 mTime = 0; + T mValue; + }; - F32 mTime; - LLQuaternion mRotation; - }; + T interp(F32 u, Key& before, Key& after) + { + switch (mInterpolationType) + { + case IT_STEP: + return before.mValue; + default: + case IT_LINEAR: + case IT_SPLINE: + return lerp_op::lerp(u, before.mValue, after.mValue); + } + } - //------------------------------------------------------------------------- - // PositionKey - //------------------------------------------------------------------------- - class PositionKey - { - public: - PositionKey() { mTime = 0.0f; } - PositionKey(F32 time, const LLVector3 &position) { mTime = time; mPosition = position; } + T getValue(F32 time, F32 duration) + { + if (mKeys.empty()) + { + return T(); + } - F32 mTime; - LLVector3 mPosition; - }; + T value; + key_map_t::iterator right = std::lower_bound(mKeys.begin(), mKeys.end(), time, [](const auto& a, const auto& b) { return a.first < b; }); + if (right == mKeys.end()) + { + // Past last key + --right; + value = right->second.mValue; + } + else if (right == mKeys.begin() || right->first == time) + { + // Before first key or exactly on a key + value = right->second.mValue; + } + else + { + // Between two keys + key_map_t::iterator left = right; --left; + F32 index_before = left->first; + F32 index_after = right->first; + Key& pos_before = left->second; + Key& pos_after = right->second; + if (right == mKeys.end()) + { + pos_after = mLoopInKey; + index_after = duration; + } - //------------------------------------------------------------------------- - // ScaleCurve - //------------------------------------------------------------------------- - class ScaleCurve - { - public: - ScaleCurve(); - ~ScaleCurve(); - LLVector3 getValue(F32 time, F32 duration); - LLVector3 interp(F32 u, ScaleKey& before, ScaleKey& after); + F32 u = (time - index_before) / (index_after - index_before); + value = interp(u, pos_before, pos_after); + } + return value; + } - InterpolationType mInterpolationType; - S32 mNumKeys; - typedef std::map key_map_t; + InterpolationType mInterpolationType = LLKeyframeMotion::IT_LINEAR; + S32 mNumKeys = 0; + typedef std::vector< std::pair > key_map_t; key_map_t mKeys; - ScaleKey mLoopInKey; - ScaleKey mLoopOutKey; + Key mLoopInKey; + Key mLoopOutKey; }; - //------------------------------------------------------------------------- - // RotationCurve - //------------------------------------------------------------------------- - class RotationCurve - { - public: - RotationCurve(); - ~RotationCurve(); - LLQuaternion getValue(F32 time, F32 duration); - LLQuaternion interp(F32 u, RotationKey& before, RotationKey& after); - - InterpolationType mInterpolationType; - S32 mNumKeys; - typedef std::map key_map_t; - key_map_t mKeys; - RotationKey mLoopInKey; - RotationKey mLoopOutKey; - }; - - //------------------------------------------------------------------------- - // PositionCurve - //------------------------------------------------------------------------- - class PositionCurve - { - public: - PositionCurve(); - ~PositionCurve(); - LLVector3 getValue(F32 time, F32 duration); - LLVector3 interp(F32 u, PositionKey& before, PositionKey& after); - - InterpolationType mInterpolationType; - S32 mNumKeys; - typedef std::map key_map_t; - key_map_t mKeys; - PositionKey mLoopInKey; - PositionKey mLoopOutKey; - }; + typedef Curve ScaleCurve; + typedef ScaleCurve::Key ScaleKey; + typedef Curve RotationCurve; + typedef RotationCurve::Key RotationKey; + typedef Curve PositionCurve; + typedef PositionCurve::Key PositionKey; //------------------------------------------------------------------------- // JointMotion From 21b1d5b52ecbbff394a55daef5eb74ad042e5be7 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 7 Aug 2019 21:21:36 -0500 Subject: [PATCH 3/9] Hotspot elimination. --- indra/newview/llhudnametag.cpp | 14 +++++++------- indra/newview/llhudnametag.h | 4 ++-- indra/newview/llhudtext.cpp | 14 +++++++------- indra/newview/llhudtext.h | 4 ++-- indra/newview/llspatialpartition.cpp | 1 + indra/newview/llviewertexturelist.cpp | 16 ++++++++++------ indra/newview/llviewertexturelist.h | 3 +++ 7 files changed, 32 insertions(+), 24 deletions(-) diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index c80f1818e..d57ae3006 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -1056,15 +1056,15 @@ void LLHUDNameTag::reshape() F32 LLHUDNameTag::LLHUDTextSegment::getWidth(const LLFontGL* font) { - std::map::iterator iter = mFontWidthMap.find(font); - if (iter != mFontWidthMap.end()) + if (mFontWidthMap[0].first == font) { - return iter->second; + return mFontWidthMap[0].second; } - else + else if (mFontWidthMap[1].first == font) { - F32 width = font->getWidthF32(mText.c_str()); - mFontWidthMap[font] = width; - return width; + return mFontWidthMap[1].second; } + F32 width = font->getWidthF32(mText.c_str()); + mFontWidthMap[mFontWidthMap[0].first != nullptr] = std::make_pair(font, width); + return width; } diff --git a/indra/newview/llhudnametag.h b/indra/newview/llhudnametag.h index e238fac5a..bc48d788e 100644 --- a/indra/newview/llhudnametag.h +++ b/indra/newview/llhudnametag.h @@ -63,14 +63,14 @@ protected: {} F32 getWidth(const LLFontGL* font); const LLWString& getText() const { return mText; } - void clearFontWidthMap() { mFontWidthMap.clear(); } + void clearFontWidthMap() { mFontWidthMap[0].first = nullptr; mFontWidthMap[1].first = nullptr; } LLColor4 mColor; LLFontGL::StyleFlags mStyle; const LLFontGL* mFont; private: LLWString mText; - std::map mFontWidthMap; + std::pair mFontWidthMap[2]; }; public: diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index c996c462e..f20a4cca3 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -674,17 +674,17 @@ void LLHUDText::reshape() F32 LLHUDText::LLHUDTextSegment::getWidth(const LLFontGL* font) { - std::map::iterator iter = mFontWidthMap.find(font); - if (iter != mFontWidthMap.end()) + if (mFontWidthMap[0].first == font) { - return iter->second; + return mFontWidthMap[0].second; } - else + else if (mFontWidthMap[1].first == font) { - F32 width = font->getWidthF32(mText.c_str()); - mFontWidthMap[font] = width; - return width; + return mFontWidthMap[1].second; } + F32 width = font->getWidthF32(mText.c_str()); + mFontWidthMap[mFontWidthMap[0].first != nullptr] = std::make_pair(font, width); + return width; } // [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 68450753c..9ee224954 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -61,14 +61,14 @@ protected: {} F32 getWidth(const LLFontGL* font); const LLWString& getText() const { return mText; } - void clearFontWidthMap() { mFontWidthMap.clear(); } + void clearFontWidthMap() { mFontWidthMap[0].first = nullptr; mFontWidthMap[1].first = nullptr; } LLColor4 mColor; LLFontGL::StyleFlags mStyle; const LLFontGL* mFont; private: LLWString mText; - std::map mFontWidthMap; + std::pair mFontWidthMap[2]; }; public: diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index a62b1166b..3f9a4ef0b 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1269,6 +1269,7 @@ public: group->destroyGL(); {OctreeGuard guard(group->getOctreeNode()); + if (!mNoRebuild) // Singu note: No need to iterate if not rebuilding... for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i) { LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable(); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index d49210b6d..82d4cef61 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -326,6 +326,7 @@ void LLViewerTextureList::shutdown() mCreateTextureList.clear(); mUUIDMap.clear(); + mUUIDDict.clear(); mImageList.clear(); @@ -600,8 +601,8 @@ LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id, LLViewerFetchedTexture *LLViewerTextureList::findImage(const LLUUID &image_id) { - uuid_map_t::iterator iter = mUUIDMap.find(image_id); - if(iter == mUUIDMap.end()) + auto& iter = mUUIDDict.find(image_id); + if(iter == mUUIDDict.end()) return NULL; return iter->second; } @@ -648,8 +649,8 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) << " but doesn't have mInImageList set" << " ref count is " << image->getNumRefs() << LL_ENDL; - uuid_map_t::iterator iter = mUUIDMap.find(image->getID()); - if(iter == mUUIDMap.end()) + auto& iter = mUUIDDict.find(image->getID()); + if(iter == mUUIDDict.end()) { LL_INFOS() << "Image " << image->getID() << " is also not in mUUIDMap!" << LL_ENDL ; } @@ -690,7 +691,8 @@ void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image) sNumImages++; addImageToList(new_image); - mUUIDMap[image_id] = new_image; + mUUIDMap.emplace(image_id, new_image); + mUUIDDict.emplace(image_id, new_image); } @@ -703,7 +705,9 @@ void LLViewerTextureList::deleteImage(LLViewerFetchedTexture *image) mCallbackList.erase(image); } - llverify(mUUIDMap.erase(image->getID()) == 1); + const LLUUID& id = image->getID(); + llverify(mUUIDMap.erase(id) == 1); + llverify(mUUIDDict.erase(id) == 1); sNumImages--; removeImageFromList(image); } diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index b24fd8702..e69b9ddbc 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -35,6 +35,7 @@ #include "llui.h" #include #include +#include const U32 LL_IMAGE_REZ_LOSSLESS_CUTOFF = 128; @@ -187,6 +188,8 @@ public: private: typedef std::map< LLUUID, LLPointer > uuid_map_t; uuid_map_t mUUIDMap; + typedef std::unordered_map< LLUUID, LLPointer* > uuid_dict_t; + uuid_map_t mUUIDDict; LLUUID mLastUpdateUUID; LLUUID mLastFetchUUID; From d2b28f60ff861427bb9581ca65df1a0a8ce02997 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 7 Aug 2019 21:27:53 -0500 Subject: [PATCH 4/9] Speed up object param lookups. --- indra/newview/awavefront.cpp | 2 +- indra/newview/daeexport.cpp | 2 +- indra/newview/llhudtext.cpp | 1 + indra/newview/llpanelobject.cpp | 24 ++--- indra/newview/llpanelobject.h | 8 +- indra/newview/llpanelvolume.cpp | 6 +- indra/newview/llviewermenu.cpp | 4 +- indra/newview/llviewerobject.cpp | 127 ++++++++++--------------- indra/newview/llviewerobject.h | 61 +++++++++--- indra/newview/llviewerobjectbackup.cpp | 27 +++--- indra/newview/llviewertexturelist.cpp | 1 + indra/newview/llvovolume.cpp | 74 +++++++------- 12 files changed, 171 insertions(+), 166 deletions(-) diff --git a/indra/newview/awavefront.cpp b/indra/newview/awavefront.cpp index 2c6e0127e..11a81d350 100644 --- a/indra/newview/awavefront.cpp +++ b/indra/newview/awavefront.cpp @@ -238,7 +238,7 @@ namespace LLViewerObject* obj = node->getObject(); if (obj->isSculpted() && !obj->isMesh()) { - LLSculptParams *sculpt_params = (LLSculptParams *)obj->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = obj->getSculptParams(); LLUUID sculpt_id = sculpt_params->getSculptTexture(); // Find inventory items with asset id of the sculpt map diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 71697251c..9f154e72f 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -139,7 +139,7 @@ namespace DAEExportUtil LLViewerObject* obj = node->getObject(); if (obj->isSculpted() && !obj->isMesh()) { - LLSculptParams *sculpt_params = (LLSculptParams *)obj->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = obj->getSculptParams(); LLUUID sculpt_id = sculpt_params->getSculptTexture(); return canExportTexture(sculpt_id); } diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index f20a4cca3..d456584cf 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -674,6 +674,7 @@ void LLHUDText::reshape() F32 LLHUDText::LLHUDTextSegment::getWidth(const LLFontGL* font) { + // Singu note: Reworked hotspot. Less indirection if (mFontWidthMap[0].first == font) { return mFontWidthMap[0].second; diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index f838f7d8f..2eab07463 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -130,10 +130,10 @@ LLVector3 LLPanelObject::mClipboardPos; LLVector3 LLPanelObject::mClipboardSize; LLVector3 LLPanelObject::mClipboardRot; LLVolumeParams LLPanelObject::mClipboardVolumeParams; -LLFlexibleObjectData* LLPanelObject::mClipboardFlexiParams = NULL; -LLLightParams* LLPanelObject::mClipboardLightParams = NULL; -LLSculptParams* LLPanelObject::mClipboardSculptParams = NULL; -LLLightImageParams* LLPanelObject::mClipboardLightImageParams = NULL; +const LLFlexibleObjectData* LLPanelObject::mClipboardFlexiParams = NULL; +const LLLightParams* LLPanelObject::mClipboardLightParams = NULL; +const LLSculptParams* LLPanelObject::mClipboardSculptParams = NULL; +const LLLightImageParams* LLPanelObject::mClipboardLightImageParams = NULL; BOOL LLPanelObject::hasParamClipboard = FALSE; BOOL LLPanelObject::postBuild() @@ -895,7 +895,7 @@ void LLPanelObject::getState( ) } - if (objectp->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT)) + if (objectp->getSculptParams()) { selected_item = MI_SCULPT; LLFirstUse::useSculptedPrim(); @@ -1398,7 +1398,7 @@ void LLPanelObject::getState( ) LLUUID id; - LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = objectp->getSculptParams(); if (sculpt_params) // if we have a legal sculpt param block for this object: @@ -1574,13 +1574,13 @@ void LLPanelObject::onCommitParametric( LLUICtrl* ctrl, void* userdata ) if (selected_type == MI_SCULPT) { self->mObject->setParameterEntryInUse(LLNetworkData::PARAMS_SCULPT, TRUE, TRUE); - LLSculptParams *sculpt_params = (LLSculptParams *)self->mObject->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = self->mObject->getSculptParams(); if (sculpt_params) volume_params.setSculptID(sculpt_params->getSculptTexture(), sculpt_params->getSculptType()); } else { - LLSculptParams *sculpt_params = (LLSculptParams *)self->mObject->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = self->mObject->getSculptParams(); if (sculpt_params) self->mObject->setParameterEntryInUse(LLNetworkData::PARAMS_SCULPT, FALSE, TRUE); } @@ -2463,16 +2463,16 @@ void LLPanelObject::onCopyParams(void* user_data) LLViewerObject* objp = self->mObject; - mClipboardFlexiParams = objp->getParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE) ? static_cast(objp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE)) : NULL; - mClipboardLightParams = objp->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT) ? static_cast(objp->getParameterEntry(LLNetworkData::PARAMS_LIGHT)) : NULL; - mClipboardSculptParams = objp->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT) ? static_cast(objp->getParameterEntry(LLNetworkData::PARAMS_SCULPT)) : NULL; + mClipboardFlexiParams = objp->getFlexibleObjectData(); + mClipboardLightParams = objp->getLightParams(); + mClipboardSculptParams = objp->getSculptParams(); if (mClipboardSculptParams) { const LLUUID id = mClipboardSculptParams->getSculptTexture(); if (id != LLUUID(SCULPT_DEFAULT_TEXTURE) && !texturePermsCheck(id)) mClipboardSculptParams = NULL; } - mClipboardLightImageParams = objp->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE) ? static_cast(objp->getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE)) : NULL; + mClipboardLightImageParams = objp->getLightImageParams(); if (mClipboardLightImageParams && texturePermsCheck(mClipboardLightImageParams->getLightTexture())) { mClipboardLightImageParams = NULL; diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index e98808747..18877663c 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -122,10 +122,10 @@ protected: static LLVector3 mClipboardSize; static LLVector3 mClipboardRot; static LLVolumeParams mClipboardVolumeParams; - static LLFlexibleObjectData* mClipboardFlexiParams; - static LLLightParams* mClipboardLightParams; - static LLSculptParams* mClipboardSculptParams; - static LLLightImageParams* mClipboardLightImageParams; + static const LLFlexibleObjectData* mClipboardFlexiParams; + static const LLLightParams* mClipboardLightParams; + static const LLSculptParams* mClipboardSculptParams; + static const LLLightImageParams* mClipboardLightImageParams; static BOOL hasParamClipboard; S32 mComboMaterialItemCount; diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 4426a2846..f521a6cca 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -410,7 +410,7 @@ void LLPanelVolume::getState( ) getChildView("FlexForceY")->setEnabled(true); getChildView("FlexForceZ")->setEnabled(true); - LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); + const LLFlexibleObjectData *attributes = objectp->getFlexibleObjectData(); getChild("FlexNumSections")->setValue((F32)attributes->getSimulateLOD()); getChild("FlexGravity")->setValue(attributes->getGravity()); @@ -462,7 +462,7 @@ void LLPanelVolume::getState( ) mComboPhysicsShapeType->add(getString("None"), LLSD(1)); BOOL isMesh = FALSE; - LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = objectp->getSculptParams(); if (sculpt_params) { U8 sculpt_type = sculpt_params->getSculptType(); @@ -777,7 +777,7 @@ void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata ) return; } - LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); + const LLFlexibleObjectData *attributes = objectp->getFlexibleObjectData(); if (attributes) { LLFlexibleObjectData new_attributes; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index b492683f1..51216eb26 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2189,7 +2189,7 @@ public: LLVOVolume* volume = (*(img->getVolumeList()))[i]; if (volume && volume->isSculpted()) { - LLSculptParams *sculpt_params = (LLSculptParams *)volume->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = volume->getSculptParams(); if(sculpt_params->getSculptTexture() == id) volume->notifyMeshLoaded(); } @@ -2226,7 +2226,7 @@ void reload_objects(LLTextureReloader& texture_list, LLViewerObject::const_child if(object->isSculpted() && !object->isMesh()) { - LLSculptParams *sculpt_params = (LLSculptParams *)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = object->getSculptParams(); if(sculpt_params) { texture_list.addTexture(LLViewerTextureManager::getFetchedTexture(sculpt_params->getSculptTexture())); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index ba36aa529..8b41996c6 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1377,11 +1377,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, unpackParticleSource(block_num, owner_id); // Mark all extra parameters not used - std::vector >::iterator iter; - for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter) + for (auto& entry : mExtraParameterList) { - if(*iter) - (*iter)->in_use = FALSE; + if (entry.in_use) *entry.in_use = false; } // Unpack extra parameters @@ -1410,10 +1408,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, for (size_t i = 0; i < mExtraParameterList.size(); ++i) { - if (mExtraParameterList[i] && !mExtraParameterList[i]->in_use) + auto& entry = mExtraParameterList[i]; + if (entry.in_use && !*entry.in_use) { // Send an update message in case it was formerly in use - parameterChanged((i + 1) << 4, mExtraParameterList[i]->data.get(), FALSE, false); + parameterChanged((i + 1) << 4, entry.data, FALSE, false); } } break; @@ -1633,11 +1632,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, } // Mark all extra parameters not used - std::vector >::iterator iter; - for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter) + for (auto& entry : mExtraParameterList) { - if(*iter) - (*iter)->in_use = FALSE; + if (entry.in_use) *entry.in_use = false; } // Unpack extra params @@ -1657,10 +1654,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, for (size_t i = 0; i < mExtraParameterList.size(); ++i) { - if (mExtraParameterList[i] && !mExtraParameterList[i]->in_use) + auto& entry = mExtraParameterList[i]; + if (entry.in_use && !*entry.in_use) { // Send an update message in case it was formerly in use - parameterChanged((i + 1) << 4, mExtraParameterList[i]->data.get(), FALSE, false); + parameterChanged((i + 1) << 4, entry.data, FALSE, false); } } @@ -3990,7 +3988,7 @@ void LLViewerObject::boostTexturePriority(BOOL boost_children /* = TRUE */) if (isSculpted() && !isMesh()) { - LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = getSculptParams(); LLUUID sculpt_id = sculpt_params->getSculptTexture(); LLViewerTextureManager::getFetchedTexture(sculpt_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)->setBoostLevel(LLGLTexture::BOOST_SELECTED); } @@ -5814,8 +5812,8 @@ bool LLViewerObject::unpackParameterEntry(U16 param_type, LLDataPacker *dp) if (param) { param->data->unpack(*dp); - param->in_use = TRUE; - parameterChanged(param_type, param->data.get(), TRUE, false); + *param->in_use = TRUE; + parameterChanged(param_type, param->data, TRUE, false); return true; } else @@ -5827,31 +5825,37 @@ bool LLViewerObject::unpackParameterEntry(U16 param_type, LLDataPacker *dp) LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 param_type) { LLNetworkData* new_block = NULL; + bool* in_use = NULL; switch (param_type) { case LLNetworkData::PARAMS_FLEXIBLE: { - new_block = new LLFlexibleObjectData(); + new_block = &mFlexibleObjectData; + in_use = &mFlexibleObjectDataInUse; break; } case LLNetworkData::PARAMS_LIGHT: { - new_block = new LLLightParams(); + new_block = &mLightParams; + in_use = &mLightParamsInUse; break; } case LLNetworkData::PARAMS_SCULPT: { - new_block = new LLSculptParams(); + new_block = &mSculptParams; + in_use = &mSculptParamsInUse; break; } case LLNetworkData::PARAMS_LIGHT_IMAGE: { - new_block = new LLLightImageParams(); + new_block = &mLightImageParams; + in_use = &mLightImageParamsInUse; break; } case LLNetworkData::PARAMS_EXTENDED_MESH: { - new_block = new LLExtendedMeshParams(); + new_block = &mExtendedMeshParams; + in_use = &mExtendedMeshParamsInUse; break; } default: @@ -5861,70 +5865,33 @@ LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 para } }; + ExtraParameter& entry = mExtraParameterList[U32(param_type >> 4) - 1]; if (new_block) { - ExtraParameter* new_entry = new ExtraParameter; - new_entry->data = decltype(new_entry->data)(new_block); - new_entry->in_use = false; // not in use yet - mExtraParameterList[(param_type >> 4) - 1].reset(new_entry); - return new_entry; + entry.in_use = in_use; + *entry.in_use = false; // not in use yet + entry.data = new_block; + return &entry; + } + else + { + entry.is_invalid = true; } return NULL; } -LLViewerObject::ExtraParameter* LLViewerObject::getExtraParameterEntry(U16 param_type) const -{ - return param_type <= LLNetworkData::PARAMS_MAX ? mExtraParameterList[(param_type >> 4) - 1].get() : nullptr; -} - -LLViewerObject::ExtraParameter* LLViewerObject::getExtraParameterEntryCreate(U16 param_type) -{ - ExtraParameter* param = getExtraParameterEntry(param_type); - if (!param) - { - param = createNewParameterEntry(param_type); - } - return param; -} - -LLNetworkData* LLViewerObject::getParameterEntry(U16 param_type) const -{ - ExtraParameter* param = getExtraParameterEntry(param_type); - if (param) - { - return param->data.get(); - } - else - { - return NULL; - } -} - -BOOL LLViewerObject::getParameterEntryInUse(U16 param_type) const -{ - ExtraParameter* param = getExtraParameterEntry(param_type); - if (param) - { - return param->in_use; - } - else - { - return FALSE; - } -} - bool LLViewerObject::setParameterEntry(U16 param_type, const LLNetworkData& new_value, bool local_origin) { ExtraParameter* param = getExtraParameterEntryCreate(param_type); if (param) { - if (param->in_use && new_value == *(param->data)) + if (*(param->in_use) && new_value == *(param->data)) { return false; } - param->in_use = true; + *param->in_use = true; param->data->copy(new_value); - parameterChanged(param_type, param->data.get(), TRUE, local_origin); + parameterChanged(param_type, param->data, TRUE, local_origin); return true; } else @@ -5938,22 +5905,28 @@ bool LLViewerObject::setParameterEntry(U16 param_type, const LLNetworkData& new_ // Should always return true. bool LLViewerObject::setParameterEntryInUse(U16 param_type, BOOL in_use, bool local_origin) { - ExtraParameter* param = getExtraParameterEntryCreate(param_type); - if (param && param->in_use != in_use) + if (param_type <= LLNetworkData::PARAMS_MAX) { - param->in_use = in_use; - parameterChanged(param_type, param->data.get(), in_use, local_origin); - return true; + ExtraParameter* param = (in_use ? getExtraParameterEntryCreate(param_type) : &getExtraParameterEntry(param_type)); + if (param && param->data && *param->in_use != (bool)in_use) + { + *param->in_use = in_use; + parameterChanged(param_type, param->data, in_use, local_origin); + return true; + } } return false; } void LLViewerObject::parameterChanged(U16 param_type, bool local_origin) { - ExtraParameter* param = getExtraParameterEntry(param_type); - if (param) + if (param_type <= LLNetworkData::PARAMS_MAX) { - parameterChanged(param_type, param->data.get(), param->in_use, local_origin); + const ExtraParameter& param = getExtraParameterEntry(param_type); + if (param.data) + { + parameterChanged(param_type, param.data, *param.in_use, local_origin); + } } } diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index ef4031e92..a7fc3e140 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -123,13 +123,24 @@ class LLViewerObject protected: ~LLViewerObject(); // use unref() - // TomY: Provide for a list of extra parameter structures, mapped by structure name +private: struct ExtraParameter { - BOOL in_use; - std::unique_ptr data; + bool is_invalid = false; + bool* in_use = nullptr; + LLNetworkData* data = nullptr; }; - std::vector > mExtraParameterList; + std::vector mExtraParameterList; + bool mFlexibleObjectDataInUse = false; + bool mLightParamsInUse = false; + bool mSculptParamsInUse = false; + bool mLightImageParamsInUse = false; + bool mExtendedMeshParamsInUse = false; + LLFlexibleObjectData mFlexibleObjectData; + LLLightParams mLightParams; + LLSculptParams mSculptParams; + LLLightImageParams mLightImageParams; + LLExtendedMeshParams mExtendedMeshParams; public: typedef std::list > child_list_t; @@ -587,10 +598,15 @@ public: virtual void dirtySpatialGroup(BOOL priority = FALSE) const; virtual void dirtyMesh(); - virtual LLNetworkData* getParameterEntry(U16 param_type) const; - virtual bool setParameterEntry(U16 param_type, const LLNetworkData& new_value, bool local_origin); - virtual BOOL getParameterEntryInUse(U16 param_type) const; - virtual bool setParameterEntryInUse(U16 param_type, BOOL in_use, bool local_origin); + const LLFlexibleObjectData* getFlexibleObjectData() const { return mFlexibleObjectDataInUse ? &mFlexibleObjectData : nullptr; } + const LLLightParams* getLightParams() const { return mLightParamsInUse ? &mLightParams : nullptr; } + const LLSculptParams* getSculptParams() const { return mSculptParamsInUse ? &mSculptParams : nullptr; } + const LLLightImageParams* getLightImageParams() const { return mLightImageParamsInUse ? &mLightImageParams : nullptr; } + const LLExtendedMeshParams* getExtendedMeshParams() const { return mExtendedMeshParamsInUse ? &mExtendedMeshParams : nullptr; } + + bool setParameterEntry(U16 param_type, const LLNetworkData& new_value, bool local_origin); + bool setParameterEntryInUse(U16 param_type, BOOL in_use, bool local_origin); + // Called when a parameter is changed virtual void parameterChanged(U16 param_type, bool local_origin); virtual void parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_use, bool local_origin); @@ -617,9 +633,32 @@ public: private: ExtraParameter* createNewParameterEntry(U16 param_type); - ExtraParameter* getExtraParameterEntry(U16 param_type) const; - ExtraParameter* getExtraParameterEntryCreate(U16 param_type); - bool unpackParameterEntry(U16 param_type, LLDataPacker *dp); + const ExtraParameter& getExtraParameterEntry(U16 param_type) const + { + return mExtraParameterList[U32(param_type >> 4) - 1]; + } + ExtraParameter& getExtraParameterEntry(U16 param_type) + { + return mExtraParameterList[U32(param_type >> 4) - 1]; + } + ExtraParameter* getExtraParameterEntryCreate(U16 param_type) + { + if (param_type <= LLNetworkData::PARAMS_MAX) + { + ExtraParameter& param = getExtraParameterEntry(param_type); + if (!param.is_invalid) + { + if (!param.data) + { + ExtraParameter* new_entry = createNewParameterEntry(param_type); + return new_entry; + } + return ¶m; + } + } + return nullptr; + } + bool unpackParameterEntry(U16 param_type, LLDataPacker* dp); // This function checks to see if the given media URL has changed its version // and the update wasn't due to this agent's last action. diff --git a/indra/newview/llviewerobjectbackup.cpp b/indra/newview/llviewerobjectbackup.cpp index 292a4cae1..c5b1566fd 100644 --- a/indra/newview/llviewerobjectbackup.cpp +++ b/indra/newview/llviewerobjectbackup.cpp @@ -525,8 +525,7 @@ bool LLObjectBackup::validateNode(LLSelectNode* node) } else { - LLSculptParams* params; - params = (LLSculptParams*)obj->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams* params = obj->getSculptParams(); LLUUID sculpt_id = params->getSculptTexture(); return validateTexturePerms(sculpt_id); } @@ -871,23 +870,24 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, if (object->isFlexible()) { // Flexible - LLFlexibleObjectData* flex; - flex = (LLFlexibleObjectData*)object->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); - prim_llsd["flexible"] = flex->asLLSD(); + const LLFlexibleObjectData* flex = object->getFlexibleObjectData(); + if (flex) + { + prim_llsd["flexible"] = flex->asLLSD(); + } } - if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT)) + const LLLightParams* light = object->getLightParams(); + if (light) { // Light - LLLightParams* light; - light = (LLLightParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT); prim_llsd["light"] = light->asLLSD(); } - if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) + + const LLLightImageParams* light_param = object->getLightImageParams(); + if (light_param) { // Light image - LLLightImageParams* light_param; - light_param = (LLLightImageParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); t_id = validateTextureID(light_param->getLightTexture()); if (mTexturesList.count(t_id) == 0) { @@ -898,11 +898,10 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, prim_llsd["light_texture"] = light_param->asLLSD(); } - if (object->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT)) + const LLSculptParams* sculpt = object->getSculptParams(); + if (sculpt) { // Sculpt - LLSculptParams* sculpt; - sculpt = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); prim_llsd["sculpt"] = sculpt->asLLSD(); if ((sculpt->getSculptType() & LL_SCULPT_TYPE_MASK) != LL_SCULPT_TYPE_MESH) { diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 82d4cef61..9d19ca427 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -601,6 +601,7 @@ LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id, LLViewerFetchedTexture *LLViewerTextureList::findImage(const LLUUID &image_id) { + // Singu note: Reworked hotspot auto& iter = mUUIDDict.find(image_id); if(iter == mUUIDDict.end()) return NULL; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3ad3c2565..c02c090e7 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -333,7 +333,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, U8 sculpt_type = 0; if (isSculpted()) { - LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = getSculptParams(); sculpt_id = sculpt_params->getSculptTexture(); sculpt_type = sculpt_params->getSculptType(); } @@ -850,7 +850,7 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) if (getLightTextureID().notNull()) { - LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); + const LLLightImageParams* params = getLightImageParams(); LLUUID id = params->getLightTexture(); mLightTexture = LLViewerTextureManager::getFetchedTexture(id); if (mLightTexture.notNull()) @@ -996,7 +996,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, TRUE, false); if (!mVolumeImpl) { - LLFlexibleObjectData* data = (LLFlexibleObjectData*)getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); + LLFlexibleObjectData* data = (LLFlexibleObjectData*)getFlexibleObjectData(); mVolumeImpl = new LLVolumeImplFlexible(this, data); } } @@ -1100,7 +1100,7 @@ void LLVOVolume::updateSculptTexture() if (isSculpted() && !isMesh()) { - LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = getSculptParams(); LLUUID id = sculpt_params->getSculptTexture(); if (id.notNull()) { @@ -2946,7 +2946,7 @@ void LLVOVolume::setLightTextureID(LLUUID id) { setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, TRUE, true); } - LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); + LLLightImageParams* param_block = (LLLightImageParams*)getLightImageParams(); if (param_block && param_block->getLightTexture() != id) { param_block->setLightTexture(id); @@ -2966,7 +2966,7 @@ void LLVOVolume::setLightTextureID(LLUUID id) void LLVOVolume::setSpotLightParams(LLVector3 params) { - LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); + LLLightImageParams* param_block = (LLLightImageParams*)getLightImageParams(); if (param_block && param_block->getParams() != params) { param_block->setParams(params); @@ -3003,7 +3003,7 @@ void LLVOVolume::setIsLight(BOOL is_light) void LLVOVolume::setLightColor(const LLColor3& color) { - LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + LLLightParams *param_block = (LLLightParams *)getLightParams(); if (param_block) { if (param_block->getColor() != color) @@ -3018,7 +3018,7 @@ void LLVOVolume::setLightColor(const LLColor3& color) void LLVOVolume::setLightIntensity(F32 intensity) { - LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + LLLightParams *param_block = (LLLightParams *)getLightParams(); if (param_block) { if (param_block->getColor().mV[3] != intensity) @@ -3031,7 +3031,7 @@ void LLVOVolume::setLightIntensity(F32 intensity) void LLVOVolume::setLightRadius(F32 radius) { - LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + LLLightParams *param_block = (LLLightParams *)getLightParams(); if (param_block) { if (param_block->getRadius() != radius) @@ -3044,7 +3044,7 @@ void LLVOVolume::setLightRadius(F32 radius) void LLVOVolume::setLightFalloff(F32 falloff) { - LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + LLLightParams *param_block = (LLLightParams *)getLightParams(); if (param_block) { if (param_block->getFalloff() != falloff) @@ -3057,7 +3057,7 @@ void LLVOVolume::setLightFalloff(F32 falloff) void LLVOVolume::setLightCutoff(F32 cutoff) { - LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + LLLightParams *param_block = (LLLightParams *)getLightParams(); if (param_block) { if (param_block->getCutoff() != cutoff) @@ -3072,12 +3072,12 @@ void LLVOVolume::setLightCutoff(F32 cutoff) BOOL LLVOVolume::getIsLight() const { - return getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT); + return getLightParams() != nullptr; } LLColor3 LLVOVolume::getLightBaseColor() const { - const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + const LLLightParams *param_block = getLightParams(); if (param_block) { return LLColor3(param_block->getColor()); @@ -3090,7 +3090,7 @@ LLColor3 LLVOVolume::getLightBaseColor() const LLColor3 LLVOVolume::getLightColor() const { - const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + const LLLightParams *param_block = getLightParams(); if (param_block) { return LLColor3(param_block->getColor()) * param_block->getColor().mV[3]; @@ -3103,13 +3103,10 @@ LLColor3 LLVOVolume::getLightColor() const LLUUID LLVOVolume::getLightTextureID() const { - if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) + const LLLightImageParams *param_block = getLightImageParams(); + if (param_block) { - const LLLightImageParams *param_block = (const LLLightImageParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - if (param_block) - { - return param_block->getLightTexture(); - } + return param_block->getLightTexture(); } return LLUUID::null; @@ -3118,13 +3115,10 @@ LLUUID LLVOVolume::getLightTextureID() const LLVector3 LLVOVolume::getSpotLightParams() const { - if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) + const LLLightImageParams *param_block = getLightImageParams(); + if (param_block) { - const LLLightImageParams *param_block = (const LLLightImageParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - if (param_block) - { - return param_block->getParams(); - } + return param_block->getParams(); } return LLVector3(); @@ -3161,8 +3155,8 @@ void LLVOVolume::updateSpotLightPriority() bool LLVOVolume::isLightSpotlight() const { - LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - if (params && getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) + const LLLightImageParams* params = getLightImageParams(); + if (params) { return params->isLightSpotlight(); } @@ -3191,7 +3185,7 @@ LLViewerTexture* LLVOVolume::getLightTexture() F32 LLVOVolume::getLightIntensity() const { - const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + const LLLightParams *param_block = getLightParams(); if (param_block) { return param_block->getColor().mV[3]; @@ -3204,7 +3198,7 @@ F32 LLVOVolume::getLightIntensity() const F32 LLVOVolume::getLightRadius() const { - const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + const LLLightParams *param_block = getLightParams(); if (param_block) { return param_block->getRadius(); @@ -3217,7 +3211,7 @@ F32 LLVOVolume::getLightRadius() const F32 LLVOVolume::getLightFalloff() const { - const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + const LLLightParams *param_block = getLightParams(); if (param_block) { return param_block->getFalloff(); @@ -3230,7 +3224,7 @@ F32 LLVOVolume::getLightFalloff() const F32 LLVOVolume::getLightCutoff() const { - const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT); + const LLLightParams *param_block = getLightParams(); if (param_block) { return param_block->getCutoff(); @@ -3253,7 +3247,7 @@ U32 LLVOVolume::getVolumeInterfaceID() const BOOL LLVOVolume::isFlexible() const { - if (getParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE)) + if (getFlexibleObjectData()) { LLVolume* volume = getVolume(); if (volume && volume->getParams().getPathParams().getCurveType() != LL_PCODE_PATH_FLEXIBLE) @@ -3272,7 +3266,7 @@ BOOL LLVOVolume::isFlexible() const BOOL LLVOVolume::isSculpted() const { - if (getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT)) + if (getSculptParams()) { return TRUE; } @@ -3284,7 +3278,7 @@ BOOL LLVOVolume::isMesh() const { if (isSculpted()) { - LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = getSculptParams(); U8 sculpt_type = sculpt_params->getSculptType(); if ((sculpt_type & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) @@ -3299,7 +3293,7 @@ BOOL LLVOVolume::isMesh() const BOOL LLVOVolume::hasLightTexture() const { - if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) + if (getLightImageParams()) { return TRUE; } @@ -3393,8 +3387,7 @@ BOOL LLVOVolume::isRiggedMesh() const //---------------------------------------------------------------------------- U32 LLVOVolume::getExtendedMeshFlags() const { - const LLExtendedMeshParams *param_block = - (const LLExtendedMeshParams *)getParameterEntry(LLNetworkData::PARAMS_EXTENDED_MESH); + const LLExtendedMeshParams *param_block = getExtendedMeshParams(); if (param_block) { return param_block->getFlags(); @@ -3439,8 +3432,7 @@ void LLVOVolume::setExtendedMeshFlags(U32 flags) { bool in_use = true; setParameterEntryInUse(LLNetworkData::PARAMS_EXTENDED_MESH, in_use, true); - LLExtendedMeshParams *param_block = - (LLExtendedMeshParams *)getParameterEntry(LLNetworkData::PARAMS_EXTENDED_MESH); + LLExtendedMeshParams *param_block = (LLExtendedMeshParams *)getExtendedMeshParams(); if (param_block) { param_block->setFlags(flags); @@ -3762,7 +3754,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const } else { - const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT); + const LLSculptParams *sculpt_params = getSculptParams(); LLUUID sculpt_id = sculpt_params->getSculptTexture(); if (textures.find(sculpt_id) == textures.end()) { From f09b828217719208c56c0cd57bcc77f3b9ec6f3d Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 7 Aug 2019 23:02:34 -0500 Subject: [PATCH 5/9] Use wgl shared context lists to avoid re-creating gl context from scratch. --- indra/llwindow/llwindow.h | 2 +- indra/llwindow/llwindowheadless.h | 2 +- indra/llwindow/llwindowmacosx.cpp | 2 +- indra/llwindow/llwindowmacosx.h | 2 +- indra/llwindow/llwindowmesaheadless.h | 2 +- indra/llwindow/llwindowsdl.cpp | 4 +- indra/llwindow/llwindowsdl.h | 2 +- indra/llwindow/llwindowwin32.cpp | 42 ++++++++++++++------ indra/llwindow/llwindowwin32.h | 2 +- indra/newview/llviewerwindow.cpp | 57 ++++++++++++++++----------- indra/newview/llviewerwindow.h | 4 +- indra/newview/pipeline.cpp | 16 ++++++++ indra/newview/pipeline.h | 1 + 13 files changed, 91 insertions(+), 47 deletions(-) diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 857524b34..2305b69e1 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -84,7 +84,7 @@ public: BOOL setSize(LLCoordScreen size); BOOL setSize(LLCoordWindow size); virtual void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true); - virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = NULL) = 0; + virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function stopFn, std::function restoreFn, const LLCoordScreen * const posp = NULL) = 0; virtual BOOL setCursorPosition(LLCoordWindow position) = 0; virtual BOOL getCursorPosition(LLCoordWindow *position) = 0; virtual void showCursor() = 0; diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index ae3cd90f2..0364c5340 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -48,7 +48,7 @@ public: /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;}; /*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;}; /*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;}; - /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = NULL) {return FALSE;}; + /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function stopFn, std::function restoreFn, const LLCoordScreen * const posp = NULL) {return FALSE;}; /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;}; /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;}; /*virtual*/ void showCursor() {}; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index dcde667e3..9be125958 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -659,7 +659,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits // We only support OS X 10.7's fullscreen app mode which is literally a full screen window that fills a virtual desktop. // This makes this method obsolete. -BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp) +BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function stopFn, std::function restoreFn, const LLCoordScreen * const posp) { return FALSE; } diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 292af641a..581a44563 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -61,7 +61,7 @@ public: /*virtual*/ BOOL setPosition(LLCoordScreen position); /*virtual*/ BOOL setSizeImpl(LLCoordScreen size); /*virtual*/ BOOL setSizeImpl(LLCoordWindow size); - /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = nullptr); + /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function stopFn, std::function restoreFn, const LLCoordScreen * const posp = nullptr); /*virtual*/ BOOL setCursorPosition(LLCoordWindow position); /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position); /*virtual*/ void showCursor(); diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index e85c27f87..e11622576 100644 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -51,7 +51,7 @@ public: /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;}; /*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;}; /*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;}; - /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = NULL) {return FALSE;}; + /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function stopFn, std::function restoreFn, const LLCoordScreen * const posp = NULL) {return FALSE;}; /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;}; /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;}; /*virtual*/ void showCursor() {}; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 2c02cd143..79c8f8420 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -734,7 +734,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B // changing fullscreen resolution, or switching between windowed and fullscreen mode. -BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp) +BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function stopFn, std::function restoreFn, const LLCoordScreen * const posp) { const BOOL needsRebuild = TRUE; // Just nuke the context and start over. BOOL result = true; @@ -743,6 +743,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, cons stop_glerror(); if(needsRebuild) { + if (stopFn) stopFn(); destroyContext(); result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, vsync_mode); if (result) @@ -751,6 +752,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, cons initCursors(); setCursor( UI_CURSOR_ARROW ); } + if (restoreFn) restoreFn(true); } stop_glerror(); diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 9a80856c5..311782180 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -65,7 +65,7 @@ public: /*virtual*/ BOOL setPosition(LLCoordScreen position); /*virtual*/ BOOL setSizeImpl(LLCoordScreen size); /*virtual*/ BOOL setSizeImpl(LLCoordWindow size); - /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = NULL); + /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function stopFn, std::function restoreFn, const LLCoordScreen * const posp = NULL); /*virtual*/ BOOL setCursorPosition(LLCoordWindow position); /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position); /*virtual*/ void showCursor(); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 219eb282c..ded2d827a 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -677,7 +677,8 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, initDPIAwareness(); - if (!switchContext(mFullscreen, windowSize, vsync_mode, &windowPos)) + + if (!switchContext(mFullscreen, windowSize, vsync_mode, nullptr, nullptr, &windowPos)) { return; } @@ -956,7 +957,7 @@ BOOL LLWindowWin32::setSizeImpl(const LLCoordWindow size) } // changing fullscreen resolution -BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp) +BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function stopFn, std::function restoreFn, const LLCoordScreen * const posp) { GLuint pixel_format; DEVMODE dev_mode; @@ -986,20 +987,25 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co } gGLManager.shutdownGL(); - //destroy gl context + class ContextHandle + { + public: + ContextHandle(HGLRC context) : mOldContext(context) + {} + ~ContextHandle() + { + wglDeleteContext(mOldContext); + } + operator HGLRC() const { return mOldContext; } + private: + HGLRC mOldContext; + } oldContext = mhRC; if (mhRC) { if (!wglMakeCurrent(NULL, NULL)) { LL_WARNS("Window") << "Release of DC and RC failed" << LL_ENDL; } - - if (!wglDeleteContext(mhRC)) - { - LL_WARNS("Window") << "Release of rendering context failed" << LL_ENDL; - } - - mhRC = NULL; } if (fullscreen) @@ -1509,6 +1515,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co } mhRC = 0; + bool sharedContext = false; if (wglCreateContextAttribsARB) { //attempt to create a specific versioned context S32 attribs[] = @@ -1523,8 +1530,11 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co bool done = false; while (!done) { - mhRC = wglCreateContextAttribsARB(mhDC, mhRC, attribs); - + sharedContext = oldContext && (mhRC = wglCreateContextAttribsARB(mhDC, oldContext, attribs)) != nullptr; + if (!sharedContext) + { + mhRC = wglCreateContextAttribsARB(mhDC, nullptr, attribs); + } if (!mhRC) { if (attribs[3] > 0) @@ -1555,7 +1565,11 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co } } - if (!mhRC && !(mhRC = wglCreateContext(mhDC))) + bool abort = !mhRC && !(mhRC = wglCreateContext(mhDC)); + + if (!sharedContext && stopFn) stopFn(); + + if (abort) { close(); OSMessageBox(mCallbacks->translateString("MBGLContextErr"), mCallbacks->translateString("MBError"), OSMB_OK); @@ -1626,6 +1640,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co glGetIntegerv(GL_SAMPLES, &buf); LL_INFOS() << "Acquired FSAA Samples = " << buf << LL_ENDL; + if(restoreFn) restoreFn(!sharedContext); + return TRUE; } diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 02466adde..63c31a4d5 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -57,7 +57,7 @@ public: /*virtual*/ BOOL setPosition(LLCoordScreen position); /*virtual*/ BOOL setSizeImpl(LLCoordScreen size); /*virtual*/ BOOL setSizeImpl(LLCoordWindow size); - /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = NULL); + /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function stopFn, std::function restoreFn, const LLCoordScreen * const posp = NULL); /*virtual*/ BOOL setCursorPosition(LLCoordWindow position); /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position); /*virtual*/ void showCursor(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d505395c2..5854038ab 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -5395,26 +5395,39 @@ void LLViewerWindow::stopGL(BOOL save_state) } } -void LLViewerWindow::restoreGL(const std::string& progress_message) +void LLViewerWindow::restoreGLState() +{ + gGL.init(); + stop_glerror(); + initGLDefaults(); + stop_glerror(); + gGL.refreshState(); //Singu Note: Call immediately. Cached states may have prevented initGLDefaults from actually applying changes. + stop_glerror(); + LLGLStateValidator::restoreGL(); + stop_glerror(); +} + +void LLViewerWindow::restoreGL(bool full_restore, const std::string& progress_message) { //Note: --bao //if not necessary, do not change the order of the function calls in this function. //if change something, make sure it will not break anything. //especially, be careful to put something before gTextureList.restoreGL(); + if (!gGLManager.mIsDisabled && !full_restore) + { + LL_INFOS() << "Restoring GL state..." << LL_ENDL; + restoreGLState(); + gPipeline.releaseOcclusionBuffers(); // Occlusion handles must be invalidated + return; + } if (gGLManager.mIsDisabled) { stop_glerror(); LL_INFOS() << "Restoring GL..." << LL_ENDL; gGLManager.mIsDisabled = FALSE; - gGL.init(); - stop_glerror(); - initGLDefaults(); - stop_glerror(); - gGL.refreshState(); //Singu Note: Call immediately. Cached states may have prevented initGLDefaults from actually applying changes. - stop_glerror(); - LLGLStateValidator::restoreGL(); - stop_glerror(); + restoreGLState(); + gTextureList.restoreGL(); stop_glerror(); @@ -5617,11 +5630,11 @@ void LLViewerWindow::restartDisplay(BOOL show_progress_bar) stopGL(); if (show_progress_bar) { - restoreGL(LLTrans::getString("ProgressChangingResolution")); + restoreGL(true, LLTrans::getString("ProgressChangingResolution")); } else { - restoreGL(); + restoreGL(true); } } @@ -5669,7 +5682,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus(); send_agent_pause(); LL_INFOS() << "Stopping GL during changeDisplaySettings" << LL_ENDL; - stopGL(); + //stopGL(); mIgnoreActivate = TRUE; LLCoordScreen old_size; LLCoordScreen old_pos; @@ -5695,12 +5708,18 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, mWindow->setFSAASamples(fsaa); mWindow->setVsyncMode(vsync_mode); - result_first_try = mWindow->switchContext(fullscreen, size, vsync_mode, &new_pos); + auto stopfn = [this]() { this->stopGL(); }; + auto restoreFn = [this, show_progress_bar](bool full_restore) { + LL_INFOS() << "Restoring GL during resolution change" << LL_ENDL; + this->restoreGL(full_restore, show_progress_bar ? LLTrans::getString("ProgressChangingResolution") : ""); + }; + + result_first_try = mWindow->switchContext(fullscreen, size, vsync_mode, stopfn, restoreFn, &new_pos); if (!result_first_try) { // try to switch back mWindow->setFSAASamples(old_fsaa); - result_second_try = mWindow->switchContext(old_fullscreen, old_size, vsync_mode, &new_pos); + result_second_try = mWindow->switchContext(old_fullscreen, old_size, vsync_mode, stopfn, restoreFn, &new_pos); if (!result_second_try) { @@ -5712,16 +5731,6 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, } send_agent_resume(); - LL_INFOS() << "Restoring GL during resolution change" << LL_ENDL; - if (show_progress_bar) - { - restoreGL(LLTrans::getString("ProgressChangingResolution")); - } - else - { - restoreGL(); - } - if (!result_first_try) { LLSD args; diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index f444081a5..c47efb95c 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -414,11 +414,11 @@ private: bool shouldShowToolTipFor(LLMouseHandler *mh); static bool onAlert(const LLSD& notify); - void switchToolByMask(MASK mask); void destroyWindow(); void drawMouselookInstructions(); void stopGL(BOOL save_state = TRUE); - void restoreGL(const std::string& progress_message = LLStringUtil::null); + void restoreGLState(); + void restoreGL(bool full_restore, const std::string& progress_message = LLStringUtil::null); void initFonts(F32 zoom_factor = 1.f); void schedulePick(LLPickInfo& pick_info); S32 getChatConsoleBottomPad(); // Vertical padding for child console rect, varied by bottom clutter diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index fd8e2b686..2fc5c822f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -978,6 +978,22 @@ void LLPipeline::refreshCachedSettings() && gGLManager.mHasOcclusionQuery) ? 2 : 0; } +void LLPipeline::releaseOcclusionBuffers() +{ + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* region = *iter; + for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) + { + LLSpatialPartition* part = region->getSpatialPartition(i); + if (part) + { + part->resetVertexBuffers(); + } + } + } +} void LLPipeline::releaseVertexBuffers() { mCubeVB = NULL; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 701053a35..09d438b83 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -117,6 +117,7 @@ public: void resetVertexBuffers(); void doResetVertexBuffers(bool forced = false); void resizeScreenTexture(); + void releaseOcclusionBuffers(); void releaseVertexBuffers(); void releaseGLBuffers(); void releaseLUTBuffers(); From 767bdc1a308c0558e11457dce9aa1e26fa1eda30 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 8 Aug 2019 13:48:13 -0500 Subject: [PATCH 6/9] Make linux happier? --- indra/llcharacter/llkeyframemotion.h | 37 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h index 1db66a50d..6ada179ce 100644 --- a/indra/llcharacter/llkeyframemotion.h +++ b/indra/llcharacter/llkeyframemotion.h @@ -171,6 +171,22 @@ int AICachedPointerPtr::sCnt; //----------------------------------------------------------------------------- // class LLKeyframeMotion //----------------------------------------------------------------------------- + +namespace LLKeyframeMotionLerp +{ + template + T lerp(F32 t, const T& before, const T& after) + { + return ::lerp(before, after, t); + } + + template<> + LLQuaternion lerp(F32 t, const LLQuaternion& before, const LLQuaternion& after) + { + return ::nlerp(t, before, after); + } +} + class LLKeyframeMotion : public LLMotion { @@ -387,21 +403,6 @@ public: enum InterpolationType { IT_STEP, IT_LINEAR, IT_SPLINE }; - template - struct lerp_op { - static T lerp(F32 t, const T& before, const T& after) - { - return ::lerp(before, after, t); - } - }; - template<> - struct lerp_op { - static LLQuaternion lerp(F32 t, const LLQuaternion& before, const LLQuaternion& after) - { - return ::nlerp(t, before, after); - } - }; - template struct Curve { @@ -422,7 +423,7 @@ public: default: case IT_LINEAR: case IT_SPLINE: - return lerp_op::lerp(u, before.mValue, after.mValue); + return LLKeyframeMotionLerp::lerp(u, before.mValue, after.mValue); } } @@ -434,7 +435,7 @@ public: } T value; - key_map_t::iterator right = std::lower_bound(mKeys.begin(), mKeys.end(), time, [](const auto& a, const auto& b) { return a.first < b; }); + typename key_map_t::iterator right = std::lower_bound(mKeys.begin(), mKeys.end(), time, [](const auto& a, const auto& b) { return a.first < b; }); if (right == mKeys.end()) { // Past last key @@ -449,7 +450,7 @@ public: else { // Between two keys - key_map_t::iterator left = right; --left; + typename key_map_t::iterator left = right; --left; F32 index_before = left->first; F32 index_after = right->first; Key& pos_before = left->second; From a9c165f8a410ce32ac3635bdb4ac968551ef97d7 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 9 Aug 2019 23:49:16 -0500 Subject: [PATCH 7/9] These should be inline now that they arent member functions. --- indra/llcharacter/llkeyframemotion.h | 4 ++-- indra/newview/llhudnametag.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h index 6ada179ce..62273b719 100644 --- a/indra/llcharacter/llkeyframemotion.h +++ b/indra/llcharacter/llkeyframemotion.h @@ -175,13 +175,13 @@ int AICachedPointerPtr::sCnt; namespace LLKeyframeMotionLerp { template - T lerp(F32 t, const T& before, const T& after) + inline T lerp(F32 t, const T& before, const T& after) { return ::lerp(before, after, t); } template<> - LLQuaternion lerp(F32 t, const LLQuaternion& before, const LLQuaternion& after) + inline LLQuaternion lerp(F32 t, const LLQuaternion& before, const LLQuaternion& after) { return ::nlerp(t, before, after); } diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index d57ae3006..3d712439a 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -1056,6 +1056,7 @@ void LLHUDNameTag::reshape() F32 LLHUDNameTag::LLHUDTextSegment::getWidth(const LLFontGL* font) { + // Singu note: Reworked hotspot. Less indirection if (mFontWidthMap[0].first == font) { return mFontWidthMap[0].second; From 4f72de8289638f7b0e4c4b0abaedb5c4930bb379 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 10 Aug 2019 01:12:01 -0500 Subject: [PATCH 8/9] Make gcc happy with closer to standards compliant code.. --- indra/llcharacter/llkeyframemotion.h | 2 +- indra/llcommon/llindexedvector.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h index 62273b719..82244465b 100644 --- a/indra/llcharacter/llkeyframemotion.h +++ b/indra/llcharacter/llkeyframemotion.h @@ -183,7 +183,7 @@ namespace LLKeyframeMotionLerp template<> inline LLQuaternion lerp(F32 t, const LLQuaternion& before, const LLQuaternion& after) { - return ::nlerp(t, before, after); + return nlerp(t, before, after); } } diff --git a/indra/llcommon/llindexedvector.h b/indra/llcommon/llindexedvector.h index aa950eeb5..a1c388aa4 100644 --- a/indra/llcommon/llindexedvector.h +++ b/indra/llcommon/llindexedvector.h @@ -79,7 +79,7 @@ public: return std::find_if(mVector.begin(), mVector.end(), [&k](const typename vec_type_t::value_type& e) { return e.first == k; }); } - typedef DeletePairedPointer DeletePointer; + using DeletePointer = ::DeletePairedPointer; }; template @@ -189,7 +189,7 @@ public: } } - typedef DeletePointer DeletePointer; + using DeletePointer = ::DeletePointer; }; template From 5c156a9d86e5ae17d25f9ad889397b8e2fb19064 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sun, 11 Aug 2019 20:37:00 -0500 Subject: [PATCH 9/9] Added ll(Start/Stop)ObjectAnimation lsl function awareness --- indra/lscript/lscript_library/lscript_library.cpp | 2 ++ indra/newview/app_settings/dictionaries/en_sl.dic | 2 ++ indra/newview/app_settings/lsl_functions_sl.xml | 4 ++++ indra/newview/skins/default/xui/en-us/strings.xml | 8 ++++++++ 4 files changed, 16 insertions(+) diff --git a/indra/lscript/lscript_library/lscript_library.cpp b/indra/lscript/lscript_library/lscript_library.cpp index 5da6890f4..2a9292dff 100644 --- a/indra/lscript/lscript_library/lscript_library.cpp +++ b/indra/lscript/lscript_library/lscript_library.cpp @@ -199,6 +199,8 @@ void LLScriptLibrary::init() addFunction(10.f, 0.f, dummy_func, "llStringLength", "i", "s"); addFunction(10.f, 0.f, dummy_func, "llStartAnimation", NULL, "s"); addFunction(10.f, 0.f, dummy_func, "llStopAnimation", NULL, "s"); + addFunction(10.f, 0.f, dummy_func, "llStartObjectAnimation", NULL, "s"); + addFunction(10.f, 0.f, dummy_func, "llStopObjectAnimation", NULL, "s"); addFunction(10.f, 0.f, dummy_func, "llPointAt", NULL, "v"); addFunction(10.f, 0.f, dummy_func, "llStopPointAt", NULL, NULL); addFunction(10.f, 0.f, dummy_func, "llTargetOmega", NULL, "vff"); diff --git a/indra/newview/app_settings/dictionaries/en_sl.dic b/indra/newview/app_settings/dictionaries/en_sl.dic index 0f25bd233..c2ab72088 100644 --- a/indra/newview/app_settings/dictionaries/en_sl.dic +++ b/indra/newview/app_settings/dictionaries/en_sl.dic @@ -730,6 +730,8 @@ llRotLookAt llStringLength llStartAnimation llStopAnimation +llStartObjectAnimation +llStopObjectAnimation llPointAt llStopPointAt llTargetOmega diff --git a/indra/newview/app_settings/lsl_functions_sl.xml b/indra/newview/app_settings/lsl_functions_sl.xml index 8780e774c..7799b74a4 100644 --- a/indra/newview/app_settings/lsl_functions_sl.xml +++ b/indra/newview/app_settings/lsl_functions_sl.xml @@ -305,6 +305,10 @@ llStopAnimation + llStartObjectAnimation + + llStopObjectAnimation + llPointAt llStopPointAt diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index 8378aa8e8..d4378a093 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -957,6 +957,14 @@ Starts animation anim for agent that granted PERMISSION_TRIGGER_ANIMATION if the llStopAnimation(string anim) Stops animation anim for agent that granted permission + +llStartObjectAnimation(string anim) +Start animation for the current object + + +llStopObjectAnimation(string anim) +Stop an animation for the current object + llPointAt(vector pos) Makes agent that owns object point at pos