diff options
author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2025-03-05 19:06:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-05 19:06:01 -0500 |
commit | f5a25a9d6a94e7899ddb04199e5c4fd2d56228d1 (patch) | |
tree | 64a146ad7a55bd51a5067a79e63739e4d3112777 /indra/newview/llviewertexture.cpp | |
parent | 85c77ee9102d4f70cc566f96b4c2f0b1924234da (diff) |
Add RenderTextureVRAMDivisor (#3648)
#3647 Add texture VRAM use divisor.
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r-- | indra/newview/llviewertexture.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 609ad38e96..a0723db479 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -489,7 +489,12 @@ void LLViewerTexture::updateClass() } LLViewerMediaTexture::updateClass(); - + // This is a divisor used to determine how much VRAM from our overall VRAM budget to use. + // This is **cumulative** on whatever the detected or manually set VRAM budget is. + // If we detect 2048MB of VRAM, this will, by default, only use 1024. + // If you set 1024MB of VRAM, this will, by default, use 512. + // -Geenz 2025-03-03 + static LLCachedControl<U32> tex_vram_divisor(gSavedSettings, "RenderTextureVRAMDivisor", 2); static LLCachedControl<U32> max_vram_budget(gSavedSettings, "RenderMaxVRAMBudget", 0); F64 texture_bytes_alloc = LLImageGL::getTextureBytesAllocated() / 1024.0 / 512.0; @@ -500,6 +505,7 @@ void LLViewerTexture::updateClass() F32 used = (F32)ll_round(texture_bytes_alloc + vertex_bytes_alloc); F32 budget = max_vram_budget == 0 ? (F32)gGLManager.mVRAM : (F32)max_vram_budget; + budget /= tex_vram_divisor; // Try to leave at least half a GB for everyone else and for bias, // but keep at least 768MB for ourselves |