Change-Id: I9a7b1ae0b5550864d36a61f1e67f842866d1770c
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
*tbm_surface = tpl_surface_dequeue_buffer_with_sync(swapchain_tpl->tpl_surface,
timeout, sync);
+
+ if (*tbm_surface == NULL && !tpl_surface_validate(swapchain_tpl->tpl_surface)) {
+ /* Returning VK_ERROR_OUT_OF_DATE_KHR calls swapchain_tpl_deinit
+ * to destroy the existing swapchain, but does not want the existing
+ * tpl_surface and tpl_display to be destroyed. */
+ tpl_object_reference((tpl_object_t *)swapchain_tpl->tpl_display);
+ tpl_object_reference((tpl_object_t *)swapchain_tpl->tpl_surface);
+ return VK_ERROR_OUT_OF_DATE_KHR;
+ }
+
if (*tbm_surface == NULL) {
if (timeout == 0)
return VK_NOT_READY;