From: Joonbum Ko Date: Mon, 3 Sep 2018 11:55:50 +0000 (+0900) Subject: swapchain: Added some error condition to follow vk-spec. X-Git-Tag: accepted/tizen/unified/20180904.180645^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd3c481812d9a3c04b81658f45fadbfddf0e65de;p=platform%2Fcore%2Fuifw%2Fvulkan-wsi-tizen.git swapchain: Added some error condition to follow vk-spec. - minImageCount is the minimum number of presentable images that the application needs. The implementation will either create the swapchain with at least that many images, or it will fail to create the swapchain. Change-Id: I1711c50456fd3487a495497bfd526ca9bf30d308 Signed-off-by: Joonbum Ko --- diff --git a/src/wsi/swapchain.c b/src/wsi/swapchain.c index 7549892..20ec874 100644 --- a/src/wsi/swapchain.c +++ b/src/wsi/swapchain.c @@ -139,6 +139,8 @@ vk_CreateSwapchainKHR(VkDevice device, error = chain->get_buffers(device, chain, &buffers, &chain->buffer_count); VK_CHECK(error == VK_SUCCESS, goto done, "swapchain backend get buffers failed.\n"); + VK_CHECK(chain->buffer_count >= info->minImageCount, goto error_mem_alloc, + "Insufficient buffer_count(%d >= %d)\n", chain->buffer_count, info->minImageCount); chain->buffers = vk_alloc(allocator, chain->buffer_count * sizeof(vk_buffer_t), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);