summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-04-21 16:59:29 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-04-22 12:39:42 +0300
commit87b6428f5537238c970cabbc30e057914935a50c (patch)
tree4e8a808b12d9b138204e1f58d45766615682a780
parent44bbdc549a9a530850ffbb02c06059517c37d82d (diff)
#3870 Added joint initialization for LLVOAvatarSelf
Sometimes mesh thread crashes when allocating joints
-rw-r--r--indra/newview/llmeshrepository.cpp1
-rw-r--r--indra/newview/llvoavatar.cpp10
-rw-r--r--indra/newview/llvoavatar.h1
-rw-r--r--indra/newview/llvoavatarself.cpp2
4 files changed, 14 insertions, 0 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 3724ec26df..663afe64a9 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -4549,6 +4549,7 @@ void LLMeshRepository::notifyLoadedMeshes()
if (mPendingRequests.size() > push_count)
{
+ LL_PROFILE_ZONE_NAMED("Mesh score_map");
// More requests than the high-water limit allows so
// sort and forward the most important.
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 3306289f51..d9a3ec3004 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -6375,6 +6375,16 @@ LLJoint *LLVOAvatar::getJoint( S32 joint_num )
return pJoint;
}
+void LLVOAvatar::initAllJoints()
+{
+ getJointAliases();
+ for (auto& alias : mJointAliasMap)
+ {
+ mJointMap[alias.first] = mRoot->findJoint(alias.second);
+ }
+ // ignore mScreen and mRoot
+}
+
//-----------------------------------------------------------------------------
// getRiggedMeshID
//
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index a2232d21a2..ab27c5752d 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -204,6 +204,7 @@ public:
virtual LLJoint* getJoint(const std::string &name);
LLJoint* getJoint(S32 num);
+ void initAllJoints();
//if you KNOW joint_num is a valid animated joint index, use getSkeletonJoint for efficiency
inline LLJoint* getSkeletonJoint(S32 joint_num) { return mSkeleton[joint_num]; }
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index f23af5afa4..90ff4067f2 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -225,6 +225,8 @@ void LLVOAvatarSelf::initInstance()
doPeriodically(update_avatar_rez_metrics, 5.0);
doPeriodically(boost::bind(&LLVOAvatarSelf::checkStuckAppearance, this), 30.0);
+ initAllJoints(); // mesh thread uses LLVOAvatarSelf as a joint source
+
mInitFlags |= 1<<2;
}