From 695247539b54dee648d71417295e5ca753eaa74e Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Wed, 26 Mar 2025 19:01:30 -0400 Subject: Mitigate some of the frame stuttering we're seeing by setting the VRAM divisor to 1. tl;dr - this helps avoid frequent texture reuploads to VRAM in some texture heavy areas. This speaks to some bigger problems we're seeing in our texture streaming system however. You will see similar problems by manually setting the texture VRAM manually. --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b7127adc53..60ae8ac691 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7814,7 +7814,7 @@ Type U32 Value - 2 + 1 RenderMinFreeMainMemoryThreshold -- cgit v1.2.3 From 7d5a5e939a7427fb0cabc99e10f75d7d99c5f133 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 27 Mar 2025 18:02:19 +0200 Subject: #3820 crash at LLNotificationTemplate --- indra/llui/llnotifications.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7405413a3d..6fc9b90fb8 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1251,7 +1251,8 @@ LLNotifications::LLNotifications() void LLNotifications::clear() { - mDefaultChannels.clear(); + mDefaultChannels.clear(); + mTemplates.clear(); } // The expiration channel gets all notifications that are cancelled -- cgit v1.2.3 From d67859e48351a4db498f658030c0eb2866d59e77 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 26 Mar 2025 21:05:36 +0200 Subject: Use LLCachedControl in llviewerwindow and llappviewer Getting from gSavedSettings is expensive to do so often --- indra/llappearance/llwearable.cpp | 13 +++++++------ indra/newview/llappviewer.cpp | 11 +++++++---- indra/newview/llviewerwindow.cpp | 24 ++++++++++++++++-------- 3 files changed, 30 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index f30c147b91..4acb0ef3d4 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -645,9 +645,10 @@ void LLWearable::addVisualParam(LLVisualParam *param) void LLWearable::setVisualParamWeight(S32 param_index, F32 value) { - if( is_in_map(mVisualParamIndexMap, param_index ) ) + visual_param_index_map_t::iterator found = mVisualParamIndexMap.find(param_index); + if(found != mVisualParamIndexMap.end()) { - LLVisualParam *wearable_param = mVisualParamIndexMap[param_index]; + LLVisualParam *wearable_param = found->second; wearable_param->setWeight(value); } else @@ -658,10 +659,10 @@ void LLWearable::setVisualParamWeight(S32 param_index, F32 value) F32 LLWearable::getVisualParamWeight(S32 param_index) const { - if( is_in_map(mVisualParamIndexMap, param_index ) ) + visual_param_index_map_t::const_iterator found = mVisualParamIndexMap.find(param_index); + if(found != mVisualParamIndexMap.end()) { - const LLVisualParam *wearable_param = mVisualParamIndexMap.find(param_index)->second; - return wearable_param->getWeight(); + return found->second->getWeight(); } else { @@ -726,7 +727,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp) if (!avatarp) return; // Pull params - for( LLVisualParam* param = avatarp->getFirstVisualParam(); param; param = avatarp->getNextVisualParam() ) + for( const LLVisualParam* param = avatarp->getFirstVisualParam(); param; param = avatarp->getNextVisualParam() ) { // cross-wearable parameters are not authoritative, as they are driven by a different wearable. So don't copy the values to the // avatar object if cross wearable. Cross wearable params get their values from the avatar, they shouldn't write the other way. diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4cf651de33..0ffe675a7b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -445,8 +445,8 @@ void idle_afk_check() { // check idle timers F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32(); - F32 afk_timeout = (F32)gSavedSettings.getS32("AFKTimeout"); - if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK()) + static LLCachedControl afk_timeout(gSavedSettings, "AFKTimeout", 300); + if (afk_timeout() && (current_idle > (F32)afk_timeout()) && !gAgent.getAFK()) { LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL; gAgent.setAFK(); @@ -5376,7 +5376,8 @@ void LLAppViewer::idleNetwork() gObjectList.mNumNewObjects = 0; S32 total_decoded = 0; - if (!gSavedSettings.getBOOL("SpeedTest")) + static LLCachedControl speed_test(gSavedSettings, "SpeedTest", false); + if (!speed_test()) { LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK("idle network"); //LL_RECORD_BLOCK_TIME(FTM_IDLE_NETWORK); // decode @@ -5435,7 +5436,9 @@ void LLAppViewer::idleNetwork() } // Handle per-frame message system processing. - lmc.processAcks(gSavedSettings.getF32("AckCollectTime")); + + static LLCachedControl ack_collection_time(gSavedSettings, "AckCollectTime", 0.1f); + lmc.processAcks(ack_collection_time()); } } add(LLStatViewer::NUM_NEW_OBJECTS, gObjectList.mNumNewObjects); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 70c06af89b..fe5a0667a5 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -489,7 +489,8 @@ public: clearText(); - if (gSavedSettings.getBOOL("DebugShowTime")) + static LLCachedControl debug_show_time(gSavedSettings, "DebugShowTime", false); + if (debug_show_time()) { F32 time = gFrameTimeSeconds; S32 hours = (S32)(time / (60*60)); @@ -498,7 +499,8 @@ public: addText(xpos, ypos, llformat("Time: %d:%02d:%02d", hours,mins,secs)); ypos += y_inc; } - if (gSavedSettings.getBOOL("DebugShowMemory")) + static LLCachedControl debug_show_memory(gSavedSettings, "DebugShowMemory", false); + if (debug_show_memory()) { addText(xpos, ypos, STRINGIZE("Memory: " << (LLMemory::getCurrentRSS() / 1024) << " (KB)")); @@ -591,7 +593,8 @@ public: ypos += y_inc; }*/ - if (gSavedSettings.getBOOL("DebugShowRenderInfo")) + static LLCachedControl debug_show_render_info(gSavedSettings, "DebugShowRenderInfo", false); + if (debug_show_render_info()) { LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording(); @@ -730,7 +733,8 @@ public: gPipeline.mNumVisibleNodes = LLPipeline::sVisibleLightCount = 0; } - if (gSavedSettings.getBOOL("DebugShowAvatarRenderInfo")) + static LLCachedControl debug_show_avatar_render_info(gSavedSettings, "DebugShowAvatarRenderInfo", false); + if (debug_show_avatar_render_info()) { std::map sorted_avs; { @@ -763,7 +767,8 @@ public: av_iter++; } } - if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) + static LLCachedControl debug_show_render_matrices(gSavedSettings, "DebugShowRenderMatrices", false); + if (debug_show_render_matrices()) { char camera_lines[8][32]; memset(camera_lines, ' ', sizeof(camera_lines)); @@ -789,7 +794,8 @@ public: ypos += y_inc; } // disable use of glReadPixels which messes up nVidia nSight graphics debugging - if (gSavedSettings.getBOOL("DebugShowColor") && !LLRender::sNsightDebugSupport) + static LLCachedControl debug_show_color(gSavedSettings, "DebugShowColor", false); + if (debug_show_color() && !LLRender::sNsightDebugSupport) { U8 color[4]; LLCoordGL coord = gViewerWindow->getCurrentMouse(); @@ -881,7 +887,8 @@ public: } } - if (gSavedSettings.getBOOL("DebugShowTextureInfo")) + static LLCachedControl debug_show_texture_info(gSavedSettings, "DebugShowTextureInfo", false); + if (debug_show_texture_info()) { LLViewerObject* objectp = NULL ; @@ -1600,7 +1607,8 @@ bool LLViewerWindow::handleActivate(LLWindow *window, bool activated) mActive = false; // if the user has chosen to go Away automatically after some time, then go Away when minimizing - if (gSavedSettings.getS32("AFKTimeout")) + static LLCachedControl afk_time(gSavedSettings, "AFKTimeout", 300); + if (afk_time()) { gAgent.setAFK(); } -- cgit v1.2.3 From 2b44a97a16dcf5f2a3356f1a4ccf29a47bbe9c87 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 26 Mar 2025 21:07:20 +0200 Subject: Avoid recalculating pixel area when possible --- indra/newview/llviewertexturelist.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index db530a3943..63d5a2d778 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -899,6 +899,9 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag { llassert(!gCubeSnapshot); + constexpr F32 BIAS_TRS_OUT_OF_SCREEN = 1.5f; + constexpr F32 BIAS_TRS_ON_SCREEN = 1.f; + if (imagep->getBoostLevel() < LLViewerFetchedTexture::BOOST_HIGH) // don't bother checking face list for boosted textures { static LLCachedControl texture_scale_min(gSavedSettings, "TextureScaleMinAreaFactor", 0.0095f); @@ -940,7 +943,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag F32 vsize = face->getPixelArea(); - on_screen = face->mInFrustum; + on_screen |= face->mInFrustum; // Scale desired texture resolution higher or lower depending on texture scale // @@ -972,14 +975,28 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag } max_vsize = llmax(max_vsize, vsize); + + // addTextureStats limits size to sMaxVirtualSize + if (max_vsize >= LLViewerFetchedTexture::sMaxVirtualSize + && (on_screen || LLViewerTexture::sDesiredDiscardBias <= BIAS_TRS_ON_SCREEN)) + { + break; + } } } + + if (max_vsize >= LLViewerFetchedTexture::sMaxVirtualSize + && (on_screen || LLViewerTexture::sDesiredDiscardBias <= BIAS_TRS_ON_SCREEN)) + { + break; + } } if (face_count > 1024) { // this texture is used in so many places we should just boost it and not bother checking its vsize // this is especially important because the above is not time sliced and can hit multiple ms for a single texture imagep->setBoostLevel(LLViewerFetchedTexture::BOOST_HIGH); + // Do we ever remove it? This also sets texture nodelete! } if (imagep->getType() == LLViewerTexture::LOD_TEXTURE && imagep->getBoostLevel() == LLViewerTexture::BOOST_NONE) @@ -987,8 +1004,8 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag // this is an alternative to decaying mMaxVirtualSize over time // that keeps textures from continously downrezzing and uprezzing in the background - if (LLViewerTexture::sDesiredDiscardBias > 1.5f || - (!on_screen && LLViewerTexture::sDesiredDiscardBias > 1.f)) + if (LLViewerTexture::sDesiredDiscardBias > BIAS_TRS_OUT_OF_SCREEN || + (!on_screen && LLViewerTexture::sDesiredDiscardBias > BIAS_TRS_ON_SCREEN)) { imagep->mMaxVirtualSize = 0.f; } -- cgit v1.2.3 From 6ac1d4f3e37f2118875a4c9e96b26e3f82e17a1e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 27 Mar 2025 20:47:10 +0200 Subject: #3829 WebRTC crash OnDataReceivedImpl --- indra/newview/llvoicewebrtc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 93c217a7ba..08fcec86ac 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -3024,7 +3024,7 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b { root["ug"] = user_gain; } - if (root.size() > 0) + if (root.size() > 0 && mWebRTCDataInterface) { std::string json_data = boost::json::serialize(root); mWebRTCDataInterface->sendData(json_data, false); @@ -3067,7 +3067,10 @@ void LLVoiceWebRTCConnection::OnDataChannelReady(llwebrtc::LLWebRTCDataInterface void LLVoiceWebRTCConnection::sendJoin() { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; - + if (!mWebRTCDataInterface) + { + return; + } boost::json::object root; boost::json::object join_obj; -- cgit v1.2.3