summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-06-27 13:36:15 -0500
committerRunitaiLinden <davep@lindenlab.com>2023-06-27 13:36:15 -0500
commit74a9bf4f1ef1b865f4fe980eaf7451422147f116 (patch)
tree557a4314f55372ee67fce5f1c1507954a1a0fe9f /indra
parent8032aa20c8c421da6996a92ffb2f567256e23b66 (diff)
parent77ea8eedb8dab989043fed4d7db6938a8c6cf54d (diff)
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llvocache.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 7081ecaa4b..a4070a513c 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -105,7 +105,7 @@ bool LLGLTFOverrideCacheEntry::fromLLSD(const LLSD& data)
std::string error, warn;
if (override_mat->fromJSON(gltf_json_str, warn, error))
{
- mGLTFMaterial[i] = override_mat;
+ mGLTFMaterial[side_idx] = override_mat;
}
else
{
@@ -126,6 +126,16 @@ bool LLGLTFOverrideCacheEntry::fromLLSD(const LLSD& data)
LL_WARNS_IF(sides.size() != 0, "GLTF") << "broken override cache entry" << LL_ENDL;
}
}
+
+ llassert(mSides.size() == mGLTFMaterial.size());
+#ifdef SHOW_ASSERT
+ for (auto const & side : mSides)
+ {
+ // check that mSides and mGLTFMaterial have exactly the same keys present
+ llassert(mGLTFMaterial.count(side.first) == 1);
+ }
+#endif
+
return true;
}
@@ -141,8 +151,11 @@ LLSD LLGLTFOverrideCacheEntry::toLLSD() const
data["object_id"] = mObjectId;
data["local_id"] = (LLSD::Integer) mLocalId;
+ llassert(mSides.size() == mGLTFMaterial.size());
for (auto const & side : mSides)
{
+ // check that mSides and mGLTFMaterial have exactly the same keys present
+ llassert(mGLTFMaterial.count(side.first) == 1);
data["sides"].append(LLSD::Integer(side.first));
data["gltf_json"].append(side.second);
}