summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-05-01 12:35:18 +0800
committerErik Kundiman <erik@megapahit.org>2024-05-01 12:35:18 +0800
commit4cd2958ca36058e8509fc7463ed8a511bd544d47 (patch)
tree985e0d024c645fff36040efb499fb2d07e669992 /indra/llwindow
parentf7b2c0d7d95ca8609a948a7d11b44534d8ac5249 (diff)
Attempt to detect NVIDIA & ATI VRAM
Done in a simple way, without checking the GLX extension string.
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindowsdl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index f56b6bfa7b..ed019ad82c 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -690,6 +690,12 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
"glXQueryCurrentRendererIntegerMESA");
unsigned int vram_megabytes = 0;
queryInteger(GLX_RENDERER_VIDEO_MEMORY_MESA, &vram_megabytes);
+ if (!vram_megabytes)
+ queryInteger(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX,
+ &vram_megabytes);
+ if (!vram_megabytes)
+ queryInteger(GL_VBO_FREE_MEMORY_ATI, &vram_megabytes);
+
gGLManager.mVRAM = vram_megabytes;
# endif // LL_DARWIN
if (gGLManager.mVRAM)