From c9e3a321b2a9338b5a0694c9300010e436a3d4a9 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sat, 12 Oct 2019 14:11:15 +0300 Subject: [PATCH] rsx: Fixup for surface cache scanning - Fix regression when gathering cubemaps --- rpcs3/Emu/RSX/Common/texture_cache.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index 259c9d6f8e..52b0cb3bb5 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -1499,8 +1499,8 @@ namespace rsx // Check surface cache early if the option is enabled if (options.prefer_surface_cache) { - // TODO: Should scan for block_height aka required_surface_height not simply attr.height - overlapping_fbos = m_rtts.get_merged_texture_memory_region(cmd, attr.address, attr.width, attr.height, attr.pitch, attr.bpp, rsx::surface_access::read); + const u16 block_h = (attr.depth * attr.slice_h); + overlapping_fbos = m_rtts.get_merged_texture_memory_region(cmd, attr.address, attr.width, block_h, attr.pitch, attr.bpp, rsx::surface_access::read); if (!overlapping_fbos.empty()) { @@ -1545,8 +1545,8 @@ namespace rsx if (!options.prefer_surface_cache) { // Now check for surface cache hits - // TODO: Should scan for block_height aka required_surface_height not simply attr.height - overlapping_fbos = m_rtts.get_merged_texture_memory_region(cmd, attr.address, attr.width, attr.height, attr.pitch, attr.bpp, rsx::surface_access::read); + const u16 block_h = (attr.depth * attr.slice_h); + overlapping_fbos = m_rtts.get_merged_texture_memory_region(cmd, attr.address, attr.width, block_h, attr.pitch, attr.bpp, rsx::surface_access::read); } if (!overlapping_fbos.empty() || !overlapping_locals.empty())