SL-10231 Bug in texture cache size computation
parent
701ae96ff6
commit
aa90985d67
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue