From 8b7c9116d2982811cd7ee4f4d58ac3c6396f785a Mon Sep 17 00:00:00 2001 From: Tony Barbour Date: Thu, 29 Jun 2017 13:34:41 -0600 Subject: demos: Use do-while instead of clunky while When acquiring swapchain images Change-Id: I8c502e06490f73fc5c9cd8057cd12869a66ea942 --- demos/cube.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/demos/cube.c b/demos/cube.c index a6d68a15..576f0a42 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -957,8 +957,7 @@ static void demo_draw(struct demo *demo) { vkWaitForFences(demo->device, 1, &demo->fences[demo->frame_index], VK_TRUE, UINT64_MAX); vkResetFences(demo->device, 1, &demo->fences[demo->frame_index]); - err = !(VK_SUCCESS); - while (err != VK_SUCCESS) { + do { // Get the index of the next available swapchain image: err = demo->fpAcquireNextImageKHR(demo->device, demo->swapchain, UINT64_MAX, demo->image_acquired_semaphores[demo->frame_index], @@ -975,7 +974,7 @@ static void demo_draw(struct demo *demo) { } else { assert(!err); } - } + } while (err != VK_SUCCESS); demo_update_data_buffer(demo); -- cgit v1.2.3