From f3210a9a3377214847bc64aa94386d25d05d01e0 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 23 Apr 2018 12:11:29 +0300 Subject: [PATCH] rsx: Workaround for lost memory sections - TODO: surface_cache and texture_cache need a better method of persisting partial framebuffer resources --- rpcs3/Emu/RSX/Common/texture_cache.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index f30034acd9..bb5298d703 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -975,13 +975,22 @@ namespace rsx if (surface == ®ion) continue; + if (surface->get_context() != rsx::texture_upload_context::framebuffer_storage) + { + m_unreleased_texture_objects++; + } + else + { + if (surface->get_section_base() != memory_address) + //HACK: preserve other overlapped sections despite overlap unless new section is superseding + //TODO: write memory to cell or redesign sections to preserve the data + continue; + } + //Memory is shared with another surface //Discard it - the backend should ensure memory contents are preserved if needed surface->set_dirty(true); - if (surface->get_context() != rsx::texture_upload_context::framebuffer_storage) - m_unreleased_texture_objects++; - if (surface->is_locked()) { surface->unprotect();