From ecc230238913d2599db276573d7590ed4a898524 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Mon, 7 Nov 2022 22:25:05 +0100 Subject: [PATCH] [d3d9] Fix query reset counter underflow --- src/d3d9/d3d9_query.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d3d9/d3d9_query.cpp b/src/d3d9/d3d9_query.cpp index 7ce47cf97..a48732528 100644 --- a/src/d3d9/d3d9_query.cpp +++ b/src/d3d9/d3d9_query.cpp @@ -101,8 +101,10 @@ namespace dxvk { if (dwIssueFlags == D3DISSUE_BEGIN) { if (QueryBeginnable(m_queryType)) { - if (m_state == D3D9_VK_QUERY_BEGUN && QueryEndable(m_queryType)) + if (m_state == D3D9_VK_QUERY_BEGUN && QueryEndable(m_queryType)) { + m_resetCtr.fetch_add(1, std::memory_order_acquire); m_parent->End(this); + } m_parent->Begin(this);