From aeed599098060a1ecf6a5e6266748681f7ccc358 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Sat, 16 Jul 2022 11:49:26 -0600 Subject: [PATCH] Fix desired extensions not being enabled Regression caused desired extensions to not be added to the device create info structure, resulting in desired extensions not being enabled. --- src/VkBootstrap.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/VkBootstrap.cpp b/src/VkBootstrap.cpp index f289296..29910e3 100644 --- a/src/VkBootstrap.cpp +++ b/src/VkBootstrap.cpp @@ -984,8 +984,8 @@ uint32_t get_separate_queue_index( uint32_t get_dedicated_queue_index( std::vector const& families, VkQueueFlags desired_flags, VkQueueFlags undesired_flags) { for (uint32_t i = 0; i < static_cast(families.size()); i++) { - if ((families[i].queueFlags & desired_flags) == desired_flags && (families[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) == 0 && - (families[i].queueFlags & undesired_flags) == 0) + if ((families[i].queueFlags & desired_flags) == desired_flags && + (families[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) == 0 && (families[i].queueFlags & undesired_flags) == 0) return i; } return QUEUE_INDEX_MAX_VALUE; @@ -1201,10 +1201,11 @@ detail::Result> PhysicalDeviceSelector::select_impl( if (criteria.enable_portability_subset && ext == "VK_KHR_portability_subset") portability_ext_available = true; + auto desired_extensions_supported = detail::check_device_extension_support(phys_dev.extensions, criteria.desired_extensions); + phys_dev.extensions.clear(); phys_dev.extensions.insert( phys_dev.extensions.end(), criteria.required_extensions.begin(), criteria.required_extensions.end()); - auto desired_extensions_supported = detail::check_device_extension_support(phys_dev.extensions, criteria.desired_extensions); phys_dev.extensions.insert( phys_dev.extensions.end(), desired_extensions_supported.begin(), desired_extensions_supported.end()); if (portability_ext_available) { @@ -1778,10 +1779,10 @@ detail::Result SwapchainBuilder::build() const { if (info.required_min_image_count >= 1) { if (info.required_min_image_count < surface_support.capabilities.minImageCount) return make_error_code(SwapchainError::required_min_image_count_too_low); - + image_count = info.required_min_image_count; } else if (info.min_image_count == 0) { - // We intentionally use minImageCount + 1 to maintain existing behavior, even if it typically results in triple buffering on most systems. + // We intentionally use minImageCount + 1 to maintain existing behavior, even if it typically results in triple buffering on most systems. image_count = surface_support.capabilities.minImageCount + 1; } else { image_count = info.min_image_count;