diff options
author | Dave Parks <davep@lindenlab.com> | 2022-08-30 10:46:36 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-08-30 10:46:36 -0500 |
commit | 197ac7cc2048fe4c259858f48946cd954782dfc2 (patch) | |
tree | d838e4708ede7d910680b00932b5777d5967838a /indra/llwindow/llwindowmacosx.cpp | |
parent | 302bf29242ef1acd6ef984d78c918a6f4b092a0a (diff) | |
parent | 14af7cabdb80e1de0f5cb2c7e299bd61bc3321cc (diff) |
Merge remote-tracking branch 'remotes/origin/DRTVWR-563' into DRTVWR-559
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rw-r--r-- | indra/llwindow/llwindowmacosx.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index bc4f07941b..4bcb9b3aef 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1222,6 +1222,16 @@ F32 LLWindowMacOSX::getPixelAspectRatio() return 1.f; } +U32 LLWindowMacOSX::getAvailableVRAMMegabytes() { + // MTL (and MoltenVK) has some additional gpu data, such as recommendedMaxWorkingSetSize and currentAllocatedSize. + // But these are not available for OpenGL and/or our current mimimum OS version. + // So we will estimate. + static const U32 mb = 1024*1024; + // We're asked for total available gpu memory, but we only have allocation info on texture usage. So estimate by doubling that. + static const U32 total_factor = 2; // estimated total/textures + return gGLManager.mVRAM - (LLImageGL::getTextureBytesAllocated() * total_factor/mb); +} + //static SInt32 oldWindowLevel; // MBW -- XXX -- There's got to be a better way than this. Find it, please... |