From 23b52e1b1c0b74eb43faf0ff065ecfe44ee9131a Mon Sep 17 00:00:00 2001 From: Rui Pinheiro Date: Mon, 13 Aug 2018 20:40:32 +0100 Subject: [PATCH] Mark unsync textures dirty when deferred flushing invalidate_range_impl_base does not mark all textures that will only be unprotected as dirty when doing a deferred flush, since that is done by flush_all. However, if there are no sections to flush, the deferred flush will use the same code path as non-deferred flushes for unprotecting textures and forget to mark them as dirty. This commit fixes this bug. --- rpcs3/Emu/RSX/Common/texture_cache.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index 6803c47ef4..eaea72bff2 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -739,6 +739,9 @@ namespace rsx else if (deferred_flush) { //allow_flush = false and not synchronized + obj.first->set_dirty(true); + m_unreleased_texture_objects++; + result.sections_to_unprotect.push_back(obj.first); continue; } @@ -776,6 +779,7 @@ namespace rsx //Flushes happen in one go, now its time to remove protection for (auto& section : result.sections_to_unprotect) { + verify(HERE), section->is_flushed() || section->is_dirty(); section->unprotect(); m_cache[get_block_address(section->get_section_base())].remove_one(); } @@ -1265,7 +1269,7 @@ namespace rsx { if (tex->is_locked()) { - tex->set_dirty(true); + verify(HERE), tex->is_dirty(); tex->unprotect(); m_cache[get_block_address(tex->get_section_base())].remove_one(); }