diff --git a/rpcs3/Emu/RSX/Common/texture_cache_utils.h b/rpcs3/Emu/RSX/Common/texture_cache_utils.h index 39506d3e88..5fc81313f8 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache_utils.h +++ b/rpcs3/Emu/RSX/Common/texture_cache_utils.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "../rsx_cache.h" #include "texture_cache_predictor.h" @@ -1114,6 +1114,9 @@ namespace rsx invalidate_range(); } + virtual void dma_abort() + {} + public: /** * Dirty/Unreleased Flag @@ -1276,6 +1279,12 @@ namespace rsx void reprotect(const utils::protection prot) { + if (synchronized && !flushed) + { + // Abort enqueued transfer + dma_abort(); + } + //Reset properties and protect again flushed = false; synchronized = false; @@ -1286,6 +1295,12 @@ namespace rsx void reprotect(const utils::protection prot, const std::pair& range) { + if (synchronized && !flushed) + { + // Abort enqueued transfer + dma_abort(); + } + //Reset properties and protect again flushed = false; synchronized = false; diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h index fd5113e4cf..2b64df4e3a 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.h +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.h @@ -96,6 +96,14 @@ namespace vk } } + void dma_abort() override + { + // Called if a reset occurs, usually via reprotect path after a bad prediction. + // Discard the sync event, the next sync, if any, will properly recreate this. + verify(HERE), synchronized, !flushed, dma_fence; + vk::get_resource_manager()->dispose(dma_fence); + } + void destroy() { if (!exists())