#3364 Fix a case of excessive texture updates
when bias fluctuates a bit. Make bias' effect a bit more gradual.meow-7.2.2
parent
d2dd881a5c
commit
18e06771e5
|
|
@ -108,8 +108,9 @@ void LLDrawPoolTree::beginShadowPass(S32 pass)
|
|||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
|
||||
glPolygonOffset(gSavedSettings.getF32("RenderDeferredTreeShadowOffset"),
|
||||
gSavedSettings.getF32("RenderDeferredTreeShadowBias"));
|
||||
static LLCachedControl<F32> shadow_offset(gSavedSettings, "RenderDeferredTreeShadowOffset");
|
||||
static LLCachedControl<F32> shadow_bias(gSavedSettings, "RenderDeferredTreeShadowBias");
|
||||
glPolygonOffset(shadow_offset(), shadow_bias());
|
||||
|
||||
LLEnvironment& environment = LLEnvironment::instance();
|
||||
|
||||
|
|
|
|||
|
|
@ -519,7 +519,6 @@ void LLViewerTexture::updateClass()
|
|||
|
||||
bool is_sys_low = isSystemMemoryLow();
|
||||
bool is_low = is_sys_low || over_pct > 0.f;
|
||||
F32 discard_bias = sDesiredDiscardBias;
|
||||
|
||||
static bool was_low = false;
|
||||
static bool was_sys_low = false;
|
||||
|
|
@ -571,6 +570,7 @@ void LLViewerTexture::updateClass()
|
|||
|
||||
// set to max discard bias if the window has been backgrounded for a while
|
||||
static F32 last_desired_discard_bias = 1.f;
|
||||
static F32 last_texture_update_count_bias = 1.f;
|
||||
static bool was_backgrounded = false;
|
||||
static LLFrameTimer backgrounded_timer;
|
||||
static LLCachedControl<F32> minimized_discard_time(gSavedSettings, "TextureDiscardMinimizedTime", 1.f);
|
||||
|
|
@ -606,12 +606,21 @@ void LLViewerTexture::updateClass()
|
|||
}
|
||||
|
||||
sDesiredDiscardBias = llclamp(sDesiredDiscardBias, 1.f, 4.f);
|
||||
if (discard_bias != sDesiredDiscardBias)
|
||||
if (last_texture_update_count_bias < sDesiredDiscardBias)
|
||||
{
|
||||
// bias changed, reset texture update counter to
|
||||
// bias increased, reset texture update counter to
|
||||
// let updates happen at an increased rate.
|
||||
last_texture_update_count_bias = sDesiredDiscardBias;
|
||||
sBiasTexturesUpdated = 0;
|
||||
}
|
||||
else if (last_texture_update_count_bias > sDesiredDiscardBias + 0.1f)
|
||||
{
|
||||
// bias decreased, 0.1f is there to filter out small fluctuations
|
||||
// and not reset sBiasTexturesUpdated too often.
|
||||
// Bias jumps to 1.5 at low memory, so getting stuck at 1.1 is not
|
||||
// a problem.
|
||||
last_texture_update_count_bias = sDesiredDiscardBias;
|
||||
}
|
||||
|
||||
LLViewerTexture::sFreezeImageUpdates = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -958,7 +958,8 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
|
|||
vsize /= min_scale;
|
||||
|
||||
// apply bias to offscreen faces all the time, but only to onscreen faces when bias is large
|
||||
if (!face->mInFrustum || LLViewerTexture::sDesiredDiscardBias > 2.f)
|
||||
// use mImportanceToCamera to make bias switch a bit more gradual
|
||||
if (!face->mInFrustum || LLViewerTexture::sDesiredDiscardBias > 1.9f + face->mImportanceToCamera / 2.f)
|
||||
{
|
||||
vsize /= bias;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue