summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-10-30 20:32:22 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-10-31 14:08:35 +0200
commit8dfc1d0447bae8afd1567abf85ecbec9b43790a0 (patch)
tree57c74be2de8ab0aa113610742a312690526999d7 /indra/newview/llviewertexture.cpp
parent4b5fa5349e06ce3471875e0c401f9119831ed887 (diff)
viewer#2653 LOD textures weren't taking callback discard into account
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r--indra/newview/llviewertexture.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 7feb807c62..82fefde0a7 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -1691,6 +1691,7 @@ void LLViewerFetchedTexture::processTextureStats()
if(mDesiredDiscardLevel > mMinDesiredDiscardLevel)//need to load more
{
mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel);
+ mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel);
mFullyLoaded = false;
}
//setDebugText("fully loaded");
@@ -1740,6 +1741,7 @@ void LLViewerFetchedTexture::processTextureStats()
log((F32)mFullHeight / mKnownDrawHeight) / log_2);
mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel());
mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel);
+ mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel);
}
mKnownDrawSizeChanged = false;
@@ -2464,6 +2466,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
if (mIsRawImageValid)
{
// If we have an existing raw image, we have a baseline for the raw and auxiliary quality levels.
+ current_raw_discard = mRawDiscardLevel;
best_raw_discard = llmin(best_raw_discard, mRawDiscardLevel);
best_aux_discard = llmin(best_aux_discard, mRawDiscardLevel); // We always decode the aux when we decode the base raw
current_aux_discard = llmin(current_aux_discard, best_aux_discard);
@@ -2922,10 +2925,12 @@ void LLViewerLODTexture::processTextureStats()
{
// If the image has not been significantly visible in a while, we don't want it
mDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel, (S8)(MAX_DISCARD_LEVEL + 1));
+ mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel);
}
else if (!mFullWidth || !mFullHeight)
{
mDesiredDiscardLevel = getMaxDiscardLevel();
+ mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel);
}
else
{
@@ -2995,6 +3000,7 @@ void LLViewerLODTexture::processTextureStats()
// stop requesting more
mDesiredDiscardLevel = current_discard;
}
+ mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel);
}
if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0)