diff --git a/indra/newview/lllocalgltfmaterials.cpp b/indra/newview/lllocalgltfmaterials.cpp index d464ea05715e3aea58cc54b7d290a3f1115cc852..b7fdead3f9ff11c17ed6e9db38cc715d4ccb8910 100644 --- a/indra/newview/lllocalgltfmaterials.cpp +++ b/indra/newview/lllocalgltfmaterials.cpp @@ -179,6 +179,7 @@ bool LLLocalGLTFMaterial::updateSelf() LLFetchedGLTFMaterial* render_mat = (LLFetchedGLTFMaterial*)entry->getGLTFRenderMaterial(); if (render_mat) { + llassert(dynamic_cast<LLFetchedGLTFMaterial*>(entry->getGLTFRenderMaterial()) != nullptr); *render_mat = *this; render_mat->applyOverride(*override_mat); } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 6c3855004954d80a7083737258d8524faf21118f..0dd1ff5483eaefbb9404d3e12364228f8ce0bc95 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -573,6 +573,7 @@ void LLFloaterTexturePicker::draw() if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) { mGLTFMaterial = (LLFetchedGLTFMaterial*) gGLTFMaterialList.getMaterial(mImageAssetID); + llassert(mGLTFMaterial == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(gGLTFMaterialList.getMaterial(mImageAssetID)) != nullptr); } else { diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e641ac4215a019e487c9e827854361f3dfbf8b15..100c73377fadf0b0be4f0581baead25f64588a84 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4957,10 +4957,12 @@ void LLViewerObject::updateTEMaterialTextures(U8 te) } LLFetchedGLTFMaterial* mat = (LLFetchedGLTFMaterial*) getTE(te)->getGLTFRenderMaterial(); + llassert(mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(getTE(te)->getGLTFRenderMaterial()) != nullptr); LLUUID mat_id = getRenderMaterialID(te); if (mat == nullptr && mat_id.notNull()) { mat = (LLFetchedGLTFMaterial*) gGLTFMaterialList.getMaterial(mat_id); + llassert(mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(gGLTFMaterialList.getMaterial(mat_id)) != nullptr); if (mat->isFetching()) { // material is not loaded yet, rebuild draw info when the object finishes loading mat->onMaterialComplete([id=getID()] @@ -5383,7 +5385,7 @@ S32 LLViewerObject::setTEGLTFMaterialOverride(U8 te, LLGLTFMaterial* override_ma } LLFetchedGLTFMaterial* src_mat = (LLFetchedGLTFMaterial*) tep->getGLTFMaterial(); - + llassert(src_mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(tep->getGLTFMaterial()) != nullptr); // if override mat exists, we must also have a source mat if (!src_mat) { diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 1449844588dcff32119abe53359d12152de28a03..d4c5e5535e5e9df669acbb62a942db2c6427c608 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -914,6 +914,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag // stats const LLTextureEntry* te = face->getTextureEntry(); LLFetchedGLTFMaterial* mat = te ? (LLFetchedGLTFMaterial*)te->getGLTFRenderMaterial() : nullptr; + llassert(mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(te->getGLTFRenderMaterial()) != nullptr); if (mat) { touch_texture(mat->mBaseColorTexture, vsize); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 77849c668a74cb8fdc1dc62a871786ac3966313f..9a5719d8b68f6974a5bee2e407467f9de7cca680 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5291,6 +5291,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, LLUUID mat_id; auto* gltf_mat = (LLFetchedGLTFMaterial*) facep->getTextureEntry()->getGLTFRenderMaterial(); + llassert(gltf_mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(facep->getTextureEntry()->getGLTFRenderMaterial()) != nullptr); if (gltf_mat != nullptr) { mat_id = gltf_mat->getHash(); // TODO: cache this hash