From a8e22e11c5d26b3cdfa2d67919fdde8272d52ea4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 27 Feb 2014 17:49:50 -0600 Subject: MAINT-2980 Rename "Texture Memory" to "Video Memory" in hardware floater and increase limit. Limit should be however much vram is installed, but underneath the hood, fudge how much memory is used for textures to avoid swapping. Also, catch exceptions when attempting to build a GL context on windows and display an error dialog instead of crashing. --- indra/newview/llfloaterhardwaresettings.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterhardwaresettings.cpp') diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 792a2a5d25..6923308ce9 100755 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -87,15 +87,30 @@ void LLFloaterHardwareSettings::refresh() refreshEnabledState(); } +void LLFloaterHardwareSettings::onSetVRAM() +{ + S32 vram = childGetValue("GraphicsCardTextureMemory").asInteger(); + + //give the texture system plenty of leeway to avoid swapping + vram /= 3; + + gSavedSettings.setS32("TextureMemory", vram); +} + void LLFloaterHardwareSettings::refreshEnabledState() { F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); S32 min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); - S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); + S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(true, mem_multiplier); getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem); getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem); + S32 vram = gSavedSettings.getS32("TextureMemory"); + vram = vram*3; + + getChild("GraphicsCardTextureMemory")->setValue(vram); + getChild("GraphicsCardTextureMemory")->setCommitCallback(boost::bind(&LLFloaterHardwareSettings::onSetVRAM, this)); if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) { -- cgit v1.2.3