diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-01-09 18:06:11 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-01-11 00:20:15 +0200 |
commit | eb48eead2b029d5a85a9a58be4e30cb14d191ff0 (patch) | |
tree | 0a589a3c05247f2cc669ce3f65cf2006a9344e4f /indra/llwindow/llwindowwin32.cpp | |
parent | 203ef2f8d89a593ffe3af2f9556eebffd8d535a5 (diff) |
#3364 Cap intel adapters' vram to 25% of ram
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 91437b98d1..547da681b3 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -44,6 +44,7 @@ #include "llstring.h" #include "lldir.h" #include "llsdutil.h" +#include "llsys.h" #include "llglslshader.h" #include "llthreadsafequeue.h" #include "stringize.h" @@ -4681,6 +4682,23 @@ void LLWindowWin32::LLWindowWin32Thread::checkDXMem() // Alternatively use GetDesc from below to get adapter's memory UINT64 budget_mb = info.Budget / (1024 * 1024); + if (gGLManager.mIsIntel) + { + U32Megabytes phys_mb = gSysMemory.getPhysicalMemoryKB(); + LL_WARNS() << "Physical memory: " << phys_mb << " MB" << LL_ENDL; + + if (phys_mb > 0) + { + // Intel uses 'shared' vram, cap it to 25% of total memory + // Todo: consider caping all adapters at least to 50% ram + budget_mb = llmin(budget_mb, (UINT64)(phys_mb * 0.25)); + } + else + { + // if no data available, cap to 2Gb + budget_mb = llmin(budget_mb, (UINT64)2048); + } + } if (gGLManager.mVRAM < (S32)budget_mb) { gGLManager.mVRAM = (S32)budget_mb; |