diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-07-06 08:09:31 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-07-06 08:09:31 +0800 |
commit | 57f91acf044a3cf2c8a0175aab10fbb7b1e90a7f (patch) | |
tree | 805c3e55d83094fa2010ee66bcd2b6a204736f42 /indra/newview | |
parent | 29d68ecb229ecb19e6d0da4cf5fbd8e3bbdde2cf (diff) | |
parent | 8662083cf4130922732aa8fba655310664b80d8b (diff) |
Merge branch 'main' into maint-b
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/newview/FixBundle.cmake.in | 7 | ||||
-rw-r--r-- | indra/newview/ViewerInstall.cmake | 82 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 28 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llstatusbar.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llstatusbar.h | 4 | ||||
-rw-r--r-- | indra/newview/llviewerfloaterreg.cpp | 4 | ||||
-rw-r--r-- | indra/newview/mpvfloatertuning.cpp | 90 | ||||
-rw-r--r-- | indra/newview/mpvfloatertuning.h | 48 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_mpv_performance.xml | 104 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_status_bar.xml | 20 |
12 files changed, 392 insertions, 26 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d282557efc..701f8b9c94 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2166,6 +2166,7 @@ if (DARWIN) "${VIEWER_APP_BUNDLE}/Contents/Info.plist" ) + if (NOT INSTALL) add_custom_command( TARGET ${VIEWER_BINARY_NAME} POST_BUILD COMMAND ${PYTHON_EXECUTABLE} @@ -2190,6 +2191,7 @@ if (DARWIN) ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) + endif (NOT INSTALL) if (ENABLE_MEDIA_PLUGINS) if (DARWIN OR LINUX) diff --git a/indra/newview/FixBundle.cmake.in b/indra/newview/FixBundle.cmake.in new file mode 100644 index 0000000000..73806642e4 --- /dev/null +++ b/indra/newview/FixBundle.cmake.in @@ -0,0 +1,7 @@ +include(BundleUtilities) + +set(dirs + /opt/local/lib + ) + +fixup_bundle(${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app "" "${dirs}") diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index e648d8cc47..7d9f160467 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -1,3 +1,59 @@ +if (DARWIN) + + install(DIRECTORY + English.lproj + German.lproj + Japanese.lproj + Korean.lproj + app_settings + character + cursors_mac + da.lproj + es.lproj + fonts + fr.lproj + uk.lproj + hu.lproj + it.lproj + nl.lproj + pl.lproj + pt.lproj + ru.lproj + skins + tr.lproj + zh-Hans.lproj + DESTINATION ${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources + ) + + install(FILES + SecondLife.nib + ${AUTOBUILD_INSTALL_DIR}/ca-bundle.crt + cube.dae + featuretable_mac.txt + secondlife.icns + DESTINATION ${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources + ) + + install(FILES + licenses-mac.txt + RENAME licenses.txt + DESTINATION ${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources + ) + + install(FILES + ${SCRIPTS_DIR}/messages/message_template.msg + ${SCRIPTS_DIR}/../etc/message.xml + DESTINATION ${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/app_settings + ) + + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/FixBundle.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake + ) + install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake) + +else (DARWIN) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME} DESTINATION bin ) @@ -16,15 +72,19 @@ if (LINUX) endif () install(FILES ${AUTOBUILD_INSTALL_DIR}/lib/release/libcef.so + DESTINATION ${_LIB}) + if (USE_FMODSTUDIO) + install(FILES ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so.13 ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so.13.22 - DESTINATION ${_LIB}) + DESTINATION ${_LIB}) + endif (USE_FMODSTUDIO) install(PROGRAMS ${AUTOBUILD_INSTALL_DIR}/bin/release/chrome-sandbox DESTINATION libexec/${VIEWER_BINARY_NAME} - #PERMISSIONS SETUID OWNER_READ OWNER_WRITE OWNER_EXECUTE - #GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + #PERMISSIONS SETUID OWNER_READ OWNER_WRITE OWNER_EXECUTE + #GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) install(PROGRAMS ${AUTOBUILD_INSTALL_DIR}/bin/release/dullahan_host @@ -65,10 +125,16 @@ else (IS_ARTWORK_PRESENT) message(STATUS "WARNING: Artwork is not present, and will not be installed") endif (IS_ARTWORK_PRESENT) -install(FILES featuretable_linux.txt - #featuretable_solaris.txt - licenses.txt + install(FILES ${AUTOBUILD_INSTALL_DIR}/ca-bundle.crt + featuretable_linux.txt + #featuretable_solaris.txt + DESTINATION share/${VIEWER_BINARY_NAME} + ) + + install(FILES + licenses-linux.txt + RENAME licenses.txt DESTINATION share/${VIEWER_BINARY_NAME} ) @@ -77,6 +143,8 @@ install(FILES ${SCRIPTS_DIR}/messages/message_template.msg DESTINATION share/${VIEWER_BINARY_NAME}/app_settings ) -install(FILES linux_tools/${VIEWER_BINARY_NAME}.desktop + install(FILES linux_tools/${VIEWER_BINARY_NAME}.desktop DESTINATION share/applications ) + +endif (DARWIN) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6355d02bc9..d132e81e20 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13496,6 +13496,17 @@ <key>Value</key> <real>0</real> </map> + <key>MaxFPS</key> + <map> + <key>Comment</key> + <string>FPS Limiter.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <real>0</real> + </map> <key>ZoomDirect</key> <map> <key>Comment</key> @@ -13755,6 +13766,23 @@ <real>12</real> </map> + + <!-- megapahit settings --> + <key>MPVBufferOptiMode</key> + <map> + <key>Comment</key> + <string> + OpenGL buffer mapping mode: + 0:auto, 1:normal, 2:optimised, 3:unsynchronized.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>0</integer> + </map> + + <!-- Settings below are for back compatibility only. They are not used in current viewer anymore. But they can't be removed to avoid influence on previous versions of the viewer in case of settings are not used or default value diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 768d131073..975935ee6f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -256,6 +256,8 @@ using namespace LL; #include "llcoproceduremanager.h" #include "llviewereventrecorder.h" +#include <chrono> + // *FIX: These extern globals should be cleaned up. // The globals either represent state/config/resource-storage of either // this app, or another 'component' of the viewer. App globals should be @@ -1370,9 +1372,10 @@ bool LLAppViewer::doFrame() { static LLCachedControl<U32> fpsLimitMaxFps(gSavedSettings, "MaxFPS", 0); + using TimePoint = std::chrono::steady_clock::time_point; + U64 fpsLimitSleepFor = 0; - U64 fpsLimitFrameStartTime = 0; - if(fpsLimitMaxFps > 0) fpsLimitFrameStartTime = LLTrace::BlockTimer::getCPUClockCount64(); + TimePoint fpsLimitFrameStartTime = std::chrono::steady_clock::now(); LL_RECORD_BLOCK_TIME(FTM_FRAME); { @@ -1546,12 +1549,13 @@ bool LLAppViewer::doFrame() if(fpsLimitMaxFps > 0) { - U64 fpsLimitFrameTime = LLTrace::BlockTimer::getCPUClockCount64() - fpsLimitFrameStartTime; - U64 desired_time_ns = (U32)(1000000.f / fpsLimitMaxFps); + auto elapsed = std::chrono::steady_clock::now() - fpsLimitFrameStartTime; - if((fpsLimitFrameTime+1000) < desired_time_ns) + long long fpsLimitFrameTime = std::chrono::duration_cast<std::chrono::microseconds>(elapsed).count(); + U64 desired_time_us = (U32)(1000000.f / fpsLimitMaxFps); + if((fpsLimitFrameTime+1000) < desired_time_us) { - fpsLimitSleepFor = (desired_time_ns - fpsLimitFrameTime - 1000) * 1.0; + fpsLimitSleepFor = (desired_time_us - fpsLimitFrameTime - 1000) * 1.0; } } diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index a0a625c5fc..eecf9c60b6 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -166,7 +166,9 @@ BOOL LLStatusBar::postBuild() gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3)); mTextTime = getChild<LLTextBox>("TimeText" ); - mTextFps = getChild<LLTextBox>("FpsText"); + + mTextFps = getChild<LLButton>("FpsText"); + mTextFps->setClickedCallback( &LLStatusBar::onClickFps, this ); getChild<LLUICtrl>("buyL")->setCommitCallback( boost::bind(&LLStatusBar::onClickBuyCurrency, this)); @@ -306,7 +308,8 @@ void LLStatusBar::refresh() S32 fps = (S32) llround(LLTrace::get_frame_recording().getPeriodMedianPerSec(LLStatViewer::FPS, 50)); std::string fpsStr = std::to_string(fps); - mTextFps->setText(fpsStr); + //mTextFps->setText(fpsStr); + mTextFps->setLabel(fpsStr); } // update clock every 10 seconds @@ -649,6 +652,12 @@ void LLStatusBar::onClickMediaToggle(void* data) LLViewerMedia::getInstance()->setAllMediaPaused(pause); } +//static +void LLStatusBar::onClickFps(void* data) +{ + LLFloaterReg::toggleInstance("mpv_performance"); +} + BOOL can_afford_transaction(S32 cost) { return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost))); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index da3c4a71f1..650d7d6c40 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -109,6 +109,8 @@ private: static void onClickMediaToggle(void* data); static void onClickBalance(void* data); + static void onClickFps(void* data); + LLSearchEditor *mFilterEdit; LLPanel *mSearchPanel; void onUpdateFilterTerm(); @@ -121,7 +123,7 @@ private: private: LLTextBox *mTextTime; - LLTextBox *mTextFps; + LLButton *mTextFps; LLStatGraph *mSGBandwidth; LLStatGraph *mSGPacketLoss; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index ceda2675d5..9ec5f4f122 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -81,6 +81,7 @@ #include "llfloatergroups.h" #include "llfloaterhelpbrowser.h" #include "llfloaterhoverheight.h" +#include "mpvfloatertuning.h" #include "llfloaterhowto.h" #include "llfloaterhud.h" #include "llfloaterimagepreview.h" @@ -380,6 +381,9 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("edit_hover_height", "floater_edit_hover_height.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHoverHeight>); LLFloaterReg::add("hud", "floater_hud.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHUD>); + LLFloaterReg::add("mpv_performance", "floater_mpv_performance.xml", (LLFloaterBuildFunc)& + LLFloaterReg::build<MPVFloaterTuning>); + LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterIMSession>); LLFloaterReg::add("im_container", "floater_im_container.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterIMContainer>); LLFloaterReg::add("im_well_window", "floater_sys_well.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMWellWindow>); diff --git a/indra/newview/mpvfloatertuning.cpp b/indra/newview/mpvfloatertuning.cpp new file mode 100644 index 0000000000..177bd3caa7 --- /dev/null +++ b/indra/newview/mpvfloatertuning.cpp @@ -0,0 +1,90 @@ +/** +* @file mpvfloatertuning.cpp +* @brief Controller for viewer tuning +* @author observeur@megapahit.net +* +* $LicenseInfo:firstyear=2014&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2014, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "mpvfloatertuning.h" +#include "llsliderctrl.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llviewercontrol.h" +#include "llsdserialize.h" + +#include "../llrender/llvertexbuffer.cpp" + +MPVFloaterTuning::MPVFloaterTuning(const LLSD& key) : LLFloater(key) +{ +} + +void MPVFloaterTuning::syncFromPreferenceSetting(void *user_data) +{ + MPVFloaterTuning *self = static_cast<MPVFloaterTuning*>(user_data); + + U32 fps = gSavedSettings.getU32("MaxFPS"); + LLSliderCtrl* fpsSliderCtrl = self->getChild<LLSliderCtrl>("fpsSlider"); + fpsSliderCtrl->setValue(fps,FALSE); + + U32 optBuf = gSavedSettings.getU32("MPVBufferOptiMode"); + LLComboBox * optBufCtrl = self->getChild<LLComboBox>("MPVBuffModeComboBox"); + optBufCtrl->setCurrentByIndex(optBuf); + + LL_INFOS() << "syncFromPreferenceSetting optBuf=" << optBuf << LL_ENDL; +} + +BOOL MPVFloaterTuning::postBuild() +{ + LLSliderCtrl* fpsSliderCtrl = getChild<LLSliderCtrl>("fpsSlider"); + fpsSliderCtrl->setMinValue(0); + fpsSliderCtrl->setMaxValue(165); + fpsSliderCtrl->setSliderMouseUpCallback(boost::bind(&MPVFloaterTuning::onFinalCommit,this)); + + LLComboBox* optBufCtrl = getChild<LLComboBox>("MPVBuffModeComboBox"); + optBufCtrl->setCommitCallback(boost::bind(&MPVFloaterTuning::onFinalCommit,this)); + + syncFromPreferenceSetting(this); + + return TRUE; +} + +// Do send-to-the-server work when slider drag completes, or new +// value entered as text. +void MPVFloaterTuning::onFinalCommit() +{ + LLSliderCtrl* fpsSliderCtrl = getChild<LLSliderCtrl>("fpsSlider"); + U32 fps = (U32)fpsSliderCtrl->getValueF32(); + gSavedSettings.setU32("MaxFPS",fps); + + LLComboBox* optBufCtrl = getChild<LLComboBox>("MPVBuffModeComboBox"); + S16 optBuf = optBufCtrl->getCurrentIndex(); + gSavedSettings.setU32("MPVBufferOptiMode",optBuf); + + LLVertexBuffer::sMappingMode = optBuf; +} + +void MPVFloaterTuning::onClose(bool app_quitting) +{ +}
\ No newline at end of file diff --git a/indra/newview/mpvfloatertuning.h b/indra/newview/mpvfloatertuning.h new file mode 100644 index 0000000000..ed91317eab --- /dev/null +++ b/indra/newview/mpvfloatertuning.h @@ -0,0 +1,48 @@ +/** +* @file mpvfloatertuning.h +* @brief Controller for viewer tuning +* @author observeur@megapahit.net +* +* $LicenseInfo:firstyear=2014&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2014, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_MPVFLOATERTUNING_H +#define LL_MPVFLOATERTUNING_H + +#include "llfloater.h" + +class MPVFloaterTuning: public LLFloater +{ +public: + MPVFloaterTuning(const LLSD& key); + + BOOL postBuild(); + + void onFinalCommit(); + + static void syncFromPreferenceSetting(void *user_data); + + //void updateEditEnabled(); + + /*virtual*/ void onClose(bool app_quitting); +}; + +#endif diff --git a/indra/newview/skins/default/xui/en/floater_mpv_performance.xml b/indra/newview/skins/default/xui/en/floater_mpv_performance.xml new file mode 100644 index 0000000000..5c54d366f2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_mpv_performance.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater + positioning="cascading" + legacy_header_height="40" + top="12" + right="2" + height="120" + min_height="120" + width="320" + min_width="320" + can_minimize="true" + can_close="true" + can_resize="false" + layout="topright" + name="mpv_performance" + single_instance="true" + save_rect="true" + save_visibility="true" + title="Megapahit Tuning"> + + <panel + name="panel_fps" + border="false" + width="300" + height="36" + left="10" + top="40" + follows="top|left" + layout="topleft" + > + + <slider + name="fpsSlider" + width="300" + height="15" + layout="topleft" + enabled="true" + control_name="fpsSlider" + decimal_digits="0" + increment="5" + initial_value="0" + label="Max FPS" + label_width="50" + text_width="30" + can_edit_text="false" + show_text="true" + > + </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" + height="15" + left="2" + top="8"> + Buffer mapping: + </text> + + <combo_box + control_name="MPVBuffModeControl" + name="MPVBuffModeComboBox" + width="150" + height="23" + left="120" + top="4" + > + <combo_box.item + enabled="true" + label="Auto" + name="Auto" + value="0" /> + <combo_box.item + enabled="true" + label="Normal" + name="Normal" + value="1" /> + <combo_box.item + enabled="true" + label="Optimized (Apple GPU)" + name="Optimized" + value="2" /> + <combo_box.item + enabled="true" + label="Optimized+ (AMD GPU)" + name="Optimized+" + value="3" /> + </combo_box> + + </panel> + +</floater> diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index dbc181855f..f337ad9038 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -55,11 +55,11 @@ text_pad_left="6" tool_tip="Type the search term you are interested in here. Results will be displayed for partial fulltext matches within the menu." top="0"> - <search_button + <search_button top_pad="4" - left_pad="4" + left_pad="4" width="12" - height="12" + height="12" image_unselected="Search" image_selected="Search"/> <clear_button @@ -77,20 +77,20 @@ left="-398" width="185" top="1" - follows="right|top" + follows="right|top" name="balance_bg"> <text halign="center" font="SansSerifSmall" follows="all" height="18" - left="0" + left="0" name="balance" tool_tip="Click to refresh your L$ balance" v_pad="4" top="0" - wrap="false" - value="L$??" + wrap="false" + value="L$??" width="40" /> <button halign="center" @@ -185,7 +185,7 @@ top="2" name="volume_btn" width="16" /> - <text + <button type="string" font="SansSerif" text_color="FpsTextColor" @@ -195,10 +195,10 @@ height="18" top="1" v_pad="0" - left_pad="0" + left_pad="4" name="FpsText" tool_tip="fps" - width="40"> + width="32"> 60 </text> </panel> |