You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Guard against device capabilities with maxImageCount == 0, which is
defined to mean that there is no limit to the number of images, the
only limitation is memory availability.
- We check the number of swapchains supported and allocate memory to
match this number.
- Use of two separate scratch Arenas in order to successfully update
the SwapchainFramebuffers and SwapchainImageViews with the actual
number of supported Swapchains from the current device
Co-authored-by: Mathew Benson <mathew@benson.co.ke>
ZENGINE_VALIDATE_ASSERT(vkCreateSwapchainKHR(LogicalDevice, &swapchain_create_info, nullptr, &SwapchainHandle) == VK_SUCCESS, "Failed to create Swapchain")
1098
1088
1089
+
ZReleaseScratch(scratch);
1090
+
1099
1091
uint32_t image_count = 0;
1100
1092
ZENGINE_VALIDATE_ASSERT(vkGetSwapchainImagesKHR(LogicalDevice, SwapchainHandle, &image_count, nullptr) == VK_SUCCESS, "Failed to get Images count from Swapchain")
1101
1093
1102
-
if (image_count < SwapchainImageCount)
1094
+
if (image_count != SwapchainImageCount)
1103
1095
{
1104
1096
ZENGINE_CORE_WARN("Max Swapchain image count supported is {}, but requested {}", image_count, SwapchainImageCount);
1105
1097
SwapchainImageCount = image_count;
1106
1098
ZENGINE_CORE_WARN("Swapchain image count has changed from {} to {}", SwapchainImageCount, image_count);
ZENGINE_VALIDATE_ASSERT(vkGetSwapchainImagesKHR(LogicalDevice, SwapchainHandle, &SwapchainImageCount, SwapchainImages.data()) == VK_SUCCESS, "Failed to get VkImages from Swapchain")
0 commit comments