From 86b559ab523c616f3e09592fa27c502465aeafda Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 11 Jan 2026 23:50:27 +0300 Subject: [PATCH] rsx/zcull: Stop any running when the clear command is processed --- rpcs3/Emu/RSX/RSXZCULL.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/RSXZCULL.cpp b/rpcs3/Emu/RSX/RSXZCULL.cpp index 293ae5e9dd..63e39a8314 100644 --- a/rpcs3/Emu/RSX/RSXZCULL.cpp +++ b/rpcs3/Emu/RSX/RSXZCULL.cpp @@ -260,9 +260,20 @@ namespace rsx return; } + // Discard any running queries. The results will never be read anyway. + if (m_current_task && m_current_task->active) + { + discard_occlusion_query(m_current_task); + free_query(m_current_task); + m_current_task->active = false; + + allocate_new_query(ptimer); + begin_occlusion_query(m_current_task); + } + if (!m_pending_writes.empty()) { - //Remove any dangling/unclaimed queries as the information is lost anyway + // Remove any dangling/unclaimed queries as the information is lost anyway auto valid_size = m_pending_writes.size(); for (auto It = m_pending_writes.rbegin(); It != m_pending_writes.rend(); ++It) {