From 5ba92b4dcee17a62dc15871e64cd80d05f23389b Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 2 Jun 2016 20:17:17 +0200 Subject: [PATCH] Allow a capture to replay if it has more physical devices than replay * This will still fail if the physical devices are used, but if they're not this allows a bit more capture portability between machines. --- renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp index 426fbad4a..2bb591995 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp @@ -427,7 +427,14 @@ bool WrappedVulkan::Serialise_vkEnumeratePhysicalDevices(Serialiser *localSerial VkResult vkr = ObjDisp(instance)->EnumeratePhysicalDevices(Unwrap(instance), &count, NULL); RDCASSERTEQUAL(vkr, VK_SUCCESS); - RDCASSERT(count > physIndex); + if(count <= physIndex) + { + RDCERR( + "Capture had more physical devices than available on replay! This will lead to a crash " + "if they are used."); + return true; + } + devices = new VkPhysicalDevice[count]; if(physIndex >= m_PhysicalDevices.size())