summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-10-03 20:01:19 +0800
committerErik Kundiman <erik@megapahit.org>2025-10-03 20:01:19 +0800
commitf5e7c3a874dcbc4ea8ae23248c2685335bf1eacf (patch)
tree874d4e3cb4ccc81945569a6a3497f8fc6cc23525 /indra/newview
parent70ee556ebdd87ee8e7813a497882206d990c62e3 (diff)
parentc743ea2b6dc60312b29f2fb5972171ead26ee448 (diff)
Merge tag 'Second_Life_Release#c743ea2b-2025.07' into 2025.07
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llconversationview.cpp2
-rw-r--r--indra/newview/llspeakingindicatormanager.cpp13
-rw-r--r--indra/newview/llviewermessage.cpp7
-rw-r--r--indra/newview/llviewertexture.cpp26
-rw-r--r--indra/newview/llviewertexture.h1
-rw-r--r--indra/newview/llvocache.cpp6
-rw-r--r--indra/newview/llvoicechannel.cpp4
-rw-r--r--indra/newview/llvoicechannel.h1
8 files changed, 40 insertions, 20 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 0e0ab236d6..99d770b6e2 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -543,7 +543,7 @@ void LLConversationViewSession::onCurrentVoiceSessionChanged(const LLUUID& sessi
{
bool old_value = mIsInActiveVoiceChannel;
mIsInActiveVoiceChannel = vmi->getUUID() == session_id;
- mCallIconLayoutPanel->setVisible(mIsInActiveVoiceChannel);
+ mCallIconLayoutPanel->setVisible(mIsInActiveVoiceChannel && !LLVoiceChannel::isSuspended());
if (old_value != mIsInActiveVoiceChannel)
{
refresh();
diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp
index 532b245ced..06458a9f3c 100644
--- a/indra/newview/llspeakingindicatormanager.cpp
+++ b/indra/newview/llspeakingindicatormanager.cpp
@@ -200,8 +200,17 @@ void SpeakingIndicatorManager::cleanupSingleton()
void SpeakingIndicatorManager::sOnCurrentChannelChanged(const LLUUID& /*session_id*/)
{
- switchSpeakerIndicators(mSwitchedIndicatorsOn, false);
- mSwitchedIndicatorsOn.clear();
+ if (LLVoiceChannel::isSuspended())
+ {
+ switchSpeakerIndicators(mSwitchedIndicatorsOn, false);
+ mSwitchedIndicatorsOn.clear();
+ }
+ else
+ {
+ // Multiple onParticipantsChanged can arrive at the same time
+ // from different sources, might want to filter by some factor.
+ onParticipantsChanged();
+ }
}
void SpeakingIndicatorManager::onParticipantsChanged()
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 02171acaac..cd6cf869ae 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3386,13 +3386,10 @@ void send_agent_update(bool force_send, bool send_reliable)
static F32 last_draw_disatance_step = 1024;
F32 memory_limited_draw_distance = gAgentCamera.mDrawDistance;
- if (LLViewerTexture::sDesiredDiscardBias > 2.f && LLViewerTexture::isSystemMemoryLow())
+ if (LLViewerTexture::isSystemMemoryCritical())
{
// If we are low on memory, reduce requested draw distance
- // Discard's bias is clamped to 4 so we need to check 2 to 4 range
- // Factor is intended to go from 1.0 to 2.0
- F32 factor = 1.f + (LLViewerTexture::sDesiredDiscardBias - 2.f) / 2.f;
- memory_limited_draw_distance = llmax(gAgentCamera.mDrawDistance / factor, gAgentCamera.mDrawDistance / 2.f);
+ memory_limited_draw_distance = llmax(gAgentCamera.mDrawDistance / LLViewerTexture::getSystemMemoryBudgetFactor(), gAgentCamera.mDrawDistance / 2.f);
}
if (tp_state == LLAgent::TELEPORT_ARRIVING || LLStartUp::getStartupState() < STATE_MISC)
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index c50cd5083f..e40f109e55 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -657,23 +657,35 @@ U32Megabytes LLViewerTexture::getFreeSystemMemory()
return physical_res;
}
-//static
-bool LLViewerTexture::isSystemMemoryLow()
+S32Megabytes get_render_free_main_memory_treshold()
{
static LLCachedControl<U32> min_free_main_memory(gSavedSettings, "RenderMinFreeMainMemoryThreshold", 512);
const U32Megabytes MIN_FREE_MAIN_MEMORY(min_free_main_memory);
- return getFreeSystemMemory() < MIN_FREE_MAIN_MEMORY;
+ return MIN_FREE_MAIN_MEMORY;
+}
+
+//static
+bool LLViewerTexture::isSystemMemoryLow()
+{
+ return getFreeSystemMemory() < get_render_free_main_memory_treshold();
+}
+
+//static
+bool LLViewerTexture::isSystemMemoryCritical()
+{
+ return getFreeSystemMemory() < get_render_free_main_memory_treshold() / 2;
}
F32 LLViewerTexture::getSystemMemoryBudgetFactor()
{
- static LLCachedControl<U32> min_free_main_memory(gSavedSettings, "RenderMinFreeMainMemoryThreshold", 512);
- const S32Megabytes MIN_FREE_MAIN_MEMORY(min_free_main_memory);
+ const S32Megabytes MIN_FREE_MAIN_MEMORY(get_render_free_main_memory_treshold() / 2);
S32 free_budget = (S32Megabytes)getFreeSystemMemory() - MIN_FREE_MAIN_MEMORY;
if (free_budget < 0)
{
- // Result should range from 1 (0 free budget) to 2 (-512 free budget)
- return 1.f - free_budget / MIN_FREE_MAIN_MEMORY;
+ // Leave some padding, otherwise we will crash out of memory before hitting factor 2.
+ const S32Megabytes PAD_BUFFER(32);
+ // Result should range from 1 at 0 free budget to 2 at -224 free budget, 2.14 at -256MB
+ return 1.f - free_budget / (MIN_FREE_MAIN_MEMORY - PAD_BUFFER);
}
return 1.f;
}
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index d32c302d8e..2937651995 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -115,6 +115,7 @@ public:
static void initClass();
static void updateClass();
static bool isSystemMemoryLow();
+ static bool isSystemMemoryCritical();
static F32 getSystemMemoryBudgetFactor();
LLViewerTexture(bool usemipmaps = true);
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index ac73c2def6..52a6afc2d0 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -488,13 +488,11 @@ void LLVOCacheEntry::updateDebugSettings()
static const F32 MIN_RADIUS = 1.0f;
F32 draw_radius = gAgentCamera.mDrawDistance;
- if (LLViewerTexture::sDesiredDiscardBias > 2.f && LLViewerTexture::isSystemMemoryLow())
+ if (LLViewerTexture::isSystemMemoryCritical())
{
- // Discard's bias maximum is 4 so we need to check 2 to 4 range
// Factor is intended to go from 1.0 to 2.0
- F32 factor = 1.f + (LLViewerTexture::sDesiredDiscardBias - 2.f) / 2.f;
// For safety cap reduction at 50%, we don't want to go below half of draw distance
- draw_radius = llmax(draw_radius / factor, draw_radius / 2.f);
+ draw_radius = llmax(draw_radius / LLViewerTexture::getSystemMemoryBudgetFactor(), draw_radius / 2.f);
}
const F32 clamped_min_radius = llclamp((F32) min_radius, MIN_RADIUS, draw_radius); // [1, mDrawDistance]
sNearRadius = MIN_RADIUS + ((clamped_min_radius - MIN_RADIUS) * adjust_factor);
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index b3ac28eb7a..fbe896ac27 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -357,6 +357,8 @@ void LLVoiceChannel::suspend()
{
sSuspendedVoiceChannel = sCurrentVoiceChannel;
sSuspended = true;
+
+ sCurrentVoiceChannelChangedSignal(sSuspendedVoiceChannel->mSessionID);
}
}
@@ -365,6 +367,7 @@ void LLVoiceChannel::resume()
{
if (sSuspended)
{
+ sSuspended = false; // needs to be before activate() so that observers will be able to read state
if (LLVoiceClient::getInstance()->voiceEnabled())
{
if (sSuspendedVoiceChannel)
@@ -382,7 +385,6 @@ void LLVoiceChannel::resume()
LLVoiceChannelProximal::getInstance()->activate();
}
}
- sSuspended = false;
}
}
diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h
index 4d7bf551e1..bf119638d3 100644
--- a/indra/newview/llvoicechannel.h
+++ b/indra/newview/llvoicechannel.h
@@ -103,6 +103,7 @@ public:
static void suspend();
static void resume();
+ static bool isSuspended() { return sSuspended; }
protected:
virtual void setState(EState state);