From: joonbum.ko Date: Thu, 5 Jul 2018 00:09:50 +0000 (+0900) Subject: swapchain_tpl: Fixed some bugs to support oldSwapchain feature. X-Git-Tag: accepted/tizen/unified/20180705.172738^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7dacc05cdb6677b5d021a6ecdfe99b0421ed4ed4;p=platform%2Fcore%2Fuifw%2Fvulkan-wsi-tizen.git swapchain_tpl: Fixed some bugs to support oldSwapchain feature. Change-Id: Ic5f74aa36726aaf9d77e98bcb1e4c3df6c6e29b9 Signed-off-by: joonbum.ko --- diff --git a/src/wsi/swapchain_tpl.c b/src/wsi/swapchain_tpl.c index e5a293d..d2d3bcd 100644 --- a/src/wsi/swapchain_tpl.c +++ b/src/wsi/swapchain_tpl.c @@ -156,6 +156,7 @@ swapchain_tpl_init(VkDevice device, vk_swapchain_tpl_t *swapchain_tpl; tpl_handle_t native_window; int tpl_present_mode; + vk_bool_t need_to_create = VK_TRUE; VkResult error = VK_ERROR_DEVICE_LOST; @@ -173,12 +174,26 @@ swapchain_tpl_init(VkDevice device, swapchain_tpl->tpl_surface = tpl_surface_get(swapchain_tpl->tpl_display, native_window); - if (swapchain_tpl->tpl_surface && chain->oldSwapchain == VK_NULL_HANDLE) - tpl_object_reference((tpl_object_t *)swapchain_tpl->tpl_surface); - else + if (swapchain_tpl->tpl_surface) { + if (chain->oldSwapchain != VK_NULL_HANDLE) { + vk_swapchain_tpl_t *oldSwapchain_tpl = + (vk_swapchain_tpl_t *)chain->oldSwapchain->backend_data; + if (tpl_surface_validate(oldSwapchain_tpl->tpl_surface)) + need_to_create = VK_TRUE; + else + need_to_create = VK_FALSE; + } else { + need_to_create = VK_FALSE; + } + } + + if (need_to_create) swapchain_tpl->tpl_surface = tpl_surface_create(swapchain_tpl->tpl_display, native_window, TPL_SURFACE_TYPE_WINDOW, format); + else + tpl_object_reference((tpl_object_t *)swapchain_tpl->tpl_surface); + VK_CHECK(swapchain_tpl->tpl_surface, goto error, "tpl_surface_create() failed.\n");