From 770a0a2dea0bd503f88b35d3d440208bcd303e54 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 7 Jul 2014 10:28:54 -0500 Subject: MAINT-2980 Back out most changes related to upping the 512MB texture cap to unblock RC. --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llviewertexture.cpp | 2 +- indra/newview/llviewertexturelist.cpp | 35 +++++++++++++++------- .../default/xui/en/floater_hardware_settings.xml | 4 +-- 4 files changed, 29 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3c39c021ca..12db188620 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11873,7 +11873,7 @@ TextureMemory Comment - 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. + Amount of memory to use for textures in MB (0 = autodetect) Persist 1 Type diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index e16caf167d..ba89aafc84 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -64,7 +64,7 @@ // extern const S32Megabytes gMinVideoRam(32); -const S32Megabytes gMaxVideoRam(4096); +const S32Megabytes gMaxVideoRam(512); // statics diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 9f862b4f97..b98726900f 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1275,37 +1275,52 @@ S32Megabytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, fl { S32Megabytes max_texmem; if (gGLManager.mVRAM != 0) - { //use detected amount of vram as maximum + { + // Treat any card with < 32 MB (shudder) as having 32 MB + // - it's going to be swapping constantly regardless S32Megabytes max_vram(gGLManager.mVRAM); - max_texmem = max_vram; - - if (get_recommended) - { //recommend 1/3rd of total video memory for textures - max_texmem /= 3; + if(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; } else { if (!get_recommended) { - max_texmem = (S32Megabytes) 2048; + max_texmem = (S32Megabytes)512; } else if (gSavedSettings.getBOOL("NoHardwareProbe")) //did not do hardware detection at startup { - max_texmem = (S32Megabytes) 2048; + max_texmem = (S32Megabytes)512; } else { - max_texmem = (S32Megabytes) 512; + max_texmem = (S32Megabytes)128; } LL_WARNS() << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << LL_ENDL; } - // limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise + S32Megabytes system_ram = gSysMemory.getPhysicalMemoryClamped(); // In MB + //LL_INFOS() << "*** DETECTED " << system_ram << " MB of system memory." << LL_ENDL; + if (get_recommended) + max_texmem = llmin(max_texmem, system_ram/2); + else + max_texmem = llmin(max_texmem, system_ram); + + // 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; } 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 40d54233e8..9deb0d2030 100755 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -155,9 +155,9 @@ tool_tip="Compresses textures in video memory, allowing for higher resolution textures to be loaded at the cost of some color quality." width="315" />