From bb9dab6634d64e53e1a8d8eb53e658b01ae98e59 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Sun, 15 Mar 2026 13:41:57 +0900 Subject: [PATCH] clients/simple-vulkan.c: eliminate dead code I also moved vkQueuePresentKHR() out of the if-else block for better readability. Signed-off-by: Hiroaki Yamamoto --- clients/simple-vulkan.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/clients/simple-vulkan.c b/clients/simple-vulkan.c index 07401030d..d55f7f128 100644 --- a/clients/simple-vulkan.c +++ b/clients/simple-vulkan.c @@ -1603,20 +1603,12 @@ redraw(struct window *window) .pRegions = ®ion, }; pnext(&present_info, &present_regions); - - result = vkQueuePresentKHR(window->vk.queue, &present_info); - } else { - result = vkQueuePresentKHR(window->vk.queue, &present_info); } + result = vkQueuePresentKHR(window->vk.queue, &present_info); + if (result != VK_SUCCESS) return; - if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR) { - recreate_swapchain(window); - return; - } else if (result != VK_SUCCESS) { - assert(0); - } window->frames++; window->vk.frame_index = (window->vk.frame_index + 1) % MAX_CONCURRENT_FRAMES;