Skip to content

Commit 203ef2f

Browse files
committed
#3364 Decrement bias only if there is 10prcnt free space
Instead of when there is any space.
1 parent 4ff1cbf commit 203ef2f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

indra/newview/llviewertexture.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,13 @@ void LLViewerTexture::updateClass()
556556
// don't execute above until the slam to 1.5 has a chance to take effect
557557
sEvaluationTimer.reset();
558558

559-
// lower discard bias over time when free memory is available
560-
if (sDesiredDiscardBias > 1.f && over_pct < 0.f)
559+
// lower discard bias over time when at least 10% of budget is free
560+
const F32 FREE_PERCENTAGE_TRESHOLD = -0.1f;
561+
if (sDesiredDiscardBias > 1.f && over_pct < FREE_PERCENTAGE_TRESHOLD)
561562
{
562563
static LLCachedControl<F32> high_mem_discard_decrement(gSavedSettings, "RenderHighMemMinDiscardDecrement", .1f);
563564

564-
F32 decrement = high_mem_discard_decrement - llmin(over_pct, 0.f);
565+
F32 decrement = high_mem_discard_decrement - llmin(over_pct - FREE_PERCENTAGE_TRESHOLD, 0.f);
565566
sDesiredDiscardBias -= decrement * gFrameIntervalSeconds;
566567
}
567568
}

0 commit comments

Comments
 (0)