SwapchainBuilder: expose present_mode and requested_min_image_count in the resulting Swapchain

This commit is contained in:
Yoan Lecoq 2022-05-16 11:46:57 +02:00 committed by Charles Giessen
parent 8f39b12431
commit 74cac40817
2 changed files with 4 additions and 0 deletions

View File

@ -1848,6 +1848,8 @@ detail::Result<Swapchain> SwapchainBuilder::build() const {
if (!images) {
return detail::Error{ SwapchainError::failed_get_swapchain_images };
}
swapchain.requested_min_image_count = image_count;
swapchain.present_mode = present_mode;
swapchain.image_count = static_cast<uint32_t>(images.value().size());
swapchain.allocation_callbacks = info.allocation_callbacks;
return swapchain;

View File

@ -753,6 +753,8 @@ struct Swapchain {
uint32_t image_count = 0;
VkFormat image_format = VK_FORMAT_UNDEFINED;
VkExtent2D extent = { 0, 0 };
uint32_t requested_min_image_count = 0; // The value of minImageCount actually used when creating the swapchain; note that the presentation engine is always free to create more images than that.
VkPresentModeKHR present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR; // The present mode actually used when creating the swapchain.
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
// Returns a vector of VkImage handles to the swapchain.