summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authormobserveur <mobserveur@gmail.com>2025-09-13 12:50:21 +0200
committermobserveur <mobserveur@gmail.com>2025-09-13 12:50:21 +0200
commit63921b5ac73c1366a7256d4ea3621f355104695d (patch)
treed7516b5cccd3654712758e78c069158d2dc47d09 /indra
parent067d83b640d3fae45098ef8bc71e913c1eb65a44 (diff)
back to using LLCachedControl in LLReflectionMapManager
This commit changes the gSavedSetting direct reading to using LLCachedControl in LLReflectionMapManager
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llreflectionmapmanager.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index 9b801a3065..c1a87c6310 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -223,11 +223,11 @@ void LLReflectionMapManager::update()
resume();
}
- S32 sDetail = gSavedSettings.getS32("RenderReflectionProbeDetail");
- S32 sLevel = gSavedSettings.getS32("RenderReflectionProbeLevel");
- U32 sReflectionProbeCount = gSavedSettings.getU32("RenderReflectionProbeCount");
- S32 sProbeDynamicAllocation = gSavedSettings.getS32("RenderReflectionProbeDynamicAllocation");
- F32 sProbeUpdateSlowDown = gSavedSettings.getF32("MPRenderProbeSlowDown");
+ static LLCachedControl<S32> sDetail(gSavedSettings, "RenderReflectionProbeDetail", 1);
+ static LLCachedControl<S32> sLevel(gSavedSettings, "RenderReflectionProbeLevel", 1);
+ static LLCachedControl<U32> sReflectionProbeCount(gSavedSettings, "RenderReflectionProbeCount", 8);
+ static LLCachedControl<S32> sProbeDynamicAllocation(gSavedSettings, "RenderReflectionProbeDynamicAllocation", -1);
+ static LLCachedControl<F32> sProbeUpdateSlowDown(gSavedSettings, "MPRenderProbeSlowDown", 0.0);
bool realtime = sDetail >= (S32)LLReflectionMapManager::DetailLevel::REALTIME;
@@ -292,12 +292,11 @@ void LLReflectionMapManager::update()
initReflectionMaps();
- bool render_hdr = gSavedSettings.getBOOL("RenderHDREnabled");
+ static LLCachedControl<bool> render_hdr(gSavedSettings, "RenderHDREnabled", false);
+ static LLCachedControl<U32> MPColorPrecision(gSavedSettings, "MPColorPrecision", 0);
U32 color_fmt = render_hdr ? GL_R11F_G11F_B10F : GL_RGB8;
- U32 MPColorPrecision = gSavedSettings.getU32("MPColorPrecision");
-
if(MPColorPrecision == 1)
{
color_fmt = GL_RGB8;
@@ -413,8 +412,7 @@ void LLReflectionMapManager::update()
mResetFade = llmin((F32)(mResetFade + gFrameIntervalSeconds * 2.f), 1.f);
- F32 sDefaultUpdatePeriod = gSavedSettings.getF32("RenderDefaultProbeUpdatePeriod");
- //F32 sMPUpdatePeriod = gSavedSettings.getF32("MPRenderProbeUpdatePeriod");
+ static LLCachedControl<F32> sDefaultUpdatePeriod(gSavedSettings, "RenderDefaultProbeUpdatePeriod", 4.0);
for (unsigned int i = 0; i < mProbes.size(); ++i)
{
@@ -799,7 +797,7 @@ void LLReflectionMapManager::doProbeUpdate()
if (isRadiancePass())
{
- F32 sMPUpdatePeriod = gSavedSettings.getF32("MPRenderProbeUpdatePeriod");
+ static LLCachedControl<F32> sMPUpdatePeriod(gSavedSettings, "MPRenderProbeUpdatePeriod", 2.0);
mUpdatingProbe->mComplete = true;
mUpdatingProbe->mCompletedCount++;
@@ -849,7 +847,8 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face)
gPipeline.mRT = &gPipeline.mAuxillaryRT;
mLightScale = 1.f;
- F32 max_local_light_ambiance = gSavedSettings.getF32("RenderReflectionProbeMaxLocalLightAmbiance");
+
+ static LLCachedControl<F32> max_local_light_ambiance(gSavedSettings, "RenderReflectionProbeMaxLocalLightAmbiance", 1.0);
if (!isRadiancePass() && probe->getAmbiance() > max_local_light_ambiance)
{
@@ -872,7 +871,7 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face)
}
else
{
- llassert(gSavedSettings.getS32("RenderReflectionProbeLevel") > 0); // should never update a probe that's not the default probe if reflection coverage is none
+ //llassert(gSavedSettings.getS32("RenderReflectionProbeLevel") > 0); // should never update a probe that's not the default probe if reflection coverage is none
probe->update(mRenderTarget.getWidth(), face);
}
@@ -1243,7 +1242,8 @@ void LLReflectionMapManager::updateUniforms()
LLEnvironment& environment = LLEnvironment::instance();
LLSettingsSky::ptr_t psky = environment.getCurrentSky();
- bool should_auto_adjust = gSavedSettings.getBOOL("RenderSkyAutoAdjustLegacy");
+ static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false);
+
F32 minimum_ambiance = psky->getReflectionProbeAmbiance(should_auto_adjust);
@@ -1560,8 +1560,9 @@ void LLReflectionMapManager::renderDebug()
void LLReflectionMapManager::initReflectionMaps()
{
- U32 ref_probe_res = gSavedSettings.getU32("RenderReflectionProbeResolution");
- U32 probe_resolution = nhpo2(llclamp(ref_probe_res, (U32)64, (U32)512));
+ static LLCachedControl<U32> ref_probe_res(gSavedSettings, "RenderReflectionProbeResolution", 128);
+
+ U32 probe_resolution = nhpo2(llclamp(ref_probe_res(), (U32)64, (U32)512));
bool shouldInit = mTexture.isNull() || mReflectionProbeCount != mDynamicProbeCount || mProbeResolution != probe_resolution || mReset;
@@ -1585,7 +1586,7 @@ void LLReflectionMapManager::initReflectionMaps()
mTexture->getWidth() != mProbeResolution ||
mReflectionProbeCount + 2 != mTexture->getCount())
{
- bool render_hdr = gSavedSettings.getBOOL("RenderHDREnabled");
+ static LLCachedControl<bool> render_hdr(gSavedSettings, "RenderHDREnabled", false);
if (mTexture)
{