From 6a904ba032ee9f728f09671e6bc7ab1ca0546825 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sat, 19 Sep 2015 17:33:23 +0200 Subject: [PATCH] Add a rather gross hack to get replay queues in advance and wrap later --- renderdoc/driver/vulkan/vk_core.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 3c4fe67c8..5cb7ac99f 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -721,7 +721,9 @@ bool WrappedVulkan::Serialise_vkCreateDevice( m_PhysicalReplayData[i].dev = device; m_PhysicalReplayData[i].qFamilyIdx = qFamilyIdx; - + + // VKTODOMED this is a hack - need a more reliable way of doing this + // when we serialise the relevant vkGetDeviceQueue, we'll search for this handle and replace it with the wrapped version VkResult vkr = ObjDisp(device)->GetDeviceQueue(Unwrap(device), qFamilyIdx, 0, &m_PhysicalReplayData[i].q); RDCASSERT(vkr == VK_SUCCESS); @@ -736,6 +738,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice( RDCASSERT(vkr == VK_SUCCESS); GetResourceManager()->WrapResource(Unwrap(device), m_PhysicalReplayData[i].cmd); + found = true; break; } @@ -1103,8 +1106,15 @@ bool WrappedVulkan::Serialise_vkGetDeviceQueue( VkQueue queue; VkResult ret = ObjDisp(device)->GetDeviceQueue(Unwrap(device), nodeIdx, idx, &queue); + VkQueue real = queue; + GetResourceManager()->WrapResource(Unwrap(device), queue); GetResourceManager()->AddLiveResource(queueId, queue); + + // VKTODOMED hack - fixup unwrapped queue objects, because we tried to fill them + // out early + for(size_t i=0; i < m_PhysicalReplayData.size(); i++) + if(m_PhysicalReplayData[i].q == real) m_PhysicalReplayData[i].q = queue; } return true;