From d884392b710d4b1f6dd8f73213592cad776f3c6c Mon Sep 17 00:00:00 2001 From: Dario Date: Sun, 15 Sep 2024 12:05:57 -0300 Subject: [PATCH] Clear operations from present queue when framebuffer changes are released. --- src/hle/rt64_present_queue.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hle/rt64_present_queue.cpp b/src/hle/rt64_present_queue.cpp index 6e85b8d..018513d 100644 --- a/src/hle/rt64_present_queue.cpp +++ b/src/hle/rt64_present_queue.cpp @@ -490,7 +490,7 @@ namespace RT64 { skipPresent = skipPresent || ext.swapChain->isEmpty(); - const Present &present = presents[processCursor]; + Present &present = presents[processCursor]; ext.workloadQueue->waitForWorkloadId(present.workloadId); if (!presentThreadRunning) { @@ -505,12 +505,13 @@ namespace RT64 { threadPresent(present, swapChainValid); } - if (!present.fbOperations.empty()) { - const std::scoped_lock lock(screenFbChangePoolMutex); - screenFbChangePool.release(present.fbOperations.front().writeChanges.id); - } - if (!present.paused) { + if (!present.fbOperations.empty()) { + const std::scoped_lock lock(screenFbChangePoolMutex); + screenFbChangePool.release(present.fbOperations.front().writeChanges.id); + present.fbOperations.clear(); + } + threadAdvanceBarrier(); }