VideoCommon: Allow more Ram for HiresTexture if system memory is over 4GB

This commit is contained in:
Bartosz Telesiński 2015-08-18 21:38:14 +02:00
parent 4baaa3755e
commit a52aaf22ba

View File

@ -140,7 +140,10 @@ void HiresTexture::Prefetch()
Common::SetCurrentThreadName("Prefetcher");
size_t size_sum = 0;
size_t max_mem = MemPhysical() / 2;
size_t sys_mem = MemPhysical();
size_t recommended_min_mem = 2 * size_t(1024 * 1024 * 1024);
// keep 2GB memory for system stability if system RAM is 4GB+ - use half of memory in other cases
size_t max_mem = (sys_mem / 2 < recommended_min_mem) ? (sys_mem / 2) : (sys_mem - recommended_min_mem);
u32 starttime = Common::Timer::GetTimeMs();
for (const auto& entry : s_textureMap)
{