summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexturelist.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2024-12-05 11:52:03 -0800
committerGitHub <noreply@github.com>2024-12-05 13:52:03 -0600
commit1120a7ccb91223df91aa92b1354dfe2c3b65a577 (patch)
treecffbc33c37f7f1ac7387ecd310de5d67dc787b62 /indra/newview/llviewertexturelist.cpp
parent396b97aebfb3294287a4a598f0be3900ccada69a (diff)
#3210 Fix for "Texture will be downscaled" happening too often. (#3212)
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r--indra/newview/llviewertexturelist.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index b44bedea50..0b79c2d8e0 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1066,13 +1066,26 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time)
{
LLViewerFetchedTexture* imagep = mCreateTextureList.front();
llassert(imagep->mCreatePending);
- imagep->createTexture();
+
+ // desired discard may change while an image is being decoded. If the texture in VRAM is sufficient
+ // for the current desired discard level, skip the texture creation. This happens more often than it probably
+ // should
+ bool redundant_load = imagep->hasGLTexture() && imagep->getDiscardLevel() <= imagep->getDesiredDiscardLevel();
+
+ if (!redundant_load)
+ {
+ imagep->createTexture();
+ }
+
imagep->postCreateTexture();
imagep->mCreatePending = false;
mCreateTextureList.pop();
if (imagep->hasGLTexture() && imagep->getDiscardLevel() < imagep->getDesiredDiscardLevel())
{
+ // NOTE: this may happen if the desired discard reduces while a decode is in progress and does not
+ // necessarily indicate a problem, but if log occurrences excede that of dsiplay_stats: FPS,
+ // something has probably gone wrong.
LL_WARNS_ONCE("Texture") << "Texture will be downscaled immediately after loading." << LL_ENDL;
imagep->scaleDown();
}