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).
This commit is contained in:
baldurk
2017-05-09 15:23:55 +01:00
parent 89246077fa
commit dd3f3aa91b
2 changed files with 13 additions and 1 deletions
@@ -601,6 +601,10 @@ bool WrappedVulkan::Serialise_vkBeginCommandBuffer(Serialiser *localSerialiser,
cmd = GetResourceManager()->GetLiveHandle<VkCommandBuffer>(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;
@@ -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;
}