summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authormobserveur <mobserveur@gmail.co[alias]>2024-11-06 01:28:26 +0100
committermobserveur <mobserveur@gmail.co[alias]>2024-11-06 01:28:26 +0100
commit569fc58358a49d6eb8007ea987969c449db43834 (patch)
treed39e6870abc0a487b47774bbab7a6c7fca0ffd35 /indra/newview
parent76d31ddf9a4f8bdd94dd86053dd1296912f9c9ac (diff)
Re-introduction of the "smoothie" optimization
This commit replaces the LL optimizations for Macs with Apple gpus by the "Smoothie" optimizations, and replaces the tuning panel with a simple fps limiter panel. This should fix the crash occurring in extraFPS when the viewer goes in the background.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp3
-rw-r--r--indra/newview/mpfloatertuning.cpp36
-rw-r--r--indra/newview/skins/default/xui/en/floater_mp_performance.xml86
3 files changed, 41 insertions, 84 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 41cd05f828..c12cb74b7c 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1388,7 +1388,8 @@ bool LLAppViewer::frame()
bool LLAppViewer::doFrame()
{
- static LLCachedControl<U32> fpsLimitMaxFps(gSavedSettings, "MaxFPS", 0);
+ U32 fpsLimitMaxFps = (U32)gSavedSettings.getU32("MaxFPS");
+ if(fpsLimitMaxFps>120) fpsLimitMaxFps=0;
using TimePoint = std::chrono::steady_clock::time_point;
diff --git a/indra/newview/mpfloatertuning.cpp b/indra/newview/mpfloatertuning.cpp
index bfa96a8764..1a3e4cf718 100644
--- a/indra/newview/mpfloatertuning.cpp
+++ b/indra/newview/mpfloatertuning.cpp
@@ -29,13 +29,12 @@
#include "mpfloatertuning.h"
#include "llsliderctrl.h"
+#include "lltextbox.h"
#include "llcheckboxctrl.h"
#include "llcombobox.h"
#include "llviewercontrol.h"
#include "llsdserialize.h"
-#include "../llrender/llvertexbuffer.cpp"
-
MPFloaterTuning::MPFloaterTuning(const LLSD& key) : LLFloater(key)
{
}
@@ -45,32 +44,25 @@ void MPFloaterTuning::syncFromPreferenceSetting(void *user_data)
MPFloaterTuning *self = static_cast<MPFloaterTuning*>(user_data);
U32 fps = gSavedSettings.getU32("MaxFPS");
+ if(fps==0) fps=132;
+
LLSliderCtrl* fpsSliderCtrl = self->getChild<LLSliderCtrl>("fpsSlider");
fpsSliderCtrl->setValue(fps,FALSE);
- U32 optBuf = gSavedSettings.getU32("MPVBufferOptiMode");
-
- if(optBuf == 0)
- {
- if(gGLManager.mIsApple) optBuf = 2;
- else optBuf = 1;
- }
-
- LLComboBox * optBufCtrl = self->getChild<LLComboBox>("MPVBuffModeComboBox");
- optBufCtrl->setCurrentByIndex(optBuf-1);
-
- LL_INFOS() << "syncFromPreferenceSetting optBuf=" << optBuf << LL_ENDL;
+ LLTextBox* fpsText = self->getChild<LLTextBox>("fpsText");
+ if(fps>120) fpsText->setValue("no limit");
+ else fpsText->setValue(std::to_string(fps)+" fps");
}
bool MPFloaterTuning::postBuild()
{
LLSliderCtrl* fpsSliderCtrl = getChild<LLSliderCtrl>("fpsSlider");
- fpsSliderCtrl->setMinValue(0);
- fpsSliderCtrl->setMaxValue(165);
+ fpsSliderCtrl->setMinValue(12);
+ fpsSliderCtrl->setMaxValue(132);
fpsSliderCtrl->setSliderMouseUpCallback(boost::bind(&MPFloaterTuning::onFinalCommit,this));
- LLComboBox* optBufCtrl = getChild<LLComboBox>("MPVBuffModeComboBox");
- optBufCtrl->setCommitCallback(boost::bind(&MPFloaterTuning::onFinalCommit,this));
+ LLTextBox* fpsText = getChild<LLTextBox>("fpsText");
+ fpsText->setValue("");
syncFromPreferenceSetting(this);
@@ -85,11 +77,9 @@ void MPFloaterTuning::onFinalCommit()
U32 fps = (U32)fpsSliderCtrl->getValueF32();
gSavedSettings.setU32("MaxFPS",fps);
- LLComboBox* optBufCtrl = getChild<LLComboBox>("MPVBuffModeComboBox");
- S16 optBuf = optBufCtrl->getCurrentIndex() + 1;
- gSavedSettings.setU32("MPVBufferOptiMode",optBuf);
-
- //LLVertexBuffer::sMappingMode = optBuf;
+ LLTextBox* fpsText = getChild<LLTextBox>("fpsText");
+ if(fps>120) fpsText->setValue("no limit");
+ else fpsText->setValue(std::to_string(fps)+" fps");
}
void MPFloaterTuning::onClose(bool app_quitting)
diff --git a/indra/newview/skins/default/xui/en/floater_mp_performance.xml b/indra/newview/skins/default/xui/en/floater_mp_performance.xml
index d943a13f66..1b5cf82dcb 100644
--- a/indra/newview/skins/default/xui/en/floater_mp_performance.xml
+++ b/indra/newview/skins/default/xui/en/floater_mp_performance.xml
@@ -3,11 +3,11 @@
positioning="cascading"
legacy_header_height="40"
top="12"
- right="-324"
- height="120"
+ right="-334"
+ height="80"
min_height="120"
- width="320"
- min_width="320"
+ width="330"
+ min_width="330"
can_minimize="true"
can_close="true"
can_resize="false"
@@ -16,85 +16,51 @@
single_instance="true"
save_rect="true"
save_visibility="true"
- title="Megapahit Tuning">
+ title="FPS Limiter">
<panel
name="panel_fps"
border="false"
- width="300"
- height="36"
+ width="320"
+ height="60"
left="10"
top="40"
- follows="top|left"
+ follows="left|top|right|bottom"
layout="topleft"
>
<slider
- name="fpsSlider"
- width="300"
+ follows="left|top"
+ width="240"
height="15"
+ left="12"
layout="topleft"
+ name="fpsSlider"
enabled="true"
control_name="fpsSlider"
decimal_digits="0"
- increment="5"
+ increment="12"
initial_value="0"
- label="Max FPS"
+ label="Max FPS:"
label_width="50"
- text_width="30"
+ text_width="2"
can_edit_text="false"
- show_text="true"
+ show_text="false"
>
</slider>
- </panel>
-
- <panel
- name="panel_mapping"
- border="false"
- width="300"
- height="36"
- left="10"
- top="78"
- follows="top|left"
- layout="topleft"
- >
-
- <text
- name="MPVBuffModeLabel"
- width="100"
+ <text
+ follows="left|top"
+ width="50"
height="15"
- left="2"
- top="8">
- Optimisations:
- (needs restart):
- </text>
-
- <combo_box
- control_name="MPVBuffModeControl"
- name="MPVBuffModeComboBox"
- width="150"
- height="23"
- left="130"
- top="4"
+ left_delta="252"
+ layout="topleft"
+ type="string"
+ name="fpsText"
>
- <combo_box.item
- enabled="true"
- label="Normal"
- name="Normal"
- value="1" />
- <combo_box.item
- enabled="true"
- label="Apple GPU (smoothie)"
- name="Megapahit Optimisations"
- value="2" />
- <combo_box.item
- enabled="true"
- label="Apple GPU (LL)"
- name="LL Optimisations"
- value="3" />
- </combo_box>
+ no limit
+ </text>
- </panel>
+</panel>
</floater>