From 868547aec806cad2b2f9c00e123ffd5f084154fd Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 13 Oct 2019 22:56:56 +0300 Subject: [PATCH] rsx: Minor improvement to fbo region invalidation - When commiting a block as fbo, keep blit_dst data as well. - Avoids removing (and losing data from) blit targets that just happen to share a page with a framebuffer. --- rpcs3/Emu/RSX/Common/texture_cache.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index 9f8c2e3e49..37e4ae51c3 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -743,10 +743,10 @@ namespace rsx if (tex.overlaps(fault_range, section_bounds::locked_range)) { if (cause == invalidation_cause::superseded_by_fbo && - tex.get_context() == texture_upload_context::framebuffer_storage && + tex.is_flushable() && tex.get_section_base() != fault_range_in.start) { - // HACK: When being superseded by an fbo, we preserve other overlapped fbos unless the start addresses match + // HACK: When being superseded by an fbo, we preserve overlapped flushables unless the start addresses match continue; } else if (tex.inside(fault_range, section_bounds::locked_range)) @@ -807,9 +807,9 @@ namespace rsx !tex.inside(trampled_set.invalidate_range, bounds) || // Unsynchronized sections (or any flushable when skipping flushes) that do not overlap the fault range directly can also be ignored (invalidation_ignore_unsynchronized && tex.is_flushable() && (cause.skip_flush() || !tex.is_synchronized()) && !overlaps_fault_range) || - // HACK: When being superseded by an fbo, we preserve other overlapped fbos unless the start addresses match - // If region is committed as fbo, all non-fbo data is removed but all fbos in the region must be preserved if possible - (overlaps_fault_range && tex.get_context() == texture_upload_context::framebuffer_storage && cause.skip_fbos() && tex.get_section_base() != fault_range_in.start) + // HACK: When being superseded by an fbo, we preserve other overlapped flushables unless the start addresses match + // If region is committed as fbo, all non-flushable data is removed but all flushables in the region must be preserved if possible + (overlaps_fault_range && tex.is_flushable() && cause.skip_fbos() && tex.get_section_base() != fault_range_in.start) ) { // False positive