From 7466b53e4b2f31cade34e5aa5d2029bd06fcdb74 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 14 Jan 2016 19:43:50 +0100 Subject: [PATCH] Enumerate device extensions on CreateDevice for debug logging * Also works around a temporary loader bug --- renderdoc/driver/vulkan/vk_dispatchtables.cpp | 3 +++ .../driver/vulkan/wrappers/vk_device_funcs.cpp | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_dispatchtables.cpp b/renderdoc/driver/vulkan/vk_dispatchtables.cpp index 8b8b83827..3a401da7f 100644 --- a/renderdoc/driver/vulkan/vk_dispatchtables.cpp +++ b/renderdoc/driver/vulkan/vk_dispatchtables.cpp @@ -68,6 +68,9 @@ void InitInstanceReplayTables(VkInstance instance) RDCASSERT(table); // we know we'll only have one instance, so this is safe + + InstanceGPA(EnumerateDeviceExtensionProperties) + InstanceGPA(EnumerateDeviceLayerProperties) InstanceGPA(GetPhysicalDeviceSurfaceCapabilitiesKHR) InstanceGPA(GetPhysicalDeviceSurfaceFormatsKHR) diff --git a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp index 8af2cb14f..82098714c 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp @@ -559,6 +559,21 @@ bool WrappedVulkan::Serialise_vkCreateDevice( else RDCWARN("vertexPipelineStoresAndAtomics = false, output mesh data will not be available"); + uint32_t numExts = 0; + + VkResult vkr = ObjDisp(physicalDevice)->EnumerateDeviceExtensionProperties(Unwrap(physicalDevice), NULL, &numExts, NULL); + RDCASSERT(vkr == VK_SUCCESS); + + VkExtensionProperties *exts = new VkExtensionProperties[numExts]; + + vkr = ObjDisp(physicalDevice)->EnumerateDeviceExtensionProperties(Unwrap(physicalDevice), NULL, &numExts, exts); + RDCASSERT(vkr == VK_SUCCESS); + + for(uint32_t i=0; i < numExts; i++) + RDCLOG("Ext %u: %s (%u)", i, exts[i].extensionName, exts[i].specVersion); + + SAFE_DELETE_ARRAY(exts); + // PORTABILITY check that extensions and layers supported in capture (from createInfo) are supported in replay VkResult ret = GetDeviceDispatchTable(NULL)->CreateDevice(Unwrap(physicalDevice), &createInfo, NULL, &device); @@ -575,8 +590,6 @@ bool WrappedVulkan::Serialise_vkCreateDevice( m_QueueFamilyIdx = qFamilyIdx; - VkResult vkr = VK_SUCCESS; - if(m_InternalCmds.cmdpool == VK_NULL_HANDLE) { VkCommandPoolCreateInfo poolInfo = { VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, NULL, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, qFamilyIdx };