From 4158f114d0727112e902e687d003a616768a67ec Mon Sep 17 00:00:00 2001 From: Eray Cepni Date: Mon, 12 Oct 2026 11:52:03 +0300 Subject: [PATCH] Vulkan: Preserve active frame profiling queries when stopping threads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit StopThreads is called inside the FramebufferManagerCommon::NotifyRenderResized. Issue is, StopThreads is called inside an active frame, then clears that active frame's timestamp descriptions. Rendering resumes, and QueueRunner uses the empty list’s size to select query 0, which was already written. Fix this by preserving timestamp descriptions for the current frame when insideFrame_ is true while retaining the cleanup for other frames. --- Common/GPU/Vulkan/VulkanRenderManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index a1c2286b53..88a206eaf3 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -494,6 +494,9 @@ void VulkanRenderManager::StopThreads() { for (int i = 0; i < vulkan_->GetInflightFrames(); i++) { auto &frameData = frameData_[i]; // Zero the queries so we don't try to pull them later. + if (insideFrame_ && i == vulkan_->GetCurFrame()) { + continue; + } frameData.profile.timestampDescriptions.clear(); }