diff --git a/Core/TextureReplacer.cpp b/Core/TextureReplacer.cpp index c58142baa5..7fa1fd62ca 100644 --- a/Core/TextureReplacer.cpp +++ b/Core/TextureReplacer.cpp @@ -166,7 +166,7 @@ u32 TextureReplacer::ComputeHash(u32 addr, int bufw, int w, int h, GETextureForm } } -ReplacedTexture TextureReplacer::FindReplacement(u64 cachekey, u32 hash) { +ReplacedTexture TextureReplacer::FindReplacement(u64 cachekey, u32 hash, int w, int h) { _assert_msg_(G3D, enabled_, "Replacement not enabled"); ReplacedTexture result; @@ -179,6 +179,7 @@ ReplacedTexture TextureReplacer::FindReplacement(u64 cachekey, u32 hash) { if (!hashfile.empty() && File::Exists(filename)) { // TODO: Count levels that exist, etc. + // TODO: Use w/h to determine actual size based on hash range (png may be smaller)? } } return result; diff --git a/Core/TextureReplacer.h b/Core/TextureReplacer.h index 0628e1f01d..dcb91cda08 100644 --- a/Core/TextureReplacer.h +++ b/Core/TextureReplacer.h @@ -107,7 +107,7 @@ public: u32 ComputeHash(u32 addr, int bufw, int w, int h, GETextureFormat fmt, u16 maxSeenV); - ReplacedTexture FindReplacement(u64 cachekey, u32 hash); + ReplacedTexture FindReplacement(u64 cachekey, u32 hash, int w, int h); void NotifyTextureDecoded(u64 cachekey, u32 hash, u32 addr, const void *data, int pitch, int level, int w, int h, ReplacedTextureFormat fmt); diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index c281464647..8133b508a6 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -1255,7 +1255,7 @@ void TextureCacheDX9::SetTexture(bool force) { scaleFactor = scaleFactor > 4 ? 4 : (scaleFactor > 2 ? 2 : 1); } - ReplacedTexture replaced = replacer.FindReplacement(cachekey, entry->fullhash); + ReplacedTexture replaced = replacer.FindReplacement(cachekey, entry->fullhash, w, h); if (replaced.GetSize(0, w, h)) { // We're replacing, so we won't scale. scaleFactor = 1; diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index a7a8f7f579..3f695c668c 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -1364,7 +1364,7 @@ void TextureCache::SetTexture(bool force) { scaleFactor = scaleFactor > 4 ? 4 : (scaleFactor > 2 ? 2 : 1); } - ReplacedTexture replaced = replacer.FindReplacement(cachekey, entry->fullhash); + ReplacedTexture replaced = replacer.FindReplacement(cachekey, entry->fullhash, w, h); if (replaced.GetSize(0, w, h)) { // We're replacing, so we won't scale. scaleFactor = 1; diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index ce9d22298a..a1418201f2 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -1237,7 +1237,7 @@ void TextureCacheVulkan::SetTexture(VulkanPushBuffer *uploadBuffer) { scaleFactor = scaleFactor > 4 ? 4 : (scaleFactor > 2 ? 2 : 1); } - ReplacedTexture replaced = replacer.FindReplacement(cachekey, entry->fullhash); + ReplacedTexture replaced = replacer.FindReplacement(cachekey, entry->fullhash, w, h); if (replaced.GetSize(0, w, h)) { // We're replacing, so we won't scale. scaleFactor = 1;