From c299c8038e73e541cafe3c8df135752cb48b903c Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Fri, 29 May 2026 05:29:27 -0400 Subject: Add watermark driven discards. Does a much better job of staying within the memory budget. --- indra/llprimitive/lltextureentry.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/llprimitive/lltextureentry.cpp') diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index ac482ffbf9..5296e86a69 100644 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -356,6 +356,7 @@ S32 LLTextureEntry::setScale(F32 s, F32 t) { mScaleS = s; mScaleT = t; + mMinScaleSq = -1.f; // invalidate cache for getMinScaleSq() retval = TEM_CHANGE_TEXTURE; } @@ -368,6 +369,7 @@ S32 LLTextureEntry::setScaleS(F32 s) if (mScaleS != s) { mScaleS = s; + mMinScaleSq = -1.f; // invalidate cache for getMinScaleSq() retval = TEM_CHANGE_TEXTURE; } return retval; @@ -379,11 +381,22 @@ S32 LLTextureEntry::setScaleT(F32 t) if (mScaleT != t) { mScaleT = t; + mMinScaleSq = -1.f; // invalidate cache for getMinScaleSq() retval = TEM_CHANGE_TEXTURE; } return retval; } +F32 LLTextureEntry::getMinScaleSq() const +{ + if (mMinScaleSq < 0.f) + { + F32 m = llmin(fabsf(mScaleS), fabsf(mScaleT)); + mMinScaleSq = m * m; + } + return mMinScaleSq; +} + S32 LLTextureEntry::setColor(const LLColor4 &color) { if (mColor != color) @@ -600,7 +613,7 @@ LLGLTFMaterial* LLTextureEntry::getGLTFRenderMaterial() const return mGLTFRenderMaterial; } - llassert(getGLTFMaterialOverride() == nullptr || getGLTFMaterialOverride()->isClearedForBaseMaterial()); + //llassert(getGLTFMaterialOverride() == nullptr || getGLTFMaterialOverride()->isClearedForBaseMaterial()); return getGLTFMaterial(); } -- cgit v1.3