From c43336d5ed211ab77f2dc12b6cb7442d7544a2f7 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 27 Jan 2023 01:33:11 +0200 Subject: SL-18930 Update Autotune panel --- indra/newview/llfloaterperformance.cpp | 38 ++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterperformance.cpp') 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("vsync_desc_limit")->setTextArg("[FPS_LIMIT]", fps_limit); + mAutoadjustmentsPanel->getChild("display_desc")->setTextArg("[FPS_LIMIT]", fps_limit); + + mStartAutotuneBtn = mAutoadjustmentsPanel->getChild("start_autotune"); + mStopAutotuneBtn = mAutoadjustmentsPanel->getChild("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("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 auto_tune_locked(gSavedSettings, "AutoTuneLock"); + mStartAutotuneBtn->setEnabled(!autotune_enabled && !auto_tune_locked); + mStopAutotuneBtn->setEnabled(autotune_enabled && !auto_tune_locked); + getChild("AutoTuneContinuous")->setEnabled(!autotune_enabled || (autotune_enabled && auto_tune_locked)); + + getChild("wip_desc")->setVisible(autotune_enabled && !auto_tune_locked); + getChild("display_desc")->setVisible(LLPerfStats::tunables.vsyncEnabled); +} // EOF -- cgit v1.2.3