summaryrefslogtreecommitdiff
path: root/indra/newview/lllocalbitmaps.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-11-02 00:33:39 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-11-06 18:29:42 +0200
commit52c60ab3fdb8617471eccd9df52cc126e0243e76 (patch)
tree7496136c8551ef61fd306f119c7cc6a77ca16a47 /indra/newview/lllocalbitmaps.cpp
parent3a5b678eba5d86acccb1a1f233f862d292258fac (diff)
SL-20523 Local textures not updating on PBR Materials #4
Diffstat (limited to 'indra/newview/lllocalbitmaps.cpp')
-rw-r--r--indra/newview/lllocalbitmaps.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 6775685a6a..cd5b2e262b 100644
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -134,7 +134,7 @@ LLLocalBitmap::~LLLocalBitmap()
for (LLPointer<LLGLTFMaterial> &mat : mGLTFMaterialWithLocalTextures)
{
- mat->removeLocalTextureTracking(getTrackingID(), getWorldID());
+ mat->removeLocalTextureTracking(getTrackingID());
}
mChangedSignal(getTrackingID(), getWorldID(), LLUUID());
@@ -289,12 +289,17 @@ boost::signals2::connection LLLocalBitmap::setChangedCallback(const LLLocalTextu
void LLLocalBitmap::addGLTFMaterial(LLGLTFMaterial* mat)
{
- if (mat
- // dupplicate prevention
- && mat->mLocalTextureTrackingIds.find(getTrackingID()) == mat->mLocalTextureTrackingIds.end())
+ if (!mat)
{
- mat->addLocalTextureTracking(getTrackingID(), getWorldID());
- mGLTFMaterialWithLocalTextures.push_back(mat);
+ return;
+ }
+ for (mat_list_t::value_type ptr : mGLTFMaterialWithLocalTextures)
+ {
+ if (ptr.get() != mat)
+ {
+ mat->addLocalTextureTracking(getTrackingID(), getWorldID());
+ mGLTFMaterialWithLocalTextures.push_back(mat);
+ }
}
}
@@ -612,7 +617,7 @@ void LLLocalBitmap::updateGLTFMaterials(LLUUID old_id, LLUUID new_id)
// Might be a better idea to hold this in LLGLTFMaterialList
for (mat_list_t::iterator it = mGLTFMaterialWithLocalTextures.begin(); it != mGLTFMaterialWithLocalTextures.end();)
{
- if ((*it)->replaceLocalTexture(old_id, new_id))
+ if ((*it)->replaceLocalTexture(mTrackingID, old_id, new_id))
{
for (LLTextureEntry* entry : (*it)->mTextureEntires)
{
@@ -642,8 +647,8 @@ void LLLocalBitmap::updateGLTFMaterials(LLUUID old_id, LLUUID new_id)
}
else
{
- // matching id not found, no longer in use
- (*it)->removeLocalTextureTracking(getTrackingID(), new_id);
+ // Matching id not found, no longer in use
+ // material would clean itself, remove from the list
it = mGLTFMaterialWithLocalTextures.erase(it);
}
}