summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-11-07 18:02:34 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-11-07 18:07:09 +0200
commitc1180f1cc7370d2ff3acb37d6f6fac08f500661b (patch)
treea0e9ac6127513a6895d5a176029ab4ca478aa72e /indra/newview/llselectmgr.cpp
parent172366121aef566a11464d82968776dcf0a836d4 (diff)
SL-18583 Fix race condition when setting multiple faces
And fix cases of updates not applying
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--indra/newview/llselectmgr.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index e4a67d7982..52b35d5158 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -1812,6 +1812,14 @@ void LLObjectSelection::applyNoCopyPbrMaterialToTEs(LLViewerInventoryItem* item)
// apply texture for the selected faces
//add(LLStatViewer::EDIT_TEXTURE, 1);
object->setRenderMaterialID(te, asset_id, false /*will be sent later*/);
+
+ // blank out any override data on the server
+ LLCoros::instance().launch("modifyMaterialCoro",
+ std::bind(&LLGLTFMaterialList::modifyMaterialCoro,
+ gAgent.getRegionCapability("ModifyMaterialParams"),
+ llsd::map(
+ "object_id", object->getID(),
+ "side", te), nullptr));
}
}
}
@@ -1948,7 +1956,15 @@ void LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
objectp->setParameterEntryInUse(LLNetworkData::PARAMS_RENDER_MATERIAL, TRUE, false /*prevent an update*/);
}
- objectp->setRenderMaterialID(te, asset_id);
+ objectp->setRenderMaterialID(te, asset_id, false /*prevent an update to prevent a race condition*/);
+
+ // blank out any override data on the server
+ LLCoros::instance().launch("modifyMaterialCoro",
+ std::bind(&LLGLTFMaterialList::modifyMaterialCoro,
+ gAgent.getRegionCapability("ModifyMaterialParams"),
+ llsd::map(
+ "object_id", objectp->getID(),
+ "side", te), nullptr));
return true;
}
@@ -1978,6 +1994,8 @@ void LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
LLRenderMaterialParams* param_block = (LLRenderMaterialParams*)object->getParameterEntry(LLNetworkData::PARAMS_RENDER_MATERIAL);
if (param_block)
{
+ // To not cause multiple competing request that modify
+ // same param field send update only once per object
if (param_block->isEmpty())
{
object->setHasRenderMaterialParams(false);