Skip to content

Commit 396b97a

Browse files
committed
viewer-private#330 Fix LLCachedControl for vintage
1 parent 0dccb32 commit 396b97a

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

indra/newview/llfloaterpreferencesgraphicsadvanced.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings()
321321
}
322322

323323
// Vintage mode
324-
LLCachedControl<bool> is_not_vintage(gSavedSettings, "RenderDisableVintageMode");
324+
static LLCachedControl<bool> is_not_vintage(gSavedSettings, "RenderDisableVintageMode");
325325
LLSliderCtrl* tonemapMix = getChild<LLSliderCtrl>("TonemapMix");
326326
LLComboBox* tonemapSelect = getChild<LLComboBox>("TonemapType");
327327
LLTextBox* tonemapLabel = getChild<LLTextBox>("TonemapTypeText");

indra/newview/llsettingsvo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ void LLSettingsVOSky::updateSettings()
671671
// After some A/B comparison of relesae vs EEP, tweak to allow strength to fall below 2
672672
// at night, for better match. (mSceneLightStrength is a divisor, so lower value means brighter
673673
// local lights)
674-
LLCachedControl<F32> sdr(gSavedSettings, "RenderSunDynamicRange", 1.f);
674+
static LLCachedControl<F32> sdr(gSavedSettings, "RenderSunDynamicRange", 1.f);
675675
F32 sun_dynamic_range = llmax(sdr(), 0.0001f);
676676
mSceneLightStrength = 2.0f * (0.75f + sun_dynamic_range * dp);
677677

indra/newview/llviewershadermgr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static bool make_rigged_variant(LLGLSLShader& shader, LLGLSLShader& riggedShader
258258

259259
static void add_common_permutations(LLGLSLShader* shader)
260260
{
261-
LLCachedControl<bool> emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false);
261+
static LLCachedControl<bool> emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false);
262262

263263
if (emissive)
264264
{
@@ -782,7 +782,7 @@ std::string LLViewerShaderMgr::loadBasicShaders()
782782
attribs["MAX_JOINTS_PER_MESH_OBJECT"] =
783783
std::to_string(LLSkinningUtil::getMaxJointCount());
784784

785-
LLCachedControl<bool> emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false);
785+
static LLCachedControl<bool> emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false);
786786

787787
if (emissive)
788788
{

indra/newview/pipeline.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,9 @@ bool addDeferredAttachments(LLRenderTarget& target, bool for_impostor = false)
349349
U32 norm = GL_RGBA16F;
350350
U32 emissive = GL_RGB16F;
351351

352-
bool hdr = gSavedSettings.getBOOL("RenderHDREnabled") && gGLManager.mGLVersion > 4.05f;
353-
LLCachedControl<bool> has_emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false);
352+
static LLCachedControl<bool> has_emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false);
353+
static LLCachedControl<bool> has_hdr(gSavedSettings, "RenderHDREnabled", true);
354+
bool hdr = has_hdr() && gGLManager.mGLVersion > 4.05f;
354355

355356
if (!hdr)
356357
{
@@ -803,7 +804,8 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY)
803804
{
804805
LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY;
805806

806-
bool hdr = gGLManager.mGLVersion > 4.05f && gSavedSettings.getBOOL("RenderHDREnabled");
807+
static LLCachedControl<bool> has_hdr(gSavedSettings, "RenderHDREnabled", true);
808+
bool hdr = gGLManager.mGLVersion > 4.05f && has_hdr();
807809

808810
if (mRT == &mMainRT)
809811
{ // hacky -- allocate auxillary buffer
@@ -7894,7 +7896,8 @@ void LLPipeline::renderFinalize()
78947896
gGL.setColorMask(true, true);
78957897
glClearColor(0, 0, 0, 0);
78967898

7897-
bool hdr = gGLManager.mGLVersion > 4.05f && gSavedSettings.getBOOL("RenderHDREnabled");
7899+
static LLCachedControl<bool> has_hdr(gSavedSettings, "RenderHDREnabled", true);
7900+
bool hdr = gGLManager.mGLVersion > 4.05f && has_hdr();
78987901

78997902
if (hdr)
79007903
{

0 commit comments

Comments
 (0)