From a12e38911e96deb71ce809c32edc7647a1a7536b Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Thu, 2 Oct 2025 02:26:29 +1000 Subject: [PATCH] Use llmin instead of llmax to correctly clamp mMaxDiscardLevel --- indra/llrender/llimagegl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 4f60946577..6a6eda37dc 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -644,7 +644,7 @@ bool LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve // [FIRE-35361] RenderMaxTextureResolution caps texture resolution lower than intended // 2K textures could set the mMaxDiscardLevel above MAX_DISCARD_LEVEL, which would // cause them to not be down-scaled so they would get stuck at 0 discard all the time. - mMaxDiscardLevel = llmax(mMaxDiscardLevel, (S8)MAX_DISCARD_LEVEL); + mMaxDiscardLevel = llmin(mMaxDiscardLevel, (S8)MAX_DISCARD_LEVEL); // [FIRE-35361] } }