From 474500f07e450eaf9287b6ee7f70389e8f119656 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 1 Apr 2019 20:49:39 +1000 Subject: [PATCH] Vulkan: Prevent submission of command buffer with open queries --- Source/Core/VideoBackends/Vulkan/PerfQuery.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/VideoBackends/Vulkan/PerfQuery.cpp b/Source/Core/VideoBackends/Vulkan/PerfQuery.cpp index f19b67d12b..e13c02173d 100644 --- a/Source/Core/VideoBackends/Vulkan/PerfQuery.cpp +++ b/Source/Core/VideoBackends/Vulkan/PerfQuery.cpp @@ -45,6 +45,10 @@ void PerfQuery::EnableQuery(PerfQueryGroup type) if (m_query_count > m_query_buffer.size() / 2) PartialFlush(m_query_count == PERF_QUERY_BUFFER_SIZE); + // Ensure command buffer is ready to go before beginning the query, that way we don't submit + // a buffer with open queries. + StateTracker::GetInstance()->Bind(); + if (type == PQG_ZCOMP_ZCOMPLOC || type == PQG_ZCOMP) { ActiveQuery& entry = m_query_buffer[m_query_next_pos];