diff options
author | Jacek Antonelli | 2009-06-13 13:17:14 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-06-13 13:17:20 -0500 |
commit | 0517fe4322443bdc317f8185590a63134e3f8394 (patch) | |
tree | 942c9c26d0792accc928010a113d123c5409659b /linden/indra/newview/llviewerimagelist.cpp | |
parent | Second Life viewer sources 1.23.2-RC (diff) | |
download | meta-impy-0517fe4322443bdc317f8185590a63134e3f8394.zip meta-impy-0517fe4322443bdc317f8185590a63134e3f8394.tar.gz meta-impy-0517fe4322443bdc317f8185590a63134e3f8394.tar.bz2 meta-impy-0517fe4322443bdc317f8185590a63134e3f8394.tar.xz |
Second Life viewer sources 1.23.3-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewerimagelist.cpp | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp index 3a41cf8..bd834a0 100644 --- a/linden/indra/newview/llviewerimagelist.cpp +++ b/linden/indra/newview/llviewerimagelist.cpp | |||
@@ -90,16 +90,16 @@ LLStat LLViewerImageList::sFormattedMemStat(32, TRUE); | |||
90 | LLViewerImageList::LLViewerImageList() | 90 | LLViewerImageList::LLViewerImageList() |
91 | : mForceResetTextureStats(FALSE), | 91 | : mForceResetTextureStats(FALSE), |
92 | mUpdateStats(FALSE), | 92 | mUpdateStats(FALSE), |
93 | mMaxResidentTexMem(0), | 93 | mMaxResidentTexMemInMegaBytes(0), |
94 | mMaxTotalTextureMem(0) | 94 | mMaxTotalTextureMemInMegaBytes(0) |
95 | { | 95 | { |
96 | } | 96 | } |
97 | 97 | ||
98 | void LLViewerImageList::init() | 98 | void LLViewerImageList::init() |
99 | { | 99 | { |
100 | sNumImages = 0; | 100 | sNumImages = 0; |
101 | mMaxResidentTexMem = 0; | 101 | mMaxResidentTexMemInMegaBytes = 0; |
102 | mMaxTotalTextureMem = 0 ; | 102 | mMaxTotalTextureMemInMegaBytes = 0 ; |
103 | 103 | ||
104 | if (gNoRender) | 104 | if (gNoRender) |
105 | { | 105 | { |
@@ -513,10 +513,10 @@ void LLViewerImageList::updateImages(F32 max_time) | |||
513 | llpushcallstacks ; | 513 | llpushcallstacks ; |
514 | sNumImagesStat.addValue(sNumImages); | 514 | sNumImagesStat.addValue(sNumImages); |
515 | sNumRawImagesStat.addValue(LLImageRaw::sRawImageCount); | 515 | sNumRawImagesStat.addValue(LLImageRaw::sRawImageCount); |
516 | sGLTexMemStat.addValue((F32)(LLImageGL::sGlobalTextureMemory >> 20)); | 516 | sGLTexMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sGlobalTextureMemoryInBytes)); |
517 | sGLBoundMemStat.addValue((F32)(LLImageGL::sBoundTextureMemory >> 20)); | 517 | sGLBoundMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sBoundTextureMemoryInBytes)); |
518 | sRawMemStat.addValue((F32)(LLImageRaw::sGlobalRawMemory >> 20)); | 518 | sRawMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageRaw::sGlobalRawMemory)); |
519 | sFormattedMemStat.addValue((F32)(LLImageFormatted::sGlobalFormattedMemory >> 20)); | 519 | sFormattedMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageFormatted::sGlobalFormattedMemory)); |
520 | 520 | ||
521 | llpushcallstacks ; | 521 | llpushcallstacks ; |
522 | updateImagesDecodePriorities(); | 522 | updateImagesDecodePriorities(); |
@@ -582,8 +582,8 @@ void LLViewerImageList::updateImagesDecodePriorities() | |||
582 | // | 582 | // |
583 | // Flush formatted images using a lazy flush | 583 | // Flush formatted images using a lazy flush |
584 | // | 584 | // |
585 | const F32 LAZY_FLUSH_TIMEOUT = 30.f; | 585 | const F32 LAZY_FLUSH_TIMEOUT = 30.f; // stop decoding |
586 | const F32 MAX_INACTIVE_TIME = 50.f ; | 586 | const F32 MAX_INACTIVE_TIME = 50.f; // actually delete |
587 | S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, 1 for local reference | 587 | S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, 1 for local reference |
588 | if (imagep->hasCallbacks()) | 588 | if (imagep->hasCallbacks()) |
589 | { | 589 | { |
@@ -983,16 +983,13 @@ LLPointer<LLImageJ2C> LLViewerImageList::convertToUploadFile(LLPointer<LLImageRa | |||
983 | 983 | ||
984 | return compressedImage; | 984 | return compressedImage; |
985 | } | 985 | } |
986 | |||
987 | const S32 MIN_VIDEO_RAM = 32; | ||
988 | const S32 MAX_VIDEO_RAM = 512; // 512MB max for performance reasons. | ||
989 | 986 | ||
990 | // Returns min setting for TextureMemory (in MB) | 987 | // Returns min setting for TextureMemory (in MB) |
991 | S32 LLViewerImageList::getMinVideoRamSetting() | 988 | S32 LLViewerImageList::getMinVideoRamSetting() |
992 | { | 989 | { |
993 | S32 system_ram = (S32)(gSysMemory.getPhysicalMemoryClamped() >> 20); | 990 | S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); |
994 | //min texture mem sets to 64M if total physical mem is more than 1.5GB | 991 | //min texture mem sets to 64M if total physical mem is more than 1.5GB |
995 | return (system_ram > 1500) ? 64 : MIN_VIDEO_RAM; | 992 | return (system_ram > 1500) ? 64 : MIN_VIDEO_RAM_IN_MEGA_BYTES ; |
996 | } | 993 | } |
997 | 994 | ||
998 | //static | 995 | //static |
@@ -1019,14 +1016,14 @@ S32 LLViewerImageList::getMaxVideoRamSetting(bool get_recommended) | |||
1019 | llwarns << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << llendl; | 1016 | llwarns << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << llendl; |
1020 | } | 1017 | } |
1021 | 1018 | ||
1022 | S32 system_ram = (S32)(gSysMemory.getPhysicalMemoryClamped() >> 20); // In MB | 1019 | S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); // In MB |
1023 | //llinfos << "*** DETECTED " << system_ram << " MB of system memory." << llendl; | 1020 | //llinfos << "*** DETECTED " << system_ram << " MB of system memory." << llendl; |
1024 | if (get_recommended) | 1021 | if (get_recommended) |
1025 | max_texmem = llmin(max_texmem, (S32)(system_ram/2)); | 1022 | max_texmem = llmin(max_texmem, (S32)(system_ram/2)); |
1026 | else | 1023 | else |
1027 | max_texmem = llmin(max_texmem, (S32)(system_ram)); | 1024 | max_texmem = llmin(max_texmem, (S32)(system_ram)); |
1028 | 1025 | ||
1029 | max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), MAX_VIDEO_RAM); | 1026 | max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), MAX_VIDEO_RAM_IN_MEGA_BYTES); |
1030 | 1027 | ||
1031 | return max_texmem; | 1028 | return max_texmem; |
1032 | } | 1029 | } |
@@ -1063,17 +1060,17 @@ void LLViewerImageList::updateMaxResidentTexMem(S32 mem) | |||
1063 | 1060 | ||
1064 | S32 vb_mem = mem; | 1061 | S32 vb_mem = mem; |
1065 | S32 fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4); | 1062 | S32 fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4); |
1066 | mMaxResidentTexMem = (vb_mem - fb_mem) ; //in MB | 1063 | mMaxResidentTexMemInMegaBytes = (vb_mem - fb_mem) ; //in MB |
1067 | 1064 | ||
1068 | mMaxTotalTextureMem = mMaxResidentTexMem * 2; | 1065 | mMaxTotalTextureMemInMegaBytes = mMaxResidentTexMemInMegaBytes * 2; |
1069 | if (mMaxResidentTexMem > 640) | 1066 | if (mMaxResidentTexMemInMegaBytes > 640) |
1070 | { | 1067 | { |
1071 | mMaxTotalTextureMem -= (mMaxResidentTexMem >> 2); | 1068 | mMaxTotalTextureMemInMegaBytes -= (mMaxResidentTexMemInMegaBytes >> 2); |
1072 | } | 1069 | } |
1073 | 1070 | ||
1074 | if (mMaxTotalTextureMem > (S32)(gSysMemory.getPhysicalMemoryClamped() >> 20) - 128) | 1071 | if (mMaxTotalTextureMemInMegaBytes > (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()) - 128) |
1075 | { | 1072 | { |
1076 | mMaxTotalTextureMem = (gSysMemory.getPhysicalMemoryClamped() >> 20) - 128 ; | 1073 | mMaxTotalTextureMemInMegaBytes = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()) - 128 ; |
1077 | } | 1074 | } |
1078 | 1075 | ||
1079 | llinfos << "Total Video Memory set to: " << vb_mem << " MB" << llendl; | 1076 | llinfos << "Total Video Memory set to: " << vb_mem << " MB" << llendl; |