summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRye Mutt <rye@alchemyviewer.org>2024-07-09 20:51:02 -0400
committerGitHub <noreply@github.com>2024-07-09 19:51:02 -0500
commite101d1aa28a51570e6d76dc12df810b1daa71e7e (patch)
tree1018c667abca8e2fb5494200696b794f3d856e65 /indra/newview
parenta79e02da0f2acad033bc2eaa048c62b4dd26be7f (diff)
Fix excessive clearing of shader cache when toggling mirrors (#1950)
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llviewercontrol.cpp1
-rw-r--r--indra/newview/llviewershadermgr.cpp9
-rw-r--r--indra/newview/pipeline.cpp7
3 files changed, 9 insertions, 8 deletions
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 820d413535..1d483f1b8a 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -797,6 +797,7 @@ void settings_setup_listeners()
setting_setup_signal_listener(gSavedSettings, "RenderReflectionProbeDetail", handleReflectionProbeDetailChanged);
setting_setup_signal_listener(gSavedSettings, "RenderReflectionsEnabled", handleReflectionProbeDetailChanged);
setting_setup_signal_listener(gSavedSettings, "RenderScreenSpaceReflections", handleReflectionProbeDetailChanged);
+ setting_setup_signal_listener(gSavedSettings, "RenderMirrors", handleReflectionProbeDetailChanged);
setting_setup_signal_listener(gSavedSettings, "RenderHeroProbeResolution", handleHeroProbeResolutionChanged);
setting_setup_signal_listener(gSavedSettings, "RenderShadowDetail", handleSetShaderChanged);
setting_setup_signal_listener(gSavedSettings, "RenderDeferredSSAO", handleSetShaderChanged);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 12d0aa4f8e..96354ea18f 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -495,8 +495,6 @@ void LLViewerShaderMgr::setShaders()
mShaderList.clear();
- LLShaderMgr::sMirrorsEnabled = LLPipeline::RenderMirrors;
-
if (!gGLManager.mHasRequirements)
{
// Viewer will show 'hardware requirements' warning later
@@ -755,6 +753,8 @@ std::string LLViewerShaderMgr::loadBasicShaders()
bool ssr = gSavedSettings.getBOOL("RenderScreenSpaceReflections");
+ bool mirrors = gSavedSettings.getBOOL("RenderMirrors");
+
bool has_reflection_probes = gSavedSettings.getBOOL("RenderReflectionsEnabled") && gGLManager.mGLVersion > 3.99f;
S32 probe_level = llclamp(gSavedSettings.getS32("RenderReflectionProbeLevel"), 0, 3);
@@ -782,6 +782,11 @@ std::string LLViewerShaderMgr::loadBasicShaders()
attribs["REF_SAMPLE_COUNT"] = "32";
}
+ if (mirrors)
+ {
+ attribs["HERO_PROBES"] = "1";
+ }
+
{ // PBR terrain
const S32 mapping = clamp_terrain_mapping(gSavedSettings.getS32("RenderTerrainPBRPlanarSampleCount"));
attribs["TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT"] = llformat("%d", mapping);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 5598660368..16d66123ae 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1072,12 +1072,7 @@ void LLPipeline::refreshCachedSettings()
RenderScreenSpaceReflectionAdaptiveStepMultiplier = gSavedSettings.getF32("RenderScreenSpaceReflectionAdaptiveStepMultiplier");
RenderScreenSpaceReflectionGlossySamples = gSavedSettings.getS32("RenderScreenSpaceReflectionGlossySamples");
RenderBufferVisualization = gSavedSettings.getS32("RenderBufferVisualization");
- if (gSavedSettings.getBOOL("RenderMirrors") != RenderMirrors)
- {
- RenderMirrors = gSavedSettings.getBOOL("RenderMirrors");
- LLViewerShaderMgr::instance()->clearShaderCache();
- LLViewerShaderMgr::instance()->setShaders();
- }
+ RenderMirrors = gSavedSettings.getBOOL("RenderMirrors");
RenderHeroProbeUpdateRate = gSavedSettings.getS32("RenderHeroProbeUpdateRate");
RenderHeroProbeConservativeUpdateMultiplier = gSavedSettings.getS32("RenderHeroProbeConservativeUpdateMultiplier");