#4432 Change graphics quality via a debug setting

master
Maxim Nikolenko 2025-09-17 15:56:08 +03:00 committed by GitHub
parent 892fb2d6e2
commit e33b5c5e6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 33 additions and 2 deletions

View File

@ -9111,7 +9111,7 @@
<key>RenderQualityPerformance</key>
<map>
<key>Comment</key>
<string>Which graphics settings you've chosen</string>
<string>Which graphics settings you've chosen. Don't use this setting to change quality directly from debug settings.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9119,7 +9119,18 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>DebugQualityPerformance</key>
<map>
<key>Comment</key>
<string>Allows to change performance quality directly from debug settings.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RenderReflectionDetail</key>
<map>
<key>Comment</key>

View File

@ -1263,6 +1263,7 @@ bool LLAppViewer::init()
LLViewerCamera::createInstance();
LL::GLTFSceneManager::createInstance();
gSavedSettings.setU32("DebugQualityPerformance", gSavedSettings.getU32("RenderQualityPerformance"));
#if LL_WINDOWS
if (!mSecondInstance)

View File

@ -1367,6 +1367,7 @@ void LLFloaterPreference::onChangeQuality(const LLSD& data)
}
mLastQualityLevel = level;
LLFeatureManager::getInstance()->setGraphicsLevel(level, true);
gSavedSettings.setU32("DebugQualityPerformance", level);
refreshEnabledGraphics();
refresh();
}

View File

@ -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<LLFloaterPreference>("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);