Don't rewrap queues when multiple queues are mapped to one on replay

This commit is contained in:
baldurk
2019-11-01 17:00:43 +00:00
parent d6fdd2893f
commit 75d323c2b6
2 changed files with 18 additions and 2 deletions
+6
View File
@@ -296,6 +296,12 @@ public:
return (WrappedVkNonDispRes *)GetWrapper(ToTypedHandle(real));
}
template <typename realtype>
WrappedVkDispRes *GetDispWrapper(realtype real)
{
return (WrappedVkDispRes *)GetWrapper(ToTypedHandle(real));
}
template <typename parenttype, typename realtype>
ResourceId WrapResource(parenttype parentObj, realtype &obj)
{
@@ -50,8 +50,18 @@ bool WrappedVulkan::Serialise_vkGetDeviceQueue(SerialiserType &ser, VkDevice dev
ObjDisp(device)->GetDeviceQueue(Unwrap(device), remapFamily, remapIndex, &queue);
GetResourceManager()->WrapResource(Unwrap(device), queue);
GetResourceManager()->AddLiveResource(Queue, queue);
if(GetResourceManager()->HasWrapper(ToTypedHandle(queue)))
{
ResourceId live = GetResourceManager()->GetDispWrapper(queue)->id;
// whenever the new ID is requested, return the old ID, via replacements.
GetResourceManager()->ReplaceResource(Queue, GetResourceManager()->GetOriginalID(live));
}
else
{
GetResourceManager()->WrapResource(Unwrap(device), queue);
GetResourceManager()->AddLiveResource(Queue, queue);
}
if(remapFamily == m_QueueFamilyIdx && m_Queue == VK_NULL_HANDLE)
{