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.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 0847c29d0d..4c3901408f 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -674,7 +674,22 @@ public: typedef std::vector instance_list; instance_list mInstanceList; - typedef std::map, instance_list> instance_map; + // Upload should happen in deterministic order, so sort instances by model name. + struct LLUploadModelInstanceLess + { + inline bool operator()(const LLPointer& a, const LLPointer& b) const + { + if (a.isNull() || b.isNull()) + { + llassert(false); // We are uploading these models, they shouldn't be null. + return true; + } + // Note: probably can sort by mBaseModel->mSubmodelID here as well to avoid + // running over the list twice in wholeModelToLLSD. + return a->mLabel < b->mLabel; + } + }; + typedef std::map, instance_list, LLUploadModelInstanceLess> instance_map; instance_map mInstance; LLMutex* mMutex; -- cgit v1.2.3