From 90ee53f5a1ac47ec5f8eb84bc543376a089e0d55 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 23 Jun 2014 23:10:23 -0500 Subject: MAINT-2980 Up texture memory slider cap to 4096MB. Make "Texture Memory" default to 1/3rd of video memory. Add description on debug setting and tooltip to explain why. --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llfloaterhardwaresettings.cpp | 15 ------------ indra/newview/llfloaterhardwaresettings.h | 2 -- indra/newview/llviewertexture.cpp | 2 +- indra/newview/llviewertexturelist.cpp | 28 +++++++--------------- .../default/xui/en/floater_hardware_settings.xml | 5 ++-- 6 files changed, 13 insertions(+), 41 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6081729687..a2a8cf989d 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11862,7 +11862,7 @@ TextureMemory Comment - Amount of memory to use for textures in MB (0 = autodetect) + Amount of memory to use for textures in MB (0 = autodetect). Defaults to 1/3 of video memory to allow room for render targets, vertex buffers, 3D accelerated desktops, and over allocation. Persist 1 Type diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index f267a2e7b3..035eb307c2 100755 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -87,16 +87,6 @@ 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"); @@ -105,11 +95,6 @@ void LLFloaterHardwareSettings::refreshEnabledState() getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value()); - 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) { diff --git a/indra/newview/llfloaterhardwaresettings.h b/indra/newview/llfloaterhardwaresettings.h index 63d86d5667..626771b1d2 100755 --- a/indra/newview/llfloaterhardwaresettings.h +++ b/indra/newview/llfloaterhardwaresettings.h @@ -64,8 +64,6 @@ public: /// don't apply the changed values void cancel(); - void onSetVRAM(); - /// refresh the enabled values void refreshEnabledState(); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index ba89aafc84..e16caf167d 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -64,7 +64,7 @@ // extern const S32Megabytes gMinVideoRam(32); -const S32Megabytes gMaxVideoRam(512); +const S32Megabytes gMaxVideoRam(4096); // statics diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 2209b24ca7..9f862b4f97 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1275,21 +1275,15 @@ S32Megabytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, fl { S32Megabytes max_texmem; if (gGLManager.mVRAM != 0) - { - // Treat any card with < 32 MB (shudder) as having 32 MB - // - it's going to be swapping constantly regardless + { //use detected amount of vram as maximum S32Megabytes max_vram(gGLManager.mVRAM); - if(!get_recommended && gGLManager.mIsATI) - { - //shrink the availabe vram for ATI cards because some of them do not handel texture swapping well. - max_vram = max_vram * 0.75f; - } - - max_vram = llmax(max_vram, getMinVideoRamSetting()); max_texmem = max_vram; - if (!get_recommended) - max_texmem *= 2; + + if (get_recommended) + { //recommend 1/3rd of total video memory for textures + max_texmem /= 3; + } } else { @@ -1309,15 +1303,9 @@ S32Megabytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, fl LL_WARNS() << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << LL_ENDL; } - S32Megabytes system_ram = gSysMemory.getPhysicalMemoryClamped(); // In MB - //LL_INFOS() << "*** DETECTED " << system_ram << " MB of system memory." << LL_ENDL; - max_texmem = llmin(max_texmem, (S32Megabytes)(system_ram)); - - // limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise + // limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise max_texmem = llmin(max_texmem, (S32Megabytes) (mem_multiplier * max_texmem)); - max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), gMaxVideoRam); - return max_texmem; } @@ -1341,7 +1329,7 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32Megabytes mem) mem = llclamp(mem, getMinVideoRamSetting(), getMaxVideoRamSetting(false, mem_multiplier)); if (mem != cur_mem) { - gSavedSettings.setS32("TextureMemory", mem.value()/3); + gSavedSettings.setS32("TextureMemory", mem.value()); return; //listener will re-enter this function } diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml index 05594c2d86..40d54233e8 100755 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -157,16 +157,17 @@