Fix Vulkan Tracy timestamp queries on MoltenVK

Disable Vulkan Tracy GPU profiling when Vulkan timer queries are disabled.
Apple platforms already set VULKAN_USE_TIMER_QUERIES to 0
This commit is contained in:
Andrei Gagua
2026-05-24 11:13:41 +03:00
parent 00e4b09e7e
commit 285762bfdb
6 changed files with 16 additions and 10 deletions
@@ -111,7 +111,7 @@ GPUContextVulkan::GPUContextVulkan(GPUDeviceVulkan* device, QueueVulkan* queue)
_handlesSizes[(int32)SpirvShaderResourceBindingType::UAV] = GPU_MAX_UA_BINDED;
#endif
#if GPU_ENABLE_TRACY
#if VULKAN_USE_TRACY_GPU
#if VK_EXT_calibrated_timestamps && VK_EXT_host_query_reset && !PLATFORM_SWITCH
// Use calibrated timestamps extension
if (vkResetQueryPoolEXT && vkGetCalibratedTimestampsEXT && _device->PhysicalDeviceFeatures12.hostQueryReset)
@@ -138,7 +138,7 @@ GPUContextVulkan::GPUContextVulkan(GPUDeviceVulkan* device, QueueVulkan* queue)
GPUContextVulkan::~GPUContextVulkan()
{
#if GPU_ENABLE_TRACY
#if VULKAN_USE_TRACY_GPU
tracy::DestroyVkContext(_tracyContext);
#endif
for (int32 i = 0; i < _descriptorPools.Count(); i++)
@@ -799,7 +799,7 @@ void GPUContextVulkan::FrameEnd()
// Execute any queued layout transitions that weren't already handled by the render pass
FlushBarriers();
#if GPU_ENABLE_TRACY
#if VULKAN_USE_TRACY_GPU
if (cmdBuffer)
tracy::CollectVkContext(_tracyContext, cmdBuffer->GetHandle());
#endif
@@ -813,7 +813,7 @@ void GPUContextVulkan::FrameEnd()
void GPUContextVulkan::EventBegin(const Char* name)
{
const auto cmdBuffer = _cmdBufferManager->GetCmdBuffer();
#if COMPILE_WITH_PROFILER
#if VULKAN_USE_TRACY_GPU
void* tracyContext = _tracyContext;
#else
void* tracyContext = nullptr;