diff --git a/rpcs3/Emu/RSX/Host/MM.cpp b/rpcs3/Emu/RSX/Host/MM.cpp index b5c5fb3494..cf21b6e046 100644 --- a/rpcs3/Emu/RSX/Host/MM.cpp +++ b/rpcs3/Emu/RSX/Host/MM.cpp @@ -98,6 +98,12 @@ namespace rsx return; } + std::lock_guard lock(g_mprotect_queue_lock); + if (g_deferred_mprotect_queue.empty()) + { + return; + } + auto& rsxdma = g_fxo->get(); rsxdma.backend_ctrl(mm_backend_ctrl::cmd_mm_flush, nullptr); } diff --git a/rpcs3/Emu/RSX/NV47/HW/nv47_sync.hpp b/rpcs3/Emu/RSX/NV47/HW/nv47_sync.hpp index 674c66470d..8bc069ecaf 100644 --- a/rpcs3/Emu/RSX/NV47/HW/nv47_sync.hpp +++ b/rpcs3/Emu/RSX/NV47/HW/nv47_sync.hpp @@ -30,7 +30,6 @@ namespace rsx if constexpr (FlushDMA) { // If the backend handled the request, this call will basically be a NOP - rsx::mm_flush_lazy(); g_fxo->get().sync(); } @@ -38,10 +37,15 @@ namespace rsx { // Manually flush the pipeline. // It is possible to stream report writes using the host GPU, but that generates too much submit traffic. - rsx::mm_flush(); RSX(ctx)->sync(); } + if constexpr (FlushDMA || FlushPipe) + { + // Kick MM flush without waiting. Technically we should do this before the sync in case of MTRSX, but doing it later improves CPU performance. + rsx::mm_flush_lazy(); + } + if (handled) { // Backend will handle it, nothing to write.