diff options
author | Bas Nieuwenhuizen <[email protected]> | 2019-05-20 22:58:32 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2019-07-26 16:37:28 +0200 |
commit | 9653d80de187fe9d9e5211b475065e7e09598f19 (patch) | |
tree | 1d167f06fbeb19ca1a9f679dc191084047454800 /src/vulkan/wsi | |
parent | 5eae9bfbfcb3cdc8d7c82adaf99350ac30d40dce (diff) |
vulkan/wsi/x11: Increase the effective min. images for mailbox.
We need 5 images:
1) CPU work
2) GPU work
3) idle
4) queued for flip
5) presenting
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/vulkan/wsi')
-rw-r--r-- | src/vulkan/wsi/wsi_common_x11.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 40bdd410605..91130432a3e 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -1404,10 +1404,13 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, struct x11_swapchain *chain; xcb_void_cookie_t cookie; VkResult result; + VkPresentModeKHR present_mode = wsi_swapchain_get_present_mode(wsi_device, pCreateInfo); assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR); - const unsigned num_images = pCreateInfo->minImageCount; + unsigned num_images = pCreateInfo->minImageCount; + if (present_mode == VK_PRESENT_MODE_MAILBOX_KHR) + num_images = MAX2(num_images, 5); xcb_connection_t *conn = x11_surface_get_connection(icd_surface); struct wsi_x11_connection *wsi_conn = @@ -1439,7 +1442,7 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, chain->base.get_wsi_image = x11_get_wsi_image; chain->base.acquire_next_image = x11_acquire_next_image; chain->base.queue_present = x11_queue_present; - chain->base.present_mode = wsi_swapchain_get_present_mode(wsi_device, pCreateInfo); + chain->base.present_mode = present_mode; chain->base.image_count = num_images; chain->conn = conn; chain->window = window; |