From: Mun, Gwan-gyeong Date: Thu, 6 Oct 2016 11:15:45 +0000 (+0900) Subject: swapchain: added return case of VK_ERROR_OUT_OF_DEVICE_MEMORY on vk_CreateSwapchainKHR() X-Git-Tag: submit/submit/tizen/20170906.070327/20170906.070422~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f83d8912abd175267166225e1a882ab153d9acb;p=platform%2Fcore%2Fuifw%2Fvulkan-wsi-tizen.git swapchain: added return case of VK_ERROR_OUT_OF_DEVICE_MEMORY on vk_CreateSwapchainKHR() Change-Id: I3d7275f1e8d525779a4004f36d8c38756c59cf3a --- diff --git a/src/wsi/swapchain.c b/src/wsi/swapchain.c index 8d5be33..6db4210 100644 --- a/src/wsi/swapchain.c +++ b/src/wsi/swapchain.c @@ -128,10 +128,20 @@ vk_CreateSwapchainKHR(VkDevice device, res = tpl_surface_create_swapchain(chain->tpl_surface, format, info->imageExtent.width, info->imageExtent.height, info->minImageCount); + if (res == TPL_ERROR_OUT_OF_MEMORY) { + error = VK_ERROR_OUT_OF_DEVICE_MEMORY; + VK_ERROR("tpl_surface_create_swapchain() failed.\n"); + goto error; + } VK_CHECK(res == TPL_ERROR_NONE, goto error, "tpl_surface_create_swapchain() failed.\n"); /* Initialize swapchain buffers. */ res = tpl_surface_get_swapchain_buffers(chain->tpl_surface, &buffers, &buffer_count); + if (res == TPL_ERROR_OUT_OF_MEMORY) { + error = VK_ERROR_OUT_OF_DEVICE_MEMORY; + VK_ERROR("tpl_surface_get_swapchain_buffers() failed.\n"); + goto error_get_buffers; + } VK_CHECK(res == TPL_ERROR_NONE, goto error_get_buffers, "tpl_surface_get_swapchain_buffers() failed.\n"); chain->buffers = vk_alloc(allocator, buffer_count * sizeof(vk_buffer_t),