diff options
| author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2026-05-29 05:29:27 -0400 |
|---|---|---|
| committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2026-05-29 05:29:27 -0400 |
| commit | c299c8038e73e541cafe3c8df135752cb48b903c (patch) | |
| tree | 288c2848f2f4da4bbf2c3acc500e5a29818700f9 /indra/llprimitive/lltextureentry.cpp | |
| parent | 375ade3df2930cdc6087e1b4e4c31851ed5be762 (diff) | |
Add watermark driven discards.
Does a much better job of staying within the memory budget.
Diffstat (limited to 'indra/llprimitive/lltextureentry.cpp')
| -rw-r--r-- | indra/llprimitive/lltextureentry.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
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(); } |
