From 6c1f6e69bec4890f4d1e65f617c4cfc0a70dede3 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Fri, 29 May 2026 12:41:54 +0100 Subject: [PATCH] Fix EID counting when using D3D12 Command and Queue Annotations --- renderdoc/driver/vulkan/vk_core.cpp | 2 +- renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 62bac8acb..ed08a2fe6 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -4084,7 +4084,7 @@ RDResult WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t startEv // boundaries, the event IDs would no longer match up). if(m_LastCmdBufferID == ResourceId() || startEventID > 1) { - if(chunktype != VulkanChunk::SetCommandAnnotation) + if(chunktype != VulkanChunk::SetQueueAnnotation) m_RootEventID++; if(startEventID > 1) diff --git a/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp index ae602b8ff..3ae62eae9 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp @@ -2814,17 +2814,17 @@ bool WrappedVulkan::Serialise_SetCommandAnnotation(SerialiserType &ser, VkComman if(IsReplayingAndReading()) { + m_LastCmdBufferID = GetResID(cmd); + if(IsLoading(m_State)) { if(!m_RootAnnotation) m_RootAnnotation = new SDObject("Event Annotations"_lit, "Event Annotations"_lit); - ResourceId cmdId = GetResID(cmd); - - PendingAnnotation annot = {m_BakedCmdBufferInfo[cmdId].curEventID, key, valueType, + PendingAnnotation annot = {m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID, key, valueType, valueVectorWidth, value}; - m_BakedCmdBufferInfo[cmdId].annotations.push_back(annot); + m_BakedCmdBufferInfo[m_LastCmdBufferID].annotations.push_back(annot); m_Replay->WriteFrameRecord().frameInfo.containsAnnotations = true; }