#2467 Fix for sim surrounds not fully loading (#2524)

Also fixes some sculpts getting wrong LoD
master
Dave Parks 2024-09-06 16:39:58 -05:00 committed by GitHub
parent a861e86398
commit 1f754e5090
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 15 deletions

View File

@ -1553,6 +1553,17 @@ void LLViewerFetchedTexture::postCreateTexture()
setActive();
// rebuild any volumes that are using this texture for sculpts in case their LoD has changed
for (U32 i = 0; i < mNumVolumes[LLRender::SCULPT_TEX]; ++i)
{
LLVOVolume* volume = mVolumeList[LLRender::SCULPT_TEX][i];
if (volume)
{
volume->mSculptChanged = true;
gPipeline.markRebuild(volume->mDrawable);
}
}
if (!needsToSaveRawImage())
{
mNeedsAux = false;
@ -2647,7 +2658,7 @@ void LLViewerFetchedTexture::destroyRawImage()
if (mAuxRawImage.notNull() && !needsToSaveRawImage())
{
sAuxCount--;
mAuxRawImage = NULL;
mAuxRawImage = nullptr;
}
if (mRawImage.notNull())
@ -2662,7 +2673,7 @@ void LLViewerFetchedTexture::destroyRawImage()
}
}
mRawImage = NULL;
mRawImage = nullptr;
mIsRawImageValid = false;
mRawDiscardLevel = INVALID_DISCARD_LEVEL;
@ -2774,7 +2785,9 @@ void LLViewerFetchedTexture::readbackRawImage()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
if (mGLTexturep.notNull() && mGLTexturep->getTexName() != 0 && mRawImage.isNull())
// readback the raw image from vram if the current raw image is null or smaller than the texture
if (mGLTexturep.notNull() && mGLTexturep->getTexName() != 0 &&
(mRawImage.isNull() || mRawImage->getWidth() < mGLTexturep->getWidth() || mRawImage->getHeight() < mGLTexturep->getHeight() ))
{
mRawImage = new LLImageRaw();
if (!mGLTexturep->readBackRaw(-1, mRawImage, false))

View File

@ -1149,7 +1149,7 @@ void LLVOVolume::updateSculptTexture()
{
mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, true, LLGLTexture::BOOST_SCULPTED, LLViewerTexture::LOD_TEXTURE);
mSculptTexture->forceToSaveRawImage(0, F32_MAX);
mSculptTexture->addTextureStats(256.f*256.f);
mSculptTexture->setKnownDrawSize(256, 256);
}
mSkinInfoUnavaliable = false;
@ -1251,7 +1251,7 @@ void LLVOVolume::sculpt()
discard_level = mSculptTexture->getSavedRawImageLevel();
}
if (!raw_image)
if (!raw_image || raw_image->getWidth() < mSculptTexture->getWidth() || raw_image->getHeight() < mSculptTexture->getHeight())
{
// last resort, read back from GL
mSculptTexture->readbackRawImage();
@ -1338,17 +1338,8 @@ void LLVOVolume::sculpt()
mSculptTexture->updateBindStatsForTester() ;
}
}
getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level, mSculptTexture->isMissingAsset());
//notify rebuild any other VOVolumes that reference this sculpty volume
for (S32 i = 0; i < mSculptTexture->getNumVolumes(LLRender::SCULPT_TEX); ++i)
{
LLVOVolume* volume = (*(mSculptTexture->getVolumeList(LLRender::SCULPT_TEX)))[i];
if (volume != this && volume->getVolume() == getVolume())
{
gPipeline.markRebuild(volume->mDrawable, LLDrawable::REBUILD_GEOMETRY);
}
}
getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level, mSculptTexture->isMissingAsset());
}
}

View File

@ -451,6 +451,7 @@ public:
private:
friend class LLDrawable;
friend class LLFace;
friend class LLViewerFetchedTexture;
bool mFaceMappingChanged;
LLFrameTimer mTextureUpdateTimer;