diff options
author | simon <none@none> | 2014-07-07 16:17:53 -0700 |
---|---|---|
committer | simon <none@none> | 2014-07-07 16:17:53 -0700 |
commit | bfa42c9e28075cb35f80e6fce7d1db0443027052 (patch) | |
tree | b4e209e91cd173473f3c2033487647c5eb8c6b5d /indra/newview/llviewertexturelist.cpp | |
parent | 114f7b5d0f46dfcbc9a94c1907e396b6e02700f6 (diff) | |
parent | 3e6698073cedc8b24068147cf6b7091f081ea125 (diff) |
Merge downstream code and become 3.7.12
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rwxr-xr-x | indra/newview/llviewertexturelist.cpp | 35 |
1 files changed, 25 insertions, 10 deletions
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; } |