diff --git a/src/VkBootstrap.cpp b/src/VkBootstrap.cpp index efc2e21..c0bc651 100644 --- a/src/VkBootstrap.cpp +++ b/src/VkBootstrap.cpp @@ -1574,6 +1574,24 @@ DeviceBuilder& DeviceBuilder::set_allocation_callbacks(VkAllocationCallbacks* ca info.allocation_callbacks = callbacks; return *this; } +DeviceBuilder& DeviceBuilder::custom_queue_setup(size_t count, CustomQueueDescription const* queue_descriptions) { + info.queue_descriptions.assign(queue_descriptions, queue_descriptions + count); + return *this; +} +DeviceBuilder& DeviceBuilder::custom_queue_setup(std::vector const& queue_descriptions) { + info.queue_descriptions = queue_descriptions; + return *this; +} +DeviceBuilder& DeviceBuilder::custom_queue_setup(std::vector&& queue_descriptions) { + info.queue_descriptions = std::move(queue_descriptions); + return *this; +} +#if VKB_SPAN_OVERLOADS +DeviceBuilder& DeviceBuilder::custom_queue_setup(std::span queue_descriptions) { + info.queue_descriptions.assign(queue_descriptions.begin(), queue_descriptions.end()); + return *this; +} +#endif // ---- Swapchain ---- // @@ -1925,6 +1943,14 @@ void Swapchain::destroy_image_views(size_t count, VkImageView const* image_views internal_table.fp_vkDestroyImageView(device, image_views[i], allocation_callbacks); } } +void Swapchain::destroy_image_views(std::vector const& image_views) { + destroy_image_views(image_views.size(), image_views.data()); +} +#if VKB_SPAN_OVERLOADS +void Swapchain::destroy_image_views(std::span image_views) { + destroy_image_views(image_views.size(), image_views.data()); +} +#endif Swapchain::operator VkSwapchainKHR() const { return this->swapchain; } SwapchainBuilder& SwapchainBuilder::set_old_swapchain(VkSwapchainKHR old_swapchain) { info.old_swapchain = old_swapchain; diff --git a/src/VkBootstrap.h b/src/VkBootstrap.h index de7b6b7..c47cfc8 100644 --- a/src/VkBootstrap.h +++ b/src/VkBootstrap.h @@ -811,30 +811,11 @@ class DeviceBuilder { // For Advanced Users: specify the exact list of VkDeviceQueueCreateInfo's needed for the application. // If a custom queue setup is provided, getting the queues and queue indexes is up to the application. - DeviceBuilder& custom_queue_setup(size_t count, CustomQueueDescription const* queue_descriptions) { - info.queue_descriptions.assign(queue_descriptions, queue_descriptions + count); - return *this; - } - // For Advanced Users: specify the exact list of VkDeviceQueueCreateInfo's needed for the application. - // If a custom queue setup is provided, getting the queues and queue indexes is up to the application. - DeviceBuilder& custom_queue_setup(std::vector const& queue_descriptions) { - info.queue_descriptions = queue_descriptions; - return *this; - } - // For Advanced Users: specify the exact list of VkDeviceQueueCreateInfo's needed for the application. - // If a custom queue setup is provided, getting the queues and queue indexes is up to the application. - DeviceBuilder& custom_queue_setup(std::vector&& queue_descriptions) { - info.queue_descriptions = std::move(queue_descriptions); - return *this; - } - + DeviceBuilder& custom_queue_setup(size_t count, CustomQueueDescription const* queue_descriptions); + DeviceBuilder& custom_queue_setup(std::vector const& queue_descriptions); + DeviceBuilder& custom_queue_setup(std::vector&& queue_descriptions); #if VKB_SPAN_OVERLOADS - // For Advanced Users: specify the exact list of VkDeviceQueueCreateInfo's needed for the application. - // If a custom queue setup is provided, getting the queues and queue indexes is up to the application. - DeviceBuilder& custom_queue_setup(std::span queue_descriptions) { - info.queue_descriptions.assign(queue_descriptions.begin(), queue_descriptions.end()); - return *this; - } + DeviceBuilder& custom_queue_setup(std::span queue_descriptions); #endif // Add a structure to the pNext chain of VkDeviceCreateInfo. @@ -881,14 +862,9 @@ struct Swapchain { Result> get_image_views(); Result> get_image_views(const void* pNext); void destroy_image_views(size_t count, VkImageView const* image_views); - void destroy_image_views(std::vector const& image_views) { - destroy_image_views(image_views.size(), image_views.data()); - } - + void destroy_image_views(std::vector const& image_views); #if VKB_SPAN_OVERLOADS - void destroy_image_views(std::span image_views) { - destroy_image_views(image_views.size(), image_views.data()); - } + void destroy_image_views(std::span image_views); #endif // A conversion function which allows this Swapchain to be used