summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2024-09-06 16:39:58 -0500
committerGitHub <noreply@github.com>2024-09-06 16:39:58 -0500
commit1f754e50908ba325c132b8d83383f7f0dbbdf793 (patch)
treeb43c0ac56fde2713a332eaa1f7f16c9595429e7c /indra/newview/llviewertexture.cpp
parenta861e86398e5d3fde9ffb388b2ccfc3624b3a5f7 (diff)
#2467 Fix for sim surrounds not fully loading (#2524)
Also fixes some sculpts getting wrong LoD
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r--indra/newview/llviewertexture.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 15b4a3aab3..99f8db00f2 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -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))