From 1120a7ccb91223df91aa92b1354dfe2c3b65a577 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 5 Dec 2024 11:52:03 -0800 Subject: #3210 Fix for "Texture will be downscaled" happening too often. (#3212) --- indra/newview/llviewertexturelist.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewertexturelist.cpp') 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(); } -- cgit v1.2.3