Clean up the header file

This commit is contained in:
monomere 2024-03-29 21:56:12 +03:00
parent 1fa2b08810
commit c24b3415d4
2 changed files with 32 additions and 30 deletions

View File

@ -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<CustomQueueDescription> const& queue_descriptions) {
info.queue_descriptions = queue_descriptions;
return *this;
}
DeviceBuilder& DeviceBuilder::custom_queue_setup(std::vector<CustomQueueDescription>&& queue_descriptions) {
info.queue_descriptions = std::move(queue_descriptions);
return *this;
}
#if VKB_SPAN_OVERLOADS
DeviceBuilder& DeviceBuilder::custom_queue_setup(std::span<const CustomQueueDescription> 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<VkImageView> const& image_views) {
destroy_image_views(image_views.size(), image_views.data());
}
#if VKB_SPAN_OVERLOADS
void Swapchain::destroy_image_views(std::span<const VkImageView> 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;

View File

@ -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<CustomQueueDescription> 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<CustomQueueDescription>&& 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<CustomQueueDescription> const& queue_descriptions);
DeviceBuilder& custom_queue_setup(std::vector<CustomQueueDescription>&& 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<const CustomQueueDescription> queue_descriptions) {
info.queue_descriptions.assign(queue_descriptions.begin(), queue_descriptions.end());
return *this;
}
DeviceBuilder& custom_queue_setup(std::span<const CustomQueueDescription> queue_descriptions);
#endif
// Add a structure to the pNext chain of VkDeviceCreateInfo.
@ -881,14 +862,9 @@ struct Swapchain {
Result<std::vector<VkImageView>> get_image_views();
Result<std::vector<VkImageView>> get_image_views(const void* pNext);
void destroy_image_views(size_t count, VkImageView const* image_views);
void destroy_image_views(std::vector<VkImageView> const& image_views) {
destroy_image_views(image_views.size(), image_views.data());
}
void destroy_image_views(std::vector<VkImageView> const& image_views);
#if VKB_SPAN_OVERLOADS
void destroy_image_views(std::span<const VkImageView> image_views) {
destroy_image_views(image_views.size(), image_views.data());
}
void destroy_image_views(std::span<const VkImageView> image_views);
#endif
// A conversion function which allows this Swapchain to be used