From 9c492bfc86e65197d43bc33635d5930778c54873 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sat, 7 May 2016 14:11:29 +0200 Subject: [PATCH] When filtering device extensions, also add our own provided extensions --- renderdoc/driver/vulkan/vk_core.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 6c1074842..4d2f97c3a 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -630,6 +630,14 @@ bool operator <(const VkExtensionProperties &a, const VkExtensionProperties &b) return strcmp(a.extensionName, b.extensionName) < 0; } +// this is the list of extensions we provide - regardless of whether the ICD supports them +static const VkExtensionProperties renderdocProvidedExtensions[] = { + { + VK_EXT_DEBUG_MARKER_EXTENSION_NAME, + VK_EXT_DEBUG_MARKER_SPEC_VERSION + }, +}; + VkResult WrappedVulkan::FilterDeviceExtensionProperties(VkPhysicalDevice physDev, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) { VkResult vkr; @@ -722,20 +730,16 @@ VkResult WrappedVulkan::FilterDeviceExtensionProperties(VkPhysicalDevice physDev } } + // now we can add extensions that we provide ourselves (note this isn't sorted, but we + // don't have to sort the results, the sorting was just so we could filter optimally). + filtered.insert(filtered.end(), &renderdocProvidedExtensions[0], &renderdocProvidedExtensions[0] + ARRAY_COUNT(renderdocProvidedExtensions)); + return FillPropertyCountAndList(&filtered[0], (uint32_t)filtered.size(), pPropertyCount, pProperties); } VkResult WrappedVulkan::GetProvidedExtensionProperties(uint32_t *pPropertyCount, VkExtensionProperties *pProperties) { - // this is the list of extensions we provide - regardless of whether the ICD supports them - const VkExtensionProperties providedExtensions[] = { - { - VK_EXT_DEBUG_MARKER_EXTENSION_NAME, - VK_EXT_DEBUG_MARKER_SPEC_VERSION - }, - }; - - return FillPropertyCountAndList(providedExtensions, (uint32_t)ARRAY_COUNT(providedExtensions), pPropertyCount, pProperties); + return FillPropertyCountAndList(renderdocProvidedExtensions, (uint32_t)ARRAY_COUNT(renderdocProvidedExtensions), pPropertyCount, pProperties); } void WrappedVulkan::Serialise_CaptureScope(uint64_t offset)