Add support for disabling Vulkan timer queries per-platform via define

This commit is contained in:
Wojtek Figat
2021-07-27 16:38:52 +02:00
parent 2050429d6c
commit a713899a36
5 changed files with 46 additions and 25 deletions

View File

@@ -254,11 +254,13 @@ void CmdBufferManagerVulkan::SubmitActiveCmdBuffer(SemaphoreVulkan* signalSemaph
_activeCmdBuffer->EndRenderPass();
}
#if VULKAN_USE_QUERIES
// Pause all active queries
for (int32 i = 0; i < _queriesInProgress.Count(); i++)
{
_queriesInProgress[i]->Interrupt(_activeCmdBuffer);
}
#endif
_activeCmdBuffer->End();
@@ -305,21 +307,27 @@ void CmdBufferManagerVulkan::PrepareForNewActiveCommandBuffer()
_activeCmdBuffer = _pool.Create();
_activeCmdBuffer->Begin();
#if VULKAN_USE_QUERIES
// Resume any paused queries with the new command buffer
for (int32 i = 0; i < _queriesInProgress.Count(); i++)
{
_queriesInProgress[i]->Resume(_activeCmdBuffer);
}
#endif
}
void CmdBufferManagerVulkan::OnQueryBegin(GPUTimerQueryVulkan* query)
{
#if VULKAN_USE_QUERIES
_queriesInProgress.Add(query);
#endif
}
void CmdBufferManagerVulkan::OnQueryEnd(GPUTimerQueryVulkan* query)
{
#if VULKAN_USE_QUERIES
_queriesInProgress.Remove(query);
#endif
}
#endif