From 5a0bbdc510d3aef452b30aa932588aa7dc630d22 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 2 Jul 2025 23:18:05 +0300 Subject: #4242 Debug dump improvement for better comparison with collada output --- indra/newview/llmeshrepository.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index e7e95034b2..9382ebb00b 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2740,7 +2740,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) mUploadSkin, mUploadJoints, mLockScaleIfJointPosition, - false, + LLModel::WRITE_BINARY, false, data.mBaseModel->mSubmodelID); @@ -2898,7 +2898,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) mUploadSkin, mUploadJoints, mLockScaleIfJointPosition, - false, + LLModel::WRITE_BINARY, false, data.mBaseModel->mSubmodelID); -- cgit v1.2.3 From 19ffeb6e2d6fe749070fe36facbfa3e3e8641364 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 9 Jul 2025 20:22:07 +0300 Subject: #4357 Crash in LLMeshRepoThread::lodReceived --- indra/newview/llmeshrepository.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 9382ebb00b..b5a1bbd534 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2395,6 +2395,11 @@ EMeshProcessingResult LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_p // might be good idea to turn mesh into pointer to avoid making a copy mesh.mVolume = NULL; } + { + // make sure skin info is not removed from list while we are decreasing reference count + LLMutexLock lock(mSkinMapMutex); + skin_info = nullptr; + } return MESH_OK; } } -- cgit v1.2.3 From 07d0fbe94e89d0509b64232858e384a439810bb8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 11 Jul 2025 22:40:43 +0300 Subject: #4294 Make upload order more deterministic to make root prim more deterministic instead of being random each try --- indra/newview/llmeshrepository.cpp | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index b5a1bbd534..6236df1a13 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2699,10 +2699,21 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) S32 instance_num = 0; - for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter) + // Upload should happen in deterministic order, so sort instances by model name. + // Note: probably can sort by mBaseModel->mSubmodelID here as well to avoid + // running over the list twice. + std::vector> sorted_instances(mInstance.begin(), mInstance.end()); + std::sort(sorted_instances.begin(), sorted_instances.end(), + [](const std::pair& a, const std::pair& b) + { + return a.first->mLabel < b.first->mLabel; + }); + + // Handle models, ignore submodels for now + for (auto& iter : sorted_instances) { LLMeshUploadData data; - data.mBaseModel = iter->first; + data.mBaseModel = iter.first; if (data.mBaseModel->mSubmodelID) { @@ -2711,7 +2722,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) continue; } - LLModelInstance& first_instance = *(iter->second.begin()); + LLModelInstance& first_instance = *(iter.second.begin()); for (S32 i = 0; i < 5; i++) { data.mModel[i] = first_instance.mLOD[i]; @@ -2758,8 +2769,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) } // For all instances that use this model - for (instance_list::iterator instance_iter = iter->second.begin(); - instance_iter != iter->second.end(); + for (instance_list::iterator instance_iter = iter.second.begin(); + instance_iter != iter.second.end(); ++instance_iter) { @@ -2857,10 +2868,11 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) } } - for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter) + // Now handle the submodels. + for (auto& iter : sorted_instances) { LLMeshUploadData data; - data.mBaseModel = iter->first; + data.mBaseModel = iter.first; if (!data.mBaseModel->mSubmodelID) { @@ -2869,7 +2881,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) continue; } - LLModelInstance& first_instance = *(iter->second.begin()); + LLModelInstance& first_instance = *(iter.second.begin()); for (S32 i = 0; i < 5; i++) { data.mModel[i] = first_instance.mLOD[i]; @@ -2916,8 +2928,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) } // For all instances that use this model - for (instance_list::iterator instance_iter = iter->second.begin(); - instance_iter != iter->second.end(); + for (instance_list::iterator instance_iter = iter.second.begin(); + instance_iter != iter.second.end(); ++instance_iter) { -- cgit v1.2.3 From 5a50be4e1554c6f96ff52fdbda5ba1c890d18a6d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 14 Jul 2025 18:47:03 +0300 Subject: #4294 Make upload order more deterministic #2 --- indra/newview/llmeshrepository.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 6236df1a13..142a3dac39 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2699,18 +2699,11 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) S32 instance_num = 0; - // Upload should happen in deterministic order, so sort instances by model name. - // Note: probably can sort by mBaseModel->mSubmodelID here as well to avoid - // running over the list twice. - std::vector> sorted_instances(mInstance.begin(), mInstance.end()); - std::sort(sorted_instances.begin(), sorted_instances.end(), - [](const std::pair& a, const std::pair& b) - { - return a.first->mLabel < b.first->mLabel; - }); - - // Handle models, ignore submodels for now - for (auto& iter : sorted_instances) + // Handle models, ignore submodels for now. + // Probably should pre-sort by mSubmodelID instead of running twice. + // Note: mInstance should be sorted by model name for the sake of + // deterministic order. + for (auto& iter : mInstance) { LLMeshUploadData data; data.mBaseModel = iter.first; @@ -2869,7 +2862,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) } // Now handle the submodels. - for (auto& iter : sorted_instances) + for (auto& iter : mInstance) { LLMeshUploadData data; data.mBaseModel = iter.first; -- cgit v1.2.3