diff options
| author | Tony Barbour <tony@LunarG.com> | 2017-06-29 13:34:41 -0600 |
|---|---|---|
| committer | Tony Barbour <tony@LunarG.com> | 2017-06-29 13:34:41 -0600 |
| commit | 8b7c9116d2982811cd7ee4f4d58ac3c6396f785a (patch) | |
| tree | c3209548f28375219c7de6f799d66eb5acf4dfd1 | |
| parent | 4a1572c647e1b063b2d0e06f026d7645c51a486d (diff) | |
| download | usermoji-8b7c9116d2982811cd7ee4f4d58ac3c6396f785a.tar.xz | |
demos: Use do-while instead of clunky while
When acquiring swapchain images
Change-Id: I8c502e06490f73fc5c9cd8057cd12869a66ea942
| -rw-r--r-- | demos/cube.c | 5 |
1 files 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); |
