diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-06-26 15:37:33 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2023-06-26 15:37:33 -0500 |
commit | 774c2d0f88c15b3de19345674e797321d625d1d8 (patch) | |
tree | beed87ce884ab2c551a5aed05817bf06052226d5 /indra/newview/llvovolume.cpp | |
parent | 21b67896e9d1d181f39b8e44b9efe2b4c153d22b (diff) | |
parent | e7df845cb7d8061356f611ec06de609aa6ba4298 (diff) |
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r-- | indra/newview/llvovolume.cpp | 63 |
1 files changed, 47 insertions, 16 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index de1d3fc012..08d2e99c40 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -230,7 +230,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mColorChanged = FALSE; mSpotLightPriority = 0.f; - mSkinInfoFailed = false; + mSkinInfoUnavaliable = false; mSkinInfo = NULL; mMediaImplList.resize(getNumTEs()); @@ -1134,7 +1134,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo if (mSkinInfo && mSkinInfo->mMeshID != volume_params.getSculptID()) { mSkinInfo = NULL; - mSkinInfoFailed = false; + mSkinInfoUnavaliable = false; } if (!getVolume()->isMeshAssetLoaded()) @@ -1147,13 +1147,24 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo } } - if (!mSkinInfo && !mSkinInfoFailed) + if (!mSkinInfo && !mSkinInfoUnavaliable) { - const LLMeshSkinInfo* skin_info = gMeshRepo.getSkinInfo(volume_params.getSculptID(), this); - if (skin_info) - { - notifySkinInfoLoaded(skin_info); - } + LLUUID mesh_id = volume_params.getSculptID(); + if (gMeshRepo.hasHeader(mesh_id) && !gMeshRepo.hasSkinInfo(mesh_id)) + { + // If header is present but has no data about skin, + // no point fetching + mSkinInfoUnavaliable = true; + } + + if (!mSkinInfoUnavaliable) + { + const LLMeshSkinInfo* skin_info = gMeshRepo.getSkinInfo(mesh_id, this); + if (skin_info) + { + notifySkinInfoLoaded(skin_info); + } + } } } else // otherwise is sculptie @@ -1188,7 +1199,7 @@ void LLVOVolume::updateSculptTexture() mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); } - mSkinInfoFailed = false; + mSkinInfoUnavaliable = false; mSkinInfo = NULL; } else @@ -1229,6 +1240,16 @@ void LLVOVolume::notifyMeshLoaded() mSculptChanged = TRUE; gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY); + if (!mSkinInfo && !mSkinInfoUnavaliable) + { + // Header was loaded, update skin info state from header + LLUUID mesh_id = getVolume()->getParams().getSculptID(); + if (!gMeshRepo.hasSkinInfo(mesh_id)) + { + mSkinInfoUnavaliable = true; + } + } + LLVOAvatar *av = getAvatar(); if (av && !isAnimatedObject()) { @@ -1246,7 +1267,7 @@ void LLVOVolume::notifyMeshLoaded() void LLVOVolume::notifySkinInfoLoaded(const LLMeshSkinInfo* skin) { - mSkinInfoFailed = false; + mSkinInfoUnavaliable = false; mSkinInfo = skin; notifyMeshLoaded(); @@ -1254,7 +1275,7 @@ void LLVOVolume::notifySkinInfoLoaded(const LLMeshSkinInfo* skin) void LLVOVolume::notifySkinInfoUnavailable() { - mSkinInfoFailed = true; + mSkinInfoUnavaliable = true; mSkinInfo = nullptr; } @@ -5596,11 +5617,21 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) std::string vobj_name = llformat("Vol%p", vobj); bool is_mesh = vobj->isMesh(); - if (is_mesh && - ((vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded()) || !gMeshRepo.meshRezEnabled())) - { - continue; - } + if (is_mesh) + { + if ((vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded()) + || !gMeshRepo.meshRezEnabled()) + { + // Waiting for asset to fetch + continue; + } + + if (!vobj->getSkinInfo() && !vobj->isSkinInfoUnavaliable()) + { + // Waiting for skin info to fetch + continue; + } + } LLVolume* volume = vobj->getVolume(); if (volume) |