summaryrefslogtreecommitdiff
path: root/indra/llprimitive/lltextureentry.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-23 01:18:07 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-03-23 06:15:09 +0200
commitd423263d54fc72cf857f3e147ac3860ca16c652f (patch)
treeeecbc4369a16d93387551c319f226457960ab1f1 /indra/llprimitive/lltextureentry.cpp
parent02091a04969a423c2b28f7532a09fb3956619d67 (diff)
SL-19169 Local material updates aren't applied with non-default transforms
Diffstat (limited to 'indra/llprimitive/lltextureentry.cpp')
-rw-r--r--indra/llprimitive/lltextureentry.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp
index 49f67918f8..a665db378b 100644
--- a/indra/llprimitive/lltextureentry.cpp
+++ b/indra/llprimitive/lltextureentry.cpp
@@ -112,7 +112,15 @@ LLTextureEntry &LLTextureEntry::operator=(const LLTextureEntry &rhs)
mMaterialID = rhs.mMaterialID;
+ if (mGLTFMaterial)
+ {
+ mGLTFMaterial->removeTextureEntry(this);
+ }
mGLTFMaterial = rhs.mGLTFMaterial;
+ if (mGLTFMaterial)
+ {
+ mGLTFMaterial->addTextureEntry(this);
+ }
if (rhs.mGLTFMaterialOverrides.notNull())
{
@@ -155,6 +163,12 @@ LLTextureEntry::~LLTextureEntry()
delete mMediaEntry;
mMediaEntry = NULL;
}
+
+ if (mGLTFMaterial)
+ {
+ mGLTFMaterial->removeTextureEntry(this);
+ mGLTFMaterial = NULL;
+ }
}
bool LLTextureEntry::operator!=(const LLTextureEntry &rhs) const
@@ -524,7 +538,20 @@ void LLTextureEntry::setGLTFMaterial(LLGLTFMaterial* material, bool local_origin
// NOTE: if you're hitting this assert, try to make sure calling code is using LLViewerObject::setRenderMaterialID
llassert(!local_origin || getGLTFMaterialOverride() == nullptr || getGLTFMaterialOverride()->isClearedForBaseMaterial());
+ if (mGLTFMaterial)
+ {
+ // Local materials have to keep track
+ // due to update mechanics
+ mGLTFMaterial->removeTextureEntry(this);
+ }
+
mGLTFMaterial = material;
+
+ if (mGLTFMaterial)
+ {
+ mGLTFMaterial->addTextureEntry(this);
+ }
+
if (mGLTFMaterial == nullptr)
{
setGLTFRenderMaterial(nullptr);