summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexturelist.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-01-08 23:15:00 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-01-08 23:15:00 +0200
commitfe796dac711c7ecdc7d6d17e0b692abf468b754a (patch)
tree32750c8e5be3b21c2c8d6bf3cbc43eb012dba72a /indra/newview/llviewertexturelist.cpp
parent1cc91fac587ae0edf86d2dec42e2846e57bfafd0 (diff)
parent77395eddc911e0801e50fd693f7bbaee8046aa95 (diff)
Merge branch 'main' into DRTVWR-588-maint-W
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r--indra/newview/llviewertexturelist.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index de983a5060..fee825d121 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -898,6 +898,13 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
{
F32 vsize = face->getPixelArea();
+ // scale desired texture resolution higher or lower depending on texture scale
+ const LLTextureEntry* te = face->getTextureEntry();
+ F32 min_scale = te ? llmin(fabsf(te->getScaleS()), fabsf(te->getScaleT())) : 1.f;
+ min_scale = llmax(min_scale*min_scale, 0.1f);
+
+ vsize /= min_scale;
+
#if LL_DARWIN
vsize /= 1.f + LLViewerTexture::sDesiredDiscardBias*(1.f+face->getDrawable()->mDistanceWRTCamera*bias_distance_scale);
#else
@@ -915,7 +922,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
// if a GLTF material is present, ignore that face
// as far as this texture stats go, but update the GLTF material
// stats
- const LLTextureEntry* te = face->getTextureEntry();
LLFetchedGLTFMaterial* mat = te ? (LLFetchedGLTFMaterial*)te->getGLTFRenderMaterial() : nullptr;
llassert(mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(te->getGLTFRenderMaterial()) != nullptr);
if (mat)