diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 46ef9a5ac8935b5c0a90bb917697e1ca96add900..1de302c283c21dbc758f6e4f19ab2e266cba06c1 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10360,29 +10360,35 @@ void LLVOAvatar::updateRiggingInfo() getAssociatedVolumes(volumes); } - std::map<LLUUID,S32> curr_rigging_info_key; - { - LL_RECORD_BLOCK_TIME(FTM_AVATAR_RIGGING_KEY_UPDATE); - // Get current rigging info key - for (LLVOVolume* vol : volumes) - { - if (vol->isRiggedMesh() && vol->getVolume() && vol->getVolume()->isMeshAssetLoaded()) - { - const LLUUID& mesh_id = vol->getVolume()->getParams().getSculptID(); - S32 max_lod = llmax(vol->getLOD(), vol->mLastRiggingInfoLOD); - curr_rigging_info_key[mesh_id] = max_lod; - } - } - - // Check for key change, which indicates some change in volume composition or LOD. - if (curr_rigging_info_key == mLastRiggingInfoKey) - { - return; - } - } + size_t rig_hash; + size_t rig_count; + { + LL_RECORD_BLOCK_TIME(FTM_AVATAR_RIGGING_KEY_UPDATE); + + // Get current rigging info key + rigging_info_hash_vec_t curr_rigging_info_key; + curr_rigging_info_key.reserve(mLastRiggingInfoMeshCount); + for (LLVOVolume *vol : volumes) + { + if (vol->isRiggedMesh() && vol->getVolume() && vol->getVolume()->isMeshAssetLoaded()) + { + const LLUUID& mesh_id = vol->getVolume()->getParams().getSculptID(); + S32 max_lod = llmax(vol->getLOD(), vol->mLastRiggingInfoLOD); + curr_rigging_info_key.emplace_back(mesh_id, max_lod); + } + } + rig_count =curr_rigging_info_key.size(); + rig_hash = absl::Hash<rigging_info_hash_vec_t>{}(curr_rigging_info_key); + // Check for key change, which indicates some change in volume composition or LOD. + if (rig_hash == mLastRiggingInfoKeyHash) + { + return; + } + } // Something changed. Update. - mLastRiggingInfoKey = std::move(curr_rigging_info_key); + mLastRiggingInfoKeyHash = rig_hash; + mLastRiggingInfoMeshCount = rig_count; mJointRiggingInfoTab.clear(); for (LLVOVolume* vol : volumes) { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 110138a004671cea39c92f24f5914f4d8c097b8b..3fd1975e9d2ccf39671a0e5f90c997260a5c52c6 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -225,7 +225,9 @@ class LLVOAvatar : // virtual void updateRiggingInfo(); // This encodes mesh id and LOD, so we can see whether display is up-to-date. - std::map<LLUUID,S32> mLastRiggingInfoKey; + using rigging_info_hash_vec_t = std::vector<std::pair<LLUUID, S32>>; + size_t mLastRiggingInfoKeyHash = 0; + size_t mLastRiggingInfoMeshCount = 0; std::set<LLUUID> mActiveOverrideMeshes; virtual void onActiveOverrideMeshesChanged();