From a52aaf22ba50f5878b9a8fdc6aba84bfbf682c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Telesi=C5=84ski?= Date: Tue, 18 Aug 2015 21:38:14 +0200 Subject: VideoCommon: Allow more Ram for HiresTexture if system memory is over 4GB --- Source/Core/VideoCommon/HiresTextures.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/HiresTextures.cpp') diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index efe3ab58bc..e6f687a551 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -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) { -- cgit v1.2.3 From 8fdb013d540cf5d79a23888053fda2897f997e61 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 4 Sep 2015 19:44:39 -0400 Subject: General: Toss out PRI macro usage Now that VS supports more printf specifiers, these aren't necessary --- Source/Core/VideoCommon/HiresTextures.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/HiresTextures.cpp') diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index e6f687a551..3057740f0e 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -259,8 +259,8 @@ std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, co u64 tex_hash = XXH64(texture, texture_size, 0); u64 tlut_hash = tlut_size ? XXH64(tlut, tlut_size, 0) : 0; - std::string basename = s_format_prefix + StringFromFormat("%dx%d%s_%016" PRIx64, width, height, has_mipmaps ? "_m" : "", tex_hash); - std::string tlutname = tlut_size ? StringFromFormat("_%016" PRIx64, tlut_hash) : ""; + std::string basename = s_format_prefix + StringFromFormat("%dx%d%s_%016llx", width, height, has_mipmaps ? "_m" : "", tex_hash); + std::string tlutname = tlut_size ? StringFromFormat("_%016llx", tlut_hash) : ""; std::string formatname = StringFromFormat("_%d", format); std::string fullname = basename + tlutname + formatname; -- cgit v1.2.3 From 19459e827f6c15f9429598015019ecb66f2e6cad Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 8 Sep 2015 01:44:37 -0400 Subject: Partially revert "General: Toss out PRI macro usage" --- Source/Core/VideoCommon/HiresTextures.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/HiresTextures.cpp') diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index 3057740f0e..e6f687a551 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -259,8 +259,8 @@ std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, co u64 tex_hash = XXH64(texture, texture_size, 0); u64 tlut_hash = tlut_size ? XXH64(tlut, tlut_size, 0) : 0; - std::string basename = s_format_prefix + StringFromFormat("%dx%d%s_%016llx", width, height, has_mipmaps ? "_m" : "", tex_hash); - std::string tlutname = tlut_size ? StringFromFormat("_%016llx", tlut_hash) : ""; + std::string basename = s_format_prefix + StringFromFormat("%dx%d%s_%016" PRIx64, width, height, has_mipmaps ? "_m" : "", tex_hash); + std::string tlutname = tlut_size ? StringFromFormat("_%016" PRIx64, tlut_hash) : ""; std::string formatname = StringFromFormat("_%d", format); std::string fullname = basename + tlutname + formatname; -- cgit v1.2.3