From dd3f3aa91bad5abe13736f17f7192fa5b1f7036e Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 9 May 2017 15:23:55 +0100 Subject: [PATCH] When setting command buffer names in vulkan, propagate to baked cmds * We don't create any objects with the ID that the original name was applied to, we create a buffer for each baked version of that handle. * So on replay we need to apply the name down from the original object, and this also means temporarily storing the name in the original ID instead of as a live ID (since there is no live ID for the original command buffer object). --- renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp | 4 ++++ renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp index 4ee90cf7d..9a4edea8a 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp @@ -601,6 +601,10 @@ bool WrappedVulkan::Serialise_vkBeginCommandBuffer(Serialiser *localSerialiser, cmd = GetResourceManager()->GetLiveHandle(bakeId); } + // propagate any name there might be + if(m_CreationInfo.m_Names.find(cmdId) != m_CreationInfo.m_Names.end()) + m_CreationInfo.m_Names[GetResourceManager()->GetLiveID(bakeId)] = m_CreationInfo.m_Names[cmdId]; + { VulkanDrawcallTreeNode *draw = new VulkanDrawcallTreeNode; m_BakedCmdBufferInfo[cmdId].draw = draw; diff --git a/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp index e2fcd1693..95861e96b 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp @@ -1088,7 +1088,15 @@ bool WrappedVulkan::Serialise_vkDebugMarkerSetObjectNameEXT(Serialiser *localSer localSerialiser->Serialise("name", name); if(m_State == READING) - m_CreationInfo.m_Names[GetResourceManager()->GetLiveID(id)] = name; + { + // if we don't have a live resource, this is probably a command buffer being named on the + // virtual non-existant parent, not any of the baked IDs. Just save the name on the original ID + // and we'll propagate it in Serialise_vkBeginCommandBuffer + if(!GetResourceManager()->HasLiveResource(id)) + m_CreationInfo.m_Names[id] = name; + else + m_CreationInfo.m_Names[GetResourceManager()->GetLiveID(id)] = name; + } return true; }