From e33b5c5e6c8db1759e34db43ea9defc5455ab6c7 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 17 Sep 2025 15:56:08 +0300 Subject: #4432 Change graphics quality via a debug setting --- indra/newview/app_settings/settings.xml | 15 +++++++++++++-- indra/newview/llappviewer.cpp | 1 + indra/newview/llfloaterpreference.cpp | 1 + indra/newview/llviewercontrol.cpp | 18 ++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index aa6a28f137..e1be629f15 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9111,7 +9111,7 @@ RenderQualityPerformance Comment - Which graphics settings you've chosen + Which graphics settings you've chosen. Don't use this setting to change quality directly from debug settings. Persist 1 Type @@ -9119,7 +9119,18 @@ Value 1 - + DebugQualityPerformance + + Comment + Allows to change performance quality directly from debug settings. + Persist + 1 + Type + U32 + Value + 1 + + RenderReflectionDetail Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 62a1aa9fb6..b7852d8549 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1263,6 +1263,7 @@ bool LLAppViewer::init() LLViewerCamera::createInstance(); LL::GLTFSceneManager::createInstance(); + gSavedSettings.setU32("DebugQualityPerformance", gSavedSettings.getU32("RenderQualityPerformance")); #if LL_WINDOWS if (!mSecondInstance) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 734cc73331..5a39d41478 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1367,6 +1367,7 @@ void LLFloaterPreference::onChangeQuality(const LLSD& data) } mLastQualityLevel = level; LLFeatureManager::getInstance()->setGraphicsLevel(level, true); + gSavedSettings.setU32("DebugQualityPerformance", level); refreshEnabledGraphics(); refresh(); } diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index d39805f4c7..75cc76fee6 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -68,6 +68,8 @@ #include "llrender.h" #include "llnavigationbar.h" #include "llnotificationsutil.h" +#include "llfloaterpreference.h" +#include "llfloaterreg.h" #include "llfloatertools.h" #include "llpaneloutfitsinventory.h" #include "llpanellogin.h" @@ -149,6 +151,21 @@ static bool handleDebugAvatarJointsChanged(const LLSD& newvalue) return true; } +static bool handleDebugQualityPerformanceChanged(const LLSD& newvalue) +{ + // control was set directly or after adjusting Preference setting, no need to update + if (gSavedSettings.getU32("RenderQualityPerformance") != gSavedSettings.getU32("DebugQualityPerformance")) + { + LLFloaterPreference* instance = LLFloaterReg::getTypedInstance("preferences"); + if (instance) + { + gSavedSettings.setU32("RenderQualityPerformance", newvalue.asInteger()); + instance->onChangeQuality(newvalue); + } + } + return true; +} + static bool handleAvatarHoverOffsetChanged(const LLSD& newvalue) { if (isAgentAvatarValid()) @@ -946,6 +963,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "SpellCheckDictionary", handleSpellCheckChanged); setting_setup_signal_listener(gSavedSettings, "LoginLocation", handleLoginLocationChanged); setting_setup_signal_listener(gSavedSettings, "DebugAvatarJoints", handleDebugAvatarJointsChanged); + setting_setup_signal_listener(gSavedSettings, "DebugQualityPerformance", handleDebugQualityPerformanceChanged); setting_setup_signal_listener(gSavedSettings, "TargetFPS", handleTargetFPSChanged); setting_setup_signal_listener(gSavedSettings, "AutoTuneFPS", handleAutoTuneFPSChanged); -- cgit v1.2.3