summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-05-02 09:38:29 +0800
committerErik Kundiman <erik@megapahit.org>2024-05-02 09:38:29 +0800
commit41fbaed7a69d68651b32062cac0ed5c1d8008bb8 (patch)
tree65068bd3e13ce5748c143658e75311e3acc35263 /indra/llwindow
parentf2a488a4f907deba3624288d170e6e4d77ef63dd (diff)
Convert the detected VRAM on NVIDIA & ATI to MBs
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindowsdl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index e38186ff39..de09003e0e 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -690,11 +690,15 @@ 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)
+ if (!vram_megabytes) {
glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX,
(int *)&vram_megabytes);
- if (!vram_megabytes)
+ vram_megabytes /= 1024;
+ }
+ if (!vram_megabytes) {
glGetIntegerv(GL_VBO_FREE_MEMORY_ATI, (int *)&vram_megabytes);
+ vram_megabytes /= 1024;
+ }
gGLManager.mVRAM = vram_megabytes;
# endif // LL_DARWIN