summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 7e682fc83b..53c075450a 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3586,10 +3586,12 @@ bool LLAppViewer::initCache()
// Init the texture cache
// Allocate 80% of the cache size for textures
const S32 MB = 1024 * 1024;
- S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB;
- const S64 MAX_CACHE_SIZE = 10 * 1024ll * MB;
+ const S64 MIN_CACHE_SIZE = 64 * MB;
+ const S64 MAX_CACHE_SIZE = 9984ll * MB;
const S64 MAX_VFS_SIZE = 1024 * MB; // 1 GB
- cache_size = llmin(cache_size, MAX_CACHE_SIZE);
+
+ S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB;
+ cache_size = llclamp(cache_size, MIN_CACHE_SIZE, MAX_CACHE_SIZE);
S64 texture_cache_size = ((cache_size * 8) / 10);
S64 vfs_size = cache_size - texture_cache_size;