Skip to content

Commit

Permalink
#3187 Crash at LLTextureEntry::getGLTFRenderMaterial
Browse files Browse the repository at this point in the history
  • Loading branch information
akleshchev committed Jan 23, 2025
1 parent ad30637 commit c8c1d67
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions indra/newview/llvovolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5739,7 +5739,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
continue;
}

LLFetchedGLTFMaterial *gltf_mat = (LLFetchedGLTFMaterial*) facep->getTextureEntry()->getGLTFRenderMaterial();
LLFetchedGLTFMaterial* gltf_mat = nullptr;
const LLTextureEntry* te = facep->getTextureEntry();
if (te)
{
gltf_mat = (LLFetchedGLTFMaterial*)te->getGLTFRenderMaterial();
} // if not te, continue?
bool is_pbr = gltf_mat != nullptr;

if (is_pbr)
Expand Down Expand Up @@ -5801,10 +5806,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{
cur_total += facep->getGeomCount();

const LLTextureEntry* te = facep->getTextureEntry();
LLViewerTexture* tex = facep->getTexture();

if (te->getGlow() > 0.f)
if (te && te->getGlow() > 0.f)
{
emissive = true;
}
Expand Down Expand Up @@ -5899,6 +5903,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
facep->mLastUpdateTime = gFrameTimeSeconds;
}

if (te)
{
LLGLTFMaterial* gltf_mat = te->getGLTFRenderMaterial();

Expand Down Expand Up @@ -5963,6 +5968,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
add_face(sFullbrightFaces, fullbright_count, facep);
}
}
else // no texture entry
{
facep->setState(LLFace::FULLBRIGHT);
add_face(sFullbrightFaces, fullbright_count, facep);
}
}
}
else
Expand Down

0 comments on commit c8c1d67

Please sign in to comment.