summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/QueryManagerVk.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp6
3 files changed, 7 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/QueryManagerVk.h b/Graphics/GraphicsEngineVulkan/include/QueryManagerVk.h
index c713837c..9472c132 100644
--- a/Graphics/GraphicsEngineVulkan/include/QueryManagerVk.h
+++ b/Graphics/GraphicsEngineVulkan/include/QueryManagerVk.h
@@ -72,7 +72,7 @@ public:
return m_CounterFrequency;
}
- void ResetStaleQueries(VulkanUtilities::VulkanCommandBuffer& CmdBuff);
+ Uint32 ResetStaleQueries(VulkanUtilities::VulkanCommandBuffer& CmdBuff);
private:
struct QueryHeapInfo
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index e8b254a8..40828c06 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -886,7 +886,7 @@ void DeviceContextVkImpl::Flush()
{
if (m_QueryMgr)
{
- m_QueryMgr->ResetStaleQueries(m_CommandBuffer);
+ m_State.NumCommands += m_QueryMgr->ResetStaleQueries(m_CommandBuffer);
}
if (m_State.NumCommands != 0)
diff --git a/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp b/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp
index 548c497b..0756420c 100644
--- a/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp
@@ -189,19 +189,23 @@ void QueryManagerVk::DiscardQuery(QUERY_TYPE Type, Uint32 Index)
HeapInfo.StaleQueries.push_back(Index);
}
-void QueryManagerVk::ResetStaleQueries(VulkanUtilities::VulkanCommandBuffer& CmdBuff)
+Uint32 QueryManagerVk::ResetStaleQueries(VulkanUtilities::VulkanCommandBuffer& CmdBuff)
{
std::lock_guard<std::mutex> Lock(m_HeapMutex);
+ Uint32 NumQueriesReset = 0;
for (auto& HeapInfo : m_Heaps)
{
for (auto& StaleQuery : HeapInfo.StaleQueries)
{
CmdBuff.ResetQueryPool(HeapInfo.vkQueryPool, StaleQuery, 1);
HeapInfo.AvailableQueries.push_back(StaleQuery);
+ ++NumQueriesReset;
}
HeapInfo.StaleQueries.clear();
}
+
+ return NumQueriesReset;
}
} // namespace Diligent