summaryrefslogtreecommitdiff
path: root/indra/newview/llviewercontrol.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-01-27 01:33:11 +0200
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-01-27 01:33:11 +0200
commitc43336d5ed211ab77f2dc12b6cb7442d7544a2f7 (patch)
treed16b662ed8310fc3748208715d51e2f94dd03fe1 /indra/newview/llviewercontrol.cpp
parent918efa36112a6cbaacb54a2eb9a43af859a09005 (diff)
SL-18930 Update Autotune panel
Diffstat (limited to 'indra/newview/llviewercontrol.cpp')
-rw-r--r--indra/newview/llviewercontrol.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 0bade93c45..50d48987ed 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -270,6 +270,12 @@ static bool handleVSyncChanged(const LLSD& newvalue)
LLPerfStats::tunables.vsyncEnabled = newvalue.asBoolean();
gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean());
+ if(newvalue.asBoolean() == true)
+ {
+ U32 current_target = gSavedSettings.getU32("TargetFPS");
+ gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target));
+ }
+
return true;
}
@@ -649,13 +655,24 @@ void handleRenderAutoMuteByteLimitChanged(const LLSD& new_value);
void handleTargetFPSChanged(const LLSD& newValue)
{
const auto targetFPS = gSavedSettings.getU32("TargetFPS");
- LLPerfStats::tunables.userTargetFPS = targetFPS;
+
+ U32 frame_rate_limit = gViewerWindow->getWindow()->getRefreshRate();
+ if(LLPerfStats::tunables.vsyncEnabled && (targetFPS > frame_rate_limit))
+ {
+ gSavedSettings.setU32("TargetFPS", std::min(frame_rate_limit, targetFPS));
+ }
+ else
+ {
+ LLPerfStats::tunables.userTargetFPS = targetFPS;
+ }
}
void handleAutoTuneLockChanged(const LLSD& newValue)
{
const auto newval = gSavedSettings.getBOOL("AutoTuneLock");
LLPerfStats::tunables.userAutoTuneLock = newval;
+
+ gSavedSettings.setBOOL("AutoTuneFPS", newval);
}
void handleAutoTuneFPSChanged(const LLSD& newValue)