From 666f06eacecdcde2b5562b20b5231fdf1172b7b2 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 10 Mar 2011 11:46:16 -0600
Subject: SH-874 Followup -- use GL_NVX_gpu_memory_info for NVIDIA chips to
 detect actual installed and available VRAM.

---
 indra/newview/llviewerwindow.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 093e94add0..f665f39e9c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -481,6 +481,13 @@ public:
 					ypos += y_inc;
 				}
 			}
+			else if (gGLManager.mHasNVXMemInfo)
+			{
+				S32 free_memory;
+				glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &free_memory);
+				addText(xpos, ypos, llformat("%.2f MB Video Memory Free", free_memory/1024.f));
+				ypos += y_inc;
+			}
 
 			addText(xpos, ypos, llformat("%d MB Vertex Data", LLVertexBuffer::sAllocatedBytes/(1024*1024)));
 			ypos += y_inc;
-- 
cgit v1.2.3