summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexturelist.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-01-08 21:33:06 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-01-08 21:33:06 +0200
commitafe91b7eb68da65687beef451bd094ff0091b717 (patch)
tree5bdb9e5b5a78a16a8c1362c33717a6931fb40458 /indra/newview/llviewertexturelist.cpp
parent6e6df8c31e09e6ba69156150ecd37cc4ac4ea0e6 (diff)
parent77395eddc911e0801e50fd693f7bbaee8046aa95 (diff)
Merge main (DRTVWR-596 GLTF Materials Maint) into DRTVWR-591-maint-X
# Conflicts: # indra/newview/VIEWER_VERSION.txt
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 0d074cb9d4..9c4240770c 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -896,6 +896,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
@@ -913,7 +920,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)