Updated swapchain image count selection algorithm.
The previous version was correct from Vulkan spec standpoint but due to bug in AMD drivers we can not safely use surface_caps.minImageCount for the number of images in the swapchain for fullscreen window. Now we request at least 2 images for immediate and fifo mode.
This commit is contained in:
parent
c30a4b867f
commit
abe1efe3aa
|
|
@ -198,15 +198,13 @@ static VkSwapchainKHR create_swapchain(VkPhysicalDevice physical_device, VkDevic
|
|||
if (mailbox_supported) {
|
||||
present_mode = VK_PRESENT_MODE_MAILBOX_KHR;
|
||||
image_count = std::max(3u, surface_caps.minImageCount);
|
||||
if (surface_caps.maxImageCount > 0) {
|
||||
image_count = std::min(image_count, surface_caps.maxImageCount);
|
||||
}
|
||||
} else if (immediate_supported) {
|
||||
present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR;
|
||||
image_count = surface_caps.minImageCount;
|
||||
} else {
|
||||
present_mode = VK_PRESENT_MODE_FIFO_KHR;
|
||||
image_count = surface_caps.minImageCount;
|
||||
present_mode = immediate_supported ? VK_PRESENT_MODE_IMMEDIATE_KHR : VK_PRESENT_MODE_FIFO_KHR;
|
||||
image_count = std::max(2u, surface_caps.minImageCount);
|
||||
}
|
||||
|
||||
if (surface_caps.maxImageCount > 0) {
|
||||
image_count = std::min(image_count, surface_caps.maxImageCount);
|
||||
}
|
||||
|
||||
// create swap chain
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user