From 3f83d8912abd175267166225e1a882ab153d9acb Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Thu, 6 Oct 2016 20:15:45 +0900 Subject: [PATCH] swapchain: added return case of VK_ERROR_OUT_OF_DEVICE_MEMORY on vk_CreateSwapchainKHR() Change-Id: I3d7275f1e8d525779a4004f36d8c38756c59cf3a --- src/wsi/swapchain.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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), -- 2.7.4