summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-12-12 20:21:21 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-12-12 20:21:21 +0200
commitaa90985d677dfea573216b1a3a58acaa3b866656 (patch)
treeff53630671782aa54a1e694289780f38e1041134 /indra/newview
parent701ae96ff685847c8ddb46a4460fd70940733255 (diff)
SL-10231 Bug in texture cache size computation
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lltexturecache.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 633e025478..eb4b914e18 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -1038,11 +1038,11 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL texture_cache
{
llassert_always(getPending() == 0) ; //should not start accessing the texture cache before initialized.
- S64 header_size = (max_size / 100) * 36; //0.36 * max_size
- S64 max_entries = header_size / (TEXTURE_CACHE_ENTRY_SIZE + TEXTURE_FAST_CACHE_ENTRY_SIZE);
+ S64 entries_size = (max_size * 36) / 100; //0.36 * max_size
+ S64 max_entries = entries_size / (TEXTURE_CACHE_ENTRY_SIZE + TEXTURE_FAST_CACHE_ENTRY_SIZE);
sCacheMaxEntries = (S32)(llmin((S64)sCacheMaxEntries, max_entries));
- header_size = sCacheMaxEntries * TEXTURE_CACHE_ENTRY_SIZE;
- max_size -= header_size;
+ entries_size = sCacheMaxEntries * (TEXTURE_CACHE_ENTRY_SIZE + TEXTURE_FAST_CACHE_ENTRY_SIZE);
+ max_size -= entries_size;
if (sCacheMaxTexturesSize > 0)
sCacheMaxTexturesSize = llmin(sCacheMaxTexturesSize, max_size);
else