From f4e30fdd1dcfee178086a18e49d28524fd4d18b9 Mon Sep 17 00:00:00 2001 From: Beq Date: Sat, 21 Jun 2025 18:50:42 +0100 Subject: [PATCH] [FIRE-35070] Update probe management loop --- indra/newview/llreflectionmapmanager.cpp | 28 +++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index e0d3318452..ac3e58a954 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -223,7 +223,7 @@ void LLReflectionMapManager::update() } static LLCachedControl sDetail(gSavedSettings, "RenderReflectionProbeDetail", -1); - static LLCachedControl sLevel(gSavedSettings, "RenderReflectionProbeLevel", 3); + // static LLCachedControl sLevel(gSavedSettings, "RenderReflectionProbeLevel", 3); // No longer required use the pipeline cached version instead static LLCachedControl sReflectionProbeCount(gSavedSettings, "RenderReflectionProbeCount", 256U); static LLCachedControl sProbeDynamicAllocation(gSavedSettings, "RenderReflectionProbeDynamicAllocation", -1); mResetFade = llmin((F32)(mResetFade + gFrameIntervalSeconds * 2.f), 1.f); @@ -232,15 +232,15 @@ void LLReflectionMapManager::update() U32 probe_count_temp = mDynamicProbeCount; if (sProbeDynamicAllocation > -1) { - if (sLevel == 0) + if (LLPipeline::sReflectionProbeLevel == (S32)LLReflectionMap::ProbeLevel::NONE)// No longer required use the pipeline cached version instead { mDynamicProbeCount = 1; } - else if (sLevel == 1) + else if (LLPipeline::sReflectionProbeLevel == (S32)LLReflectionMap::ProbeLevel::MANUAL_ONLY)// No longer required use the pipeline cached version instead { mDynamicProbeCount = (U32)mProbes.size(); } - else if (sLevel == 2) + else if (LLPipeline::sReflectionProbeLevel == (S32)LLReflectionMap::ProbeLevel::MANUAL_AND_TERRAIN)// No longer required use the pipeline cached version instead { mDynamicProbeCount = llmax((U32)mProbes.size(), 128); } @@ -456,13 +456,15 @@ void LLReflectionMapManager::update() { closestDynamic = probe; } - - if (sLevel == 0) - { - // only update default probe when coverage is set to none - llassert(probe == mDefaultProbe); - break; - } + // This code is no longer required and this update loop should self-cleanse + // However: There appears to be something that causes the reference count to be 2 for some probes that should no longer be in use. + // if (sLevel == 0) + // { + // // only update default probe when coverage is set to none + // llassert(probe == mDefaultProbe); + // break; + // } + // } if (realtime && closestDynamic != nullptr) @@ -489,12 +491,12 @@ void LLReflectionMapManager::update() static LLCachedControl sUpdatePeriod(gSavedSettings, "RenderDefaultProbeUpdatePeriod", 2.f); if ((gFrameTimeSeconds - mDefaultProbe->mLastUpdateTime) < sUpdatePeriod) { - if (sLevel == 0) + if (LLPipeline::sReflectionProbeLevel == (S32)LLReflectionMap::ProbeLevel::NONE) // No longer required use the pipeline cached version instead { // when probes are disabled don't update the default probe more often than the prescribed update period oldestProbe = nullptr; } } - else if (sLevel > 0) + else if (LLPipeline::sReflectionProbeLevel > (S32)LLReflectionMap::ProbeLevel::NONE) // No longer required use the pipeline cached version instead { // when probes are enabled don't update the default probe less often than the prescribed update period oldestProbe = mDefaultProbe; }