From 7abecb48babe6a6f09bf6692ba55076546cfced9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Mon, 1 Dec 2008 17:39:58 -0600 Subject: Second Life viewer sources 1.22.0-RC --- linden/indra/newview/llviewerimagelist.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'linden/indra/newview/llviewerimagelist.cpp') 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); LLViewerImageList::LLViewerImageList() : mForceResetTextureStats(FALSE), mUpdateStats(FALSE), - mMaxResidentTexMem(0) + mMaxResidentTexMem(0), + mMaxTotalTextureMem(0) { } @@ -97,6 +98,7 @@ void LLViewerImageList::init() { sNumImages = 0; mMaxResidentTexMem = 0; + mMaxTotalTextureMem = 0 ; if (gNoRender) { @@ -918,12 +920,14 @@ LLPointer LLViewerImageList::convertToUploadFile(LLPointer> 20); + //min texture mem sets to 128M if total physical mem is more than 1.5GB + return (system_ram > 1500) ? 128 : MIN_VIDEO_RAM; } //static @@ -956,8 +960,8 @@ S32 LLViewerImageList::getMaxVideoRamSetting(bool get_recommended) max_texmem = llmin(max_texmem, (S32)(system_ram/2)); else max_texmem = llmin(max_texmem, (S32)(system_ram)); - - max_texmem = llclamp(max_texmem, MIN_VIDEO_RAM, MAX_VIDEO_RAM); + + max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), MAX_VIDEO_RAM); return max_texmem; } @@ -994,7 +998,18 @@ void LLViewerImageList::updateMaxResidentTexMem(S32 mem) S32 vb_mem = mem; S32 fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4); - mMaxResidentTexMem = (vb_mem - fb_mem)<<20; + mMaxResidentTexMem = (vb_mem - fb_mem) ; //in MB + + mMaxTotalTextureMem = mMaxResidentTexMem * 2; + if (mMaxResidentTexMem > 640) + { + mMaxTotalTextureMem -= (mMaxResidentTexMem >> 2); + } + + if (mMaxTotalTextureMem > (S32)(gSysMemory.getPhysicalMemoryClamped() >> 20) - 128) + { + mMaxTotalTextureMem = (gSysMemory.getPhysicalMemoryClamped() >> 20) - 128 ; + } llinfos << "Total Video Memory set to: " << vb_mem << " MB" << llendl; llinfos << "Available Texture Memory set to: " << (vb_mem - fb_mem) << " MB" << llendl; -- cgit v1.1