diff options
author | Jacek Antonelli | 2008-12-01 17:39:58 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-01 17:40:06 -0600 |
commit | 7abecb48babe6a6f09bf6692ba55076546cfced9 (patch) | |
tree | 8d18a88513fb97adf32c10aae78f4be1984942db /linden/indra/newview/llviewerimagelist.cpp | |
parent | Second Life viewer sources 1.21.6 (diff) | |
download | meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.zip meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.gz meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.bz2 meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.xz |
Second Life viewer sources 1.22.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewerimagelist.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp index a79a76a..1e58fce 100644 --- a/linden/indra/newview/llviewerimagelist.cpp +++ b/linden/indra/newview/llviewerimagelist.cpp | |||
@@ -89,7 +89,8 @@ LLStat LLViewerImageList::sFormattedMemStat(32, TRUE); | |||
89 | LLViewerImageList::LLViewerImageList() | 89 | LLViewerImageList::LLViewerImageList() |
90 | : mForceResetTextureStats(FALSE), | 90 | : mForceResetTextureStats(FALSE), |
91 | mUpdateStats(FALSE), | 91 | mUpdateStats(FALSE), |
92 | mMaxResidentTexMem(0) | 92 | mMaxResidentTexMem(0), |
93 | mMaxTotalTextureMem(0) | ||
93 | { | 94 | { |
94 | } | 95 | } |
95 | 96 | ||
@@ -97,6 +98,7 @@ void LLViewerImageList::init() | |||
97 | { | 98 | { |
98 | sNumImages = 0; | 99 | sNumImages = 0; |
99 | mMaxResidentTexMem = 0; | 100 | mMaxResidentTexMem = 0; |
101 | mMaxTotalTextureMem = 0 ; | ||
100 | 102 | ||
101 | if (gNoRender) | 103 | if (gNoRender) |
102 | { | 104 | { |
@@ -918,12 +920,14 @@ LLPointer<LLImageJ2C> LLViewerImageList::convertToUploadFile(LLPointer<LLImageRa | |||
918 | } | 920 | } |
919 | 921 | ||
920 | const S32 MIN_VIDEO_RAM = 32; | 922 | const S32 MIN_VIDEO_RAM = 32; |
921 | const S32 MAX_VIDEO_RAM = 2048; | 923 | const S32 MAX_VIDEO_RAM = 512; // 512MB max for performance reasons. |
922 | 924 | ||
923 | // Returns min setting for TextureMemory (in MB) | 925 | // Returns min setting for TextureMemory (in MB) |
924 | S32 LLViewerImageList::getMinVideoRamSetting() | 926 | S32 LLViewerImageList::getMinVideoRamSetting() |
925 | { | 927 | { |
926 | return MIN_VIDEO_RAM; | 928 | S32 system_ram = (S32)(gSysMemory.getPhysicalMemoryClamped() >> 20); |
929 | //min texture mem sets to 128M if total physical mem is more than 1.5GB | ||
930 | return (system_ram > 1500) ? 128 : MIN_VIDEO_RAM; | ||
927 | } | 931 | } |
928 | 932 | ||
929 | //static | 933 | //static |
@@ -956,8 +960,8 @@ S32 LLViewerImageList::getMaxVideoRamSetting(bool get_recommended) | |||
956 | max_texmem = llmin(max_texmem, (S32)(system_ram/2)); | 960 | max_texmem = llmin(max_texmem, (S32)(system_ram/2)); |
957 | else | 961 | else |
958 | max_texmem = llmin(max_texmem, (S32)(system_ram)); | 962 | max_texmem = llmin(max_texmem, (S32)(system_ram)); |
959 | 963 | ||
960 | max_texmem = llclamp(max_texmem, MIN_VIDEO_RAM, MAX_VIDEO_RAM); | 964 | max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), MAX_VIDEO_RAM); |
961 | 965 | ||
962 | return max_texmem; | 966 | return max_texmem; |
963 | } | 967 | } |
@@ -994,7 +998,18 @@ void LLViewerImageList::updateMaxResidentTexMem(S32 mem) | |||
994 | 998 | ||
995 | S32 vb_mem = mem; | 999 | S32 vb_mem = mem; |
996 | S32 fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4); | 1000 | S32 fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4); |
997 | mMaxResidentTexMem = (vb_mem - fb_mem)<<20; | 1001 | mMaxResidentTexMem = (vb_mem - fb_mem) ; //in MB |
1002 | |||
1003 | mMaxTotalTextureMem = mMaxResidentTexMem * 2; | ||
1004 | if (mMaxResidentTexMem > 640) | ||
1005 | { | ||
1006 | mMaxTotalTextureMem -= (mMaxResidentTexMem >> 2); | ||
1007 | } | ||
1008 | |||
1009 | if (mMaxTotalTextureMem > (S32)(gSysMemory.getPhysicalMemoryClamped() >> 20) - 128) | ||
1010 | { | ||
1011 | mMaxTotalTextureMem = (gSysMemory.getPhysicalMemoryClamped() >> 20) - 128 ; | ||
1012 | } | ||
998 | 1013 | ||
999 | llinfos << "Total Video Memory set to: " << vb_mem << " MB" << llendl; | 1014 | llinfos << "Total Video Memory set to: " << vb_mem << " MB" << llendl; |
1000 | llinfos << "Available Texture Memory set to: " << (vb_mem - fb_mem) << " MB" << llendl; | 1015 | llinfos << "Available Texture Memory set to: " << (vb_mem - fb_mem) << " MB" << llendl; |