summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterperformance.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/llfloaterperformance.cpp
parent918efa36112a6cbaacb54a2eb9a43af859a09005 (diff)
SL-18930 Update Autotune panel
Diffstat (limited to 'indra/newview/llfloaterperformance.cpp')
-rw-r--r--indra/newview/llfloaterperformance.cpp38
1 files changed, 32 insertions, 6 deletions
diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp
index 88319b170f..ba45648bd9 100644
--- a/indra/newview/llfloaterperformance.cpp
+++ b/indra/newview/llfloaterperformance.cpp
@@ -148,6 +148,15 @@ BOOL LLFloaterPerformance::postBuild()
gSavedSettings.setF32("AutoTuneRenderFarClipTarget", LLPipeline::RenderFarClip);
}
+ LLStringExplicit fps_limit(llformat("%d", gViewerWindow->getWindow()->getRefreshRate()));
+ mAutoadjustmentsPanel->getChild<LLTextBox>("vsync_desc_limit")->setTextArg("[FPS_LIMIT]", fps_limit);
+ mAutoadjustmentsPanel->getChild<LLTextBox>("display_desc")->setTextArg("[FPS_LIMIT]", fps_limit);
+
+ mStartAutotuneBtn = mAutoadjustmentsPanel->getChild<LLButton>("start_autotune");
+ mStopAutotuneBtn = mAutoadjustmentsPanel->getChild<LLButton>("stop_autotune");
+ mStartAutotuneBtn->setCommitCallback(boost::bind(&LLFloaterPerformance::startAutotune, this));
+ mStopAutotuneBtn->setCommitCallback(boost::bind(&LLFloaterPerformance::stopAutotune, this));
+
return TRUE;
}
@@ -195,14 +204,10 @@ void LLFloaterPerformance::draw()
populateObjectList();
}
- auto button = getChild<LLButton>("AutoTuneFPS");
- if((bool)button->getToggleState() != LLPerfStats::tunables.userAutoTuneEnabled)
- {
- button->toggleState();
- }
-
mUpdateTimer->setTimerExpirySec(REFRESH_INTERVAL);
}
+ updateAutotuneCtrls(LLPerfStats::tunables.userAutoTuneEnabled);
+
LLFloater::draw();
}
@@ -645,4 +650,25 @@ void LLFloaterPerformance::onClickShadows()
}
}
+
+void LLFloaterPerformance::startAutotune()
+{
+ LLPerfStats::tunables.userAutoTuneEnabled = true;
+}
+
+void LLFloaterPerformance::stopAutotune()
+{
+ LLPerfStats::tunables.userAutoTuneEnabled = false;
+}
+
+void LLFloaterPerformance::updateAutotuneCtrls(bool autotune_enabled)
+{
+ static LLCachedControl<bool> auto_tune_locked(gSavedSettings, "AutoTuneLock");
+ mStartAutotuneBtn->setEnabled(!autotune_enabled && !auto_tune_locked);
+ mStopAutotuneBtn->setEnabled(autotune_enabled && !auto_tune_locked);
+ getChild<LLCheckBoxCtrl>("AutoTuneContinuous")->setEnabled(!autotune_enabled || (autotune_enabled && auto_tune_locked));
+
+ getChild<LLTextBox>("wip_desc")->setVisible(autotune_enabled && !auto_tune_locked);
+ getChild<LLTextBox>("display_desc")->setVisible(LLPerfStats::tunables.vsyncEnabled);
+}
// EOF