diff options
author | Dave Parks <davep@lindenlab.com> | 2011-03-10 00:41:46 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-03-10 00:41:46 -0600 |
commit | 5fd953df8fafb769d31688c47cf3f8634f858de5 (patch) | |
tree | 7a0f38e57a4132e78f5e1e61dd316adec7e6355a /indra/newview | |
parent | d46594bf714cd19ebcbf693463c4d39e4c771bb8 (diff) |
SH-874 Properly detect available video memory on ATI cards and disable vertex buffer objects when available vram is under 256MB.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/featuretable.txt | 6 | ||||
-rw-r--r-- | indra/newview/featuretable_xp.txt | 6 | ||||
-rw-r--r-- | indra/newview/llappviewerwin32.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llfeaturemanager.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 17 |
5 files changed, 36 insertions, 3 deletions
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index afc268d7a5..6022153020 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,4 +1,4 @@ -version 26
+version 27
// NOTE: This is mostly identical to featuretable_mac.txt with a few differences
// Should be combined into one table
@@ -465,6 +465,10 @@ list ATI RenderUseStreamVBO 1 0
RenderAvatarVP 1 0
+// Disable vertex buffer objects by default for ATI cards with little video memory
+list ATIVramLT256
+RenderVBOEnable 1 0
+
/// Tweaked NVIDIA
list NVIDIA_GeForce_FX_5100
diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index d87c3db111..6976bcf102 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.txt @@ -1,4 +1,4 @@ -version 26
+version 27
// NOTE: This is mostly identical to featuretable_mac.txt with a few differences
// Should be combined into one table
@@ -458,6 +458,10 @@ list ATI RenderUseStreamVBO 1 0
RenderAvatarVP 1 0
+// Disable vertex buffer objects by default for ATI cards with little video memory
+list ATIVramLT256
+RenderVBOEnable 1 0
+
/// Tweaked NVIDIA
list NVIDIA_GeForce_FX_5100
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index d328567a0e..54689ea808 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -440,7 +440,11 @@ bool LLAppViewerWin32::initHardwareTest() LL_WARNS("AppInit") << " Someone took over my exception handler (post hardware probe)!" << LL_ENDL; } - gGLManager.mVRAM = gDXHardware.getVRAM(); + if (gGLManager.mVRAM == 0) + { + gGLManager.mVRAM = gDXHardware.getVRAM(); + } + LL_INFOS("AppInit") << "Detected VRAM: " << gGLManager.mVRAM << LL_ENDL; return true; diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index edfc4538a1..9f0b34becc 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -729,6 +729,10 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("ATI"); } + if (gGLManager.mHasATIMemInfo && gGLManager.mVRAM < 256) + { + maskFeatures("ATIVramLT256"); + } if (gGLManager.mATIOldDriver) { maskFeatures("ATIOldDriver"); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d5008c12b0..1c573eab00 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -457,6 +457,23 @@ public: addText(xpos, ypos, "Shaders Disabled"); ypos += y_inc; } + + if (gGLManager.mHasATIMemInfo) + { + S32 meminfo[4]; + glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo); + + addText(xpos, ypos, llformat("%.2f MB Texture Memory Free", meminfo[0]/1024.f)); + ypos += y_inc; + + if (gGLManager.mHasVertexBufferObject) + { + glGetIntegerv(GL_VBO_FREE_MEMORY_ATI, meminfo); + addText(xpos, ypos, llformat("%.2f MB VBO Memory Free", meminfo[0]/1024.f)); + ypos += y_inc; + } + } + addText(xpos, ypos, llformat("%d MB Vertex Data", LLVertexBuffer::sAllocatedBytes/(1024*1024))); ypos += y_inc; |