diff options
Diffstat (limited to 'indra/newview/llfloaterhardwaresettings.cpp')
-rwxr-xr-x | indra/newview/llfloaterhardwaresettings.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
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<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem); getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem); + S32 vram = gSavedSettings.getS32("TextureMemory"); + vram = vram*3; + + getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setValue(vram); + getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setCommitCallback(boost::bind(&LLFloaterHardwareSettings::onSetVRAM, this)); if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) { |