From f81b1c14d01448e325ea2123ccd3758d3bf94e0e Mon Sep 17 00:00:00 2001 From: kd-11 Date: Tue, 3 Mar 2020 22:54:00 +0300 Subject: [PATCH] rsx/blit-engine: Account for a rare corner case - It is possible to have a RTV<->DSV transfer with compatible-sized formats. Mark the depth size as typeless in such a situation to avoid crossing the aspect barrier with the API. --- rpcs3/Emu/RSX/Common/texture_cache.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index 1f4c242ff073..09ad9047b937 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -2745,9 +2745,28 @@ namespace rsx dst_subres.surface->transform_blit_coordinates(rsx::surface_access::transfer, dst_area); } - if (!use_null_region) + if (!use_null_region) [[likely]] { + // Do preliminary analysis typeless_info.analyse(); + + if (dst_is_render_target && src_is_render_target && + dst_subres.is_depth != src_subres.is_depth) [[unlikely]] + { + // Rare corner case. Typeless transfer from whatever channel is Z + if (!typeless_info.src_is_typeless && !typeless_info.dst_is_typeless) + { + if (dst_subres.is_depth) + { + typeless_info.dst_is_typeless = true; + } + else + { + typeless_info.src_is_typeless = true; + } + } + } + blitter.scale_image(cmd, vram_texture, dest_texture, src_area, dst_area, interpolate, typeless_info); } else