diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-01-27 01:33:11 +0200 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-01-27 01:33:11 +0200 |
commit | c43336d5ed211ab77f2dc12b6cb7442d7544a2f7 (patch) | |
tree | d16b662ed8310fc3748208715d51e2f94dd03fe1 /indra | |
parent | 918efa36112a6cbaacb54a2eb9a43af859a09005 (diff) |
SL-18930 Update Autotune panel
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 13 | ||||
-rw-r--r-- | indra/newview/llfloaterperformance.cpp | 38 | ||||
-rw-r--r-- | indra/newview/llfloaterperformance.h | 7 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llperfstats.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewercontrol.cpp | 19 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_performance_autoadjustments.xml | 175 |
8 files changed, 203 insertions, 69 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b220e2a8f5..569a838176 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16775,6 +16775,17 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> + <integer>0</integer> + </map> + <key>KeepAutoTuneLock</key> + <map> + <key>Comment</key> + <string>When enabled the AutoTuneLock will be maintainted all following sessions.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> <integer>1</integer> </map> <key>AllowSelfImpostor</key> @@ -16885,7 +16896,7 @@ <key>Type</key> <string>U32</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>CameraOpacity</key> <map> 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 diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index 6a72f3d7c5..648e5902b6 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -68,6 +68,10 @@ private: void onClickShadows(); void onClickAdvancedLighting(); + void startAutotune(); + void stopAutotune(); + void updateAutotuneCtrls(bool autotune_enabled); + void updateMaxRenderTime(); static void changeQualityLevel(const std::string& notif); @@ -82,6 +86,9 @@ private: LLNameListCtrl* mObjectList; LLNameListCtrl* mNearbyList; + LLButton* mStartAutotuneBtn; + LLButton* mStopAutotuneBtn; + LLListContextMenu* mContextMenu; LLTimer* mUpdateTimer; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 531270f936..9476a0f6a3 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -825,6 +825,7 @@ void LLFloaterPreference::resetAutotuneSettings() const std::string autotune_settings[] = { "AutoTuneLock", + "KeepAutoTuneLock", "TargetFPS", "TuningFPSStrategy", "AutoTuneImpostorByDistEnabled", diff --git a/indra/newview/llperfstats.cpp b/indra/newview/llperfstats.cpp index cb5c674a32..959e0afbdf 100644 --- a/indra/newview/llperfstats.cpp +++ b/indra/newview/llperfstats.cpp @@ -123,8 +123,21 @@ namespace LLPerfStats LLPerfStats::tunables.userTargetFPS = gSavedSettings.getU32("TargetFPS"); LLPerfStats::tunables.vsyncEnabled = gSavedSettings.getBOOL("RenderVSyncEnable"); LLPerfStats::tunables.userTargetReflections = gSavedSettings.getS32("UserTargetReflections"); - LLPerfStats::tunables.userAutoTuneEnabled = gSavedSettings.getBOOL("AutoTuneFPS"); - LLPerfStats::tunables.userAutoTuneLock = gSavedSettings.getBOOL("AutoTuneLock"); + + LLPerfStats::tunables.userAutoTuneLock = gSavedSettings.getBOOL("AutoTuneLock") && gSavedSettings.getU32("KeepAutoTuneLock"); + + if(gSavedSettings.getBOOL("AutoTuneLock") && !gSavedSettings.getU32("KeepAutoTuneLock")) + { + gSavedSettings.setBOOL("AutoTuneLock", FALSE); + } + + LLPerfStats::tunables.userAutoTuneEnabled = LLPerfStats::tunables.userAutoTuneLock; + + if (LLPerfStats::tunables.userAutoTuneEnabled && !gSavedSettings.getBOOL("AutoTuneFPS")) + { + gSavedSettings.setBOOL("AutoTuneFPS", TRUE); + } + // Note: The Max ART slider is logarithmic and thus we have an intermediate proxy value updateRenderCostLimitFromSettings(); resetChanges(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 83ab8ee7e8..26c4f1b639 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2262,6 +2262,8 @@ bool idle_startup() { if (gAgent.isFirstLogin()) { + gSavedSettings.setBOOL("AutoTuneLock", TRUE); + gSavedSettings.setBOOL("KeepAutoTuneLock", TRUE); gSavedSettings.setBOOL("AutoTuneFPS", TRUE); } set_startup_status(1.0, "", ""); 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) diff --git a/indra/newview/skins/default/xui/en/panel_performance_autoadjustments.xml b/indra/newview/skins/default/xui/en/panel_performance_autoadjustments.xml index ab7b4d3ee7..24611c94d6 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_autoadjustments.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_autoadjustments.xml @@ -63,7 +63,7 @@ left="20" name="targetfps_desc" wrap="true" - width="140" + width="115" top_pad="20"> Desired frame rate </text> @@ -73,8 +73,8 @@ font="SansSerifLarge" tool_tip="The viewer will attempt to achieve this by adjusting your graphics settings." layout="topleft" - follows="right|top" - left_pad="5" + follows="left|top" + left_pad="25" top_delta="0" height="25" visible="true" @@ -85,41 +85,18 @@ min_val="1" width="48" label_width="0" /> - <button - control_name="AutoTuneFPS" - follows="top|right" - height="24" - initial_value="false" - image_pressed="PushButton_Press" - image_pressed_selected="PushButton_Selected_Press" - image_selected="PushButton_Selected_Press" - is_toggle="true" - label="Start" - label_selected="Stop" - layout="topleft" - left_pad="10" - name="AutoTuneFPS" - top_delta="-1" - tool_tip="The viewer will attempt to adjust settings to meet the target FPS." - width="72"> - </button> - <check_box - control_name="AutoTuneLock" - follows="top|right" + <text + follows="left|top" + text_color="White" height="20" - initial_value="true" - image_pressed="PushButton_Press" - image_pressed_selected="PushButton_Selected_Press" - image_selected="PushButton_Selected_Press" - is_toggle="true" - label="Continuous" layout="topleft" - left_pad="10" - name="AutoTuneContinuous" - top_delta="0" - tool_tip="The viewer will continually adapt the settings to meet the target FPS until stopped even with the floater closed. When disabled clicking the Start button will adjust for the current settings then stop." - width="64"> - </check_box> + name="display_desc" + top_delta="5" + left_pad="15" + wrap="true" + width="225"> + Your display supports up to [FPS_LIMIT] fps. + </text> <text follows="left|top" font="SansSerif" @@ -128,9 +105,9 @@ layout="topleft" left="20" name="settings_desc" - top_pad="20" + top_pad="15" wrap="true" - width="150"> + width="115"> Settings affect </text> <combo_box @@ -138,27 +115,118 @@ font="SansSerif" height="20" layout="topleft" - left_pad="15" + left_pad="25" control_name="TuningFPSStrategy" name="TuningFPSStrategy" - width="130"> + width="160"> <combo_box.item label="Avatars Only" name="av_only" value="0" /> <combo_box.item - label="Avatars and Scene" + label="Avatars and World" name="av_and_scene" value="1" /> </combo_box> + <button + follows="top|left" + height="22" + image_pressed="PushButton_Press" + image_pressed_selected="PushButton_Selected_Press" + image_selected="PushButton_Selected_Press" + label="Auto-adjust now" + layout="topleft" + top_pad="15" + left="20" + name="start_autotune" + tool_tip="The viewer will attempt to adjust settings to meet the target FPS then stop." + width="124"/> + <button + follows="top|left" + height="22" + image_pressed="PushButton_Press" + image_pressed_selected="PushButton_Selected_Press" + image_selected="PushButton_Selected_Press" + label="Cancel" + layout="topleft" + left_pad="15" + name="stop_autotune" + tool_tip="Stop adjusting settings." + width="90"/> + <text + follows="left|top" + text_color="Yellow" + height="20" + layout="topleft" + name="wip_desc" + top_delta="5" + left_pad="20" + wrap="true" + width="115"> + Working on it... + </text> + <check_box + control_name="AutoTuneLock" + follows="top|left" + height="20" + initial_value="true" + image_pressed="PushButton_Press" + image_pressed_selected="PushButton_Selected_Press" + image_selected="PushButton_Selected_Press" + is_toggle="true" + label="Adjust continuously" + layout="topleft" + left="17" + top_pad="10" + name="AutoTuneContinuous" + tool_tip="The viewer will continually adapt the settings to meet the target FPS until stopped even with the floater closed." + width="64"> + </check_box> + <radio_group + control_name="KeepAutoTuneLock" + enabled_control="AutoTuneLock" + height="50" + layout="topleft" + follows="top|left" + name="autotune_lock_type" + top_pad="5" + left_delta="15" + width="120"> + <radio_item + height="16" + label="This login session only" + layout="topleft" + name="one_session_lock" + value="0" + width="120" /> + <radio_item + height="16" + label="Future login sessions" + layout="topleft" + name="next_session_lock" + value="1" + width="120" /> + </radio_group> <view_border bevel_style="in" height="0" layout="topleft" name="border_vsync" - top_pad="20" + top_pad="3" left="20" width="540"/> + <check_box + control_name="RenderVSyncEnable" + height="16" + left="17" + initial_value="true" + label="Enable VSync" + label_text.text_color="White" + layout="topleft" + top_pad="12" + name="vsync" + tool_tip="Enable Vertical synchronization to reduce screen tearing and stuttering." + width="315" /> <text follows="left|top" font="SansSerifSmall" @@ -166,10 +234,10 @@ height="18" layout="topleft" left="20" - top_pad="20" + top_pad="15" name="vsync_desc" width="580"> - Synchronize the refresh rate and frame rate of a monitor, + Matches monitor refresh rate with frame rate. </text> <text follows="left|top" @@ -179,27 +247,16 @@ layout="topleft" top_pad="3" left="20" - name="vsync_desc2" + name="vsync_desc_limit" width="580"> - which can result in smoother performance. + Note: Turning on VSync limits frame rate to [FPS_LIMIT] fps. </text> - <check_box - control_name="RenderVSyncEnable" - height="16" - initial_value="true" - label="Enable VSync" - label_text.text_color="White" - layout="topleft" - top_pad="15" - name="vsync" - tool_tip="Enable Vertical synchronization to reduce screen tearing and stuttering." - width="315" /> <view_border bevel_style="in" height="0" layout="topleft" name="border1" - top_pad="20" + top_pad="10" left="20" width="540"/> <text @@ -263,7 +320,7 @@ height="18" layout="topleft" left="20" - top_pad="20" + top_pad="15" name="dist_limits_desc" width="580"> Choose the distance range that automatic settings will affect. |