diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-10-23 12:36:47 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-10-23 12:36:47 -0400 |
commit | 7fda8f8d0b5c96b9264b0b3752666d866b64146b (patch) | |
tree | c37f28b461a22fbe50fa66de19012fcb615aa3b1 | |
parent | 910fbde7885cca758328c3ce6d0d77f382cd5e12 (diff) | |
parent | 7783191f91b19d10a14cdb475fedad46ddaa8a9b (diff) |
Merge branch 'develop' into marchcat/xcode-16
-rw-r--r-- | indra/llinventory/llsettingswater.cpp | 14 | ||||
-rw-r--r-- | indra/llrender/llimagegl.cpp | 71 | ||||
-rw-r--r-- | indra/llrender/llimagegl.h | 2 | ||||
-rw-r--r-- | indra/llui/llscrolllistctrl.cpp | 15 | ||||
-rw-r--r-- | indra/llui/llscrolllistctrl.h | 1 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 6 | ||||
-rw-r--r-- | indra/newview/featuretable.txt | 2 | ||||
-rw-r--r-- | indra/newview/featuretable_mac.txt | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterluascripts.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_lua_scripts.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml | 2 |
12 files changed, 74 insertions, 63 deletions
diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 08e18ea26e..b30dbfeac2 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -239,15 +239,15 @@ void LLSettingsWater::blend(LLSettingsBase::ptr_t &end, F64 blendf) { mSettingFlags |= other->mSettingFlags; - mBlurMultiplier = lerp((F32)blendf, mBlurMultiplier, other->mBlurMultiplier); + mBlurMultiplier = lerp(mBlurMultiplier, other->mBlurMultiplier, (F32)blendf); lerpColor(mWaterFogColor, other->mWaterFogColor, (F32)blendf); - mWaterFogDensity = lerp((F32)blendf, mWaterFogDensity, other->mWaterFogDensity); - mFogMod = lerp((F32)blendf, mFogMod, other->mFogMod); - mFresnelOffset = lerp((F32)blendf, mFresnelOffset, other->mFresnelOffset); - mFresnelScale = lerp((F32)blendf, mFresnelScale, other->mFresnelScale); + mWaterFogDensity = lerp(mWaterFogDensity, other->mWaterFogDensity, (F32)blendf); + mFogMod = lerp(mFogMod, other->mFogMod, (F32)blendf); + mFresnelOffset = lerp(mFresnelOffset, other->mFresnelOffset, (F32)blendf); + mFresnelScale = lerp(mFresnelScale, other->mFresnelScale, (F32)blendf); lerpVector3(mNormalScale, other->mNormalScale, (F32)blendf); - mScaleAbove = lerp((F32)blendf, mScaleAbove, other->mScaleAbove); - mScaleBelow = lerp((F32)blendf, mScaleBelow, other->mScaleBelow); + mScaleAbove = lerp(mScaleAbove, other->mScaleAbove, (F32)blendf); + mScaleBelow = lerp(mScaleBelow, other->mScaleBelow, (F32)blendf); lerpVector2(mWave1Dir, other->mWave1Dir, (F32)blendf); lerpVector2(mWave2Dir, other->mWave2Dir, (F32)blendf); diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index c915fcdf7b..17c6247670 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -51,6 +51,7 @@ extern LL_COMMON_API bool on_main_thread(); //---------------------------------------------------------------------------- const F32 MIN_TEXTURE_LIFETIME = 10.f; +const F32 CONVERSION_SCRATCH_BUFFER_GL_VERSION = 3.29f; //which power of 2 is i? //assumes i is a power of 2 > 0 @@ -160,6 +161,7 @@ S32 LLImageGL::sMaxCategories = 1 ; bool LLImageGL::sSkipAnalyzeAlpha; U32 LLImageGL::sScratchPBO = 0; U32 LLImageGL::sScratchPBOSize = 0; +U32* LLImageGL::sManualScratch = nullptr; //------------------------ @@ -262,6 +264,22 @@ void LLImageGL::initClass(LLWindow* window, S32 num_catagories, bool skip_analyz } } +void LLImageGL::allocateConversionBuffer() +{ + if (gGLManager.mGLVersion < CONVERSION_SCRATCH_BUFFER_GL_VERSION) + { + try + { + sManualScratch = new U32[MAX_IMAGE_AREA]; + } + catch (std::bad_alloc&) + { + LLError::LLUserWarningMsg::showOutOfMemory(); + LL_ERRS() << "Failed to allocate sManualScratch" << LL_ENDL; + } + } +} + //static void LLImageGL::cleanupClass() { @@ -273,6 +291,8 @@ void LLImageGL::cleanupClass() sScratchPBO = 0; sScratchPBOSize = 0; } + + delete[] sManualScratch; } @@ -1287,11 +1307,10 @@ void LLImageGL::deleteTextures(S32 numTextures, const U32 *textures) void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 width, S32 height, U32 pixformat, U32 pixtype, const void* pixels, bool allow_compression) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - std::unique_ptr<U32[]> scratch; if (LLRender::sGLCoreProfile) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - if (gGLManager.mGLVersion >= 3.29f) + if (gGLManager.mGLVersion >= CONVERSION_SCRATCH_BUFFER_GL_VERSION) { if (pixformat == GL_ALPHA) { //GL_ALPHA is deprecated, convert to RGBA @@ -1323,27 +1342,15 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt { //GL_ALPHA is deprecated, convert to RGBA if (pixels != nullptr) { - try - { - scratch.reset(new U32[width * height]); - } - catch (std::bad_alloc) - { - LLError::LLUserWarningMsg::showOutOfMemory(); - LL_ERRS() << "Failed to allocate " << (U32)(width * height * sizeof(U32)) - << " bytes for a manual image W" << width << " H" << height - << " Pixformat: GL_ALPHA, pixtype: GL_UNSIGNED_BYTE" << LL_ENDL; - } - U32 pixel_count = (U32)(width * height); for (U32 i = 0; i < pixel_count; i++) { - U8* pix = (U8*)&scratch[i]; + U8* pix = (U8*)&sManualScratch[i]; pix[0] = pix[1] = pix[2] = 0; pix[3] = ((U8*)pixels)[i]; } - pixels = scratch.get(); + pixels = sManualScratch; } pixformat = GL_RGBA; @@ -1354,30 +1361,18 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt { //GL_LUMINANCE_ALPHA is deprecated, convert to RGBA if (pixels != nullptr) { - try - { - scratch.reset(new U32[width * height]); - } - catch (std::bad_alloc) - { - LLError::LLUserWarningMsg::showOutOfMemory(); - LL_ERRS() << "Failed to allocate " << (U32)(width * height * sizeof(U32)) - << " bytes for a manual image W" << width << " H" << height - << " Pixformat: GL_LUMINANCE_ALPHA, pixtype: GL_UNSIGNED_BYTE" << LL_ENDL; - } - U32 pixel_count = (U32)(width * height); for (U32 i = 0; i < pixel_count; i++) { U8 lum = ((U8*)pixels)[i * 2 + 0]; U8 alpha = ((U8*)pixels)[i * 2 + 1]; - U8* pix = (U8*)&scratch[i]; + U8* pix = (U8*)&sManualScratch[i]; pix[0] = pix[1] = pix[2] = lum; pix[3] = alpha; } - pixels = scratch.get(); + pixels = sManualScratch; } pixformat = GL_RGBA; @@ -1388,29 +1383,17 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt { //GL_LUMINANCE_ALPHA is deprecated, convert to RGB if (pixels != nullptr) { - try - { - scratch.reset(new U32[width * height]); - } - catch (std::bad_alloc) - { - LLError::LLUserWarningMsg::showOutOfMemory(); - LL_ERRS() << "Failed to allocate " << (U32)(width * height * sizeof(U32)) - << " bytes for a manual image W" << width << " H" << height - << " Pixformat: GL_LUMINANCE, pixtype: GL_UNSIGNED_BYTE" << LL_ENDL; - } - U32 pixel_count = (U32)(width * height); for (U32 i = 0; i < pixel_count; i++) { U8 lum = ((U8*)pixels)[i]; - U8* pix = (U8*)&scratch[i]; + U8* pix = (U8*)&sManualScratch[i]; pix[0] = pix[1] = pix[2] = lum; pix[3] = 255; } - pixels = scratch.get(); + pixels = sManualScratch; } pixformat = GL_RGBA; intformat = GL_RGB8; diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index a8b94bd5b0..6b4492c09e 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -298,6 +298,7 @@ public: public: static void initClass(LLWindow* window, S32 num_catagories, bool skip_analyze_alpha = false, bool thread_texture_loads = false, bool thread_media_updates = false); + static void allocateConversionBuffer(); static void cleanupClass() ; private: @@ -305,6 +306,7 @@ private: static bool sSkipAnalyzeAlpha; static U32 sScratchPBO; static U32 sScratchPBOSize; + static U32* sManualScratch; //the flag to allow to call readBackRaw(...). //can be removed if we do not use that function at all. diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 8093536868..3ed328e37f 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -423,6 +423,19 @@ std::vector<LLScrollListItem*> LLScrollListCtrl::getAllSelected() const return ret; } +std::vector<LLSD> LLScrollListCtrl::getAllSelectedValues() const +{ + std::vector<LLSD> ret; + for (LLScrollListItem* item : mItemList) + { + if (item->getSelected()) + { + ret.push_back(item->getValue()); + } + } + return ret; +} + S32 LLScrollListCtrl::getNumSelected() const { S32 numSelected = 0; @@ -1510,7 +1523,7 @@ bool LLScrollListCtrl::setSelectedByValue(const LLSD& value, bool selected) { if (selected) { - selectItem(item, -1); + selectItem(item, -1, !mAllowMultipleSelection); } else { diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index bfae08ab5b..badaf31657 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -284,6 +284,7 @@ public: LLScrollListItem* getFirstSelected() const; virtual S32 getFirstSelectedIndex() const; std::vector<LLScrollListItem*> getAllSelected() const; + std::vector<LLSD> getAllSelectedValues() const; S32 getNumSelected() const; LLScrollListItem* getLastSelectedItem() const { return mLastSelected; } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c086399375..7a29401bb6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9289,7 +9289,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>1</real> + <real>1.5</real> </map> <key>RenderReflectionProbeDrawDistance</key> @@ -10100,7 +10100,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>1.0</real> + <real>0.7</real> </map> <key>RenderTonemapType</key> <map> @@ -10111,7 +10111,7 @@ <key>Type</key> <string>U32</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>ReplaySession</key> <map> diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 24fd7928a6..553d6c1d32 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -77,7 +77,7 @@ RenderScreenSpaceReflections 1 1 RenderMirrors 1 1 RenderHeroProbeResolution 1 2048 RenderHeroProbeDistance 1 16 -RenderHeroProbeUpdateRate 1 4 +RenderHeroProbeUpdateRate 1 6 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderDownScaleMethod 1 1 RenderCASSharpness 1 1 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 06ad730a40..b1359f8b91 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -77,7 +77,7 @@ RenderReflectionProbeLevel 1 3 RenderMirrors 1 1 RenderHeroProbeResolution 1 2048 RenderHeroProbeDistance 1 16 -RenderHeroProbeUpdateRate 1 4 +RenderHeroProbeUpdateRate 1 6 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 1 diff --git a/indra/newview/llfloaterluascripts.cpp b/indra/newview/llfloaterluascripts.cpp index 0eba45ec29..6b3d87543a 100644 --- a/indra/newview/llfloaterluascripts.cpp +++ b/indra/newview/llfloaterluascripts.cpp @@ -51,9 +51,9 @@ LLFloaterLUAScripts::LLFloaterLUAScripts(const LLSD &key) }, cb_info::UNTRUSTED_BLOCK }); mCommitCallbackRegistrar.add("Script.Terminate", {[this](LLUICtrl*, const LLSD &userdata) { - if (mScriptList->hasSelectedItem()) + std::vector<LLSD> coros = mScriptList->getAllSelectedValues(); + for (auto coro_name : coros) { - std::string coro_name = mScriptList->getSelectedValue(); LLCoros::instance().killreq(coro_name); } }, cb_info::UNTRUSTED_BLOCK }); @@ -97,7 +97,7 @@ void LLFloaterLUAScripts::draw() void LLFloaterLUAScripts::populateScriptList() { S32 prev_pos = mScriptList->getScrollPos(); - LLSD prev_selected = mScriptList->getSelectedValue(); + std::vector<LLSD> prev_selected = mScriptList->getAllSelectedValues(); mScriptList->clearRows(); mScriptList->updateColumns(true); std::map<std::string, std::string> scripts = LLLUAmanager::getScriptNames(); @@ -112,7 +112,10 @@ void LLFloaterLUAScripts::populateScriptList() mScriptList->addElement(row); } mScriptList->setScrollPos(prev_pos); - mScriptList->setSelectedByValue(prev_selected, true); + for (auto value : prev_selected) + { + mScriptList->setSelectedByValue(value, true); + } } void LLFloaterLUAScripts::onScrollListRightClicked(LLUICtrl *ctrl, S32 x, S32 y) @@ -120,10 +123,13 @@ void LLFloaterLUAScripts::onScrollListRightClicked(LLUICtrl *ctrl, S32 x, S32 y) LLScrollListItem *item = mScriptList->hitItem(x, y); if (item) { - mScriptList->selectItemAt(x, y, MASK_NONE); + if (!item->getSelected()) + mScriptList->selectItemAt(x, y, MASK_NONE); + auto menu = mContextMenuHandle.get(); if (menu) { + menu->setItemEnabled(std::string("open_folder"), (mScriptList->getNumSelected() == 1)); menu->show(x, y); LLMenuGL::showPopup(this, menu, x, y); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7a4cf7c85c..cc3e916270 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1935,6 +1935,11 @@ LLViewerWindow::LLViewerWindow(const Params& p) } LLFontManager::initClass(); + + // fonts use an GL_UNSIGNED_BYTE image format, + // so they need convertion, init buffers if needed + LLImageGL::allocateConversionBuffer(); + // Init font system, load default fonts and generate basic glyphs // currently it takes aprox. 0.5 sec and we would load these fonts anyway // before login screen. diff --git a/indra/newview/skins/default/xui/en/floater_lua_scripts.xml b/indra/newview/skins/default/xui/en/floater_lua_scripts.xml index 6859201650..211cea75d8 100644 --- a/indra/newview/skins/default/xui/en/floater_lua_scripts.xml +++ b/indra/newview/skins/default/xui/en/floater_lua_scripts.xml @@ -22,6 +22,7 @@ follows="all" layout="topleft" sort_column="script_name" + multi_select="true" name="scripts_list" top_pad="10" width="535"> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index cb3e0e4b6a..a64b3eee36 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -371,7 +371,7 @@ layout="topleft" left="30" min_val="0.5" - max_val="1.5" + max_val="4.0" name="RenderExposure" show_text="true" top_pad="14" |