File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 44
44
#include " llstring.h"
45
45
#include " lldir.h"
46
46
#include " llsdutil.h"
47
+ #include " llsys.h"
47
48
#include " llglslshader.h"
48
49
#include " llthreadsafequeue.h"
49
50
#include " stringize.h"
@@ -4681,6 +4682,23 @@ void LLWindowWin32::LLWindowWin32Thread::checkDXMem()
4681
4682
4682
4683
// Alternatively use GetDesc from below to get adapter's memory
4683
4684
UINT64 budget_mb = info.Budget / (1024 * 1024 );
4685
+ if (gGLManager .mIsIntel )
4686
+ {
4687
+ U32Megabytes phys_mb = gSysMemory .getPhysicalMemoryKB ();
4688
+ LL_WARNS () << " Physical memory: " << phys_mb << " MB" << LL_ENDL;
4689
+
4690
+ if (phys_mb > 0 )
4691
+ {
4692
+ // Intel uses 'shared' vram, cap it to 25% of total memory
4693
+ // Todo: consider caping all adapters at least to 50% ram
4694
+ budget_mb = llmin (budget_mb, (UINT64)(phys_mb * 0.25 ));
4695
+ }
4696
+ else
4697
+ {
4698
+ // if no data available, cap to 2Gb
4699
+ budget_mb = llmin (budget_mb, (UINT64)2048 );
4700
+ }
4701
+ }
4684
4702
if (gGLManager .mVRAM < (S32)budget_mb)
4685
4703
{
4686
4704
gGLManager .mVRAM = (S32)budget_mb;
You can’t perform that action at this time.
0 commit comments