demos: Modify correct uniform buffer for next frame
authorTony Barbour <tony@LunarG.com>
Wed, 14 Jun 2017 17:59:55 +0000 (11:59 -0600)
committerTony Barbour <tony@LunarG.com>
Wed, 14 Jun 2017 18:01:55 +0000 (12:01 -0600)
Change-Id: I78b8f5ef63fb2c14a3ce431f3e6f6a809e65972f

demos/cube.c

index a0c6dde..ba6d53e 100644 (file)
@@ -957,8 +957,6 @@ 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]);
 
-    demo_update_data_buffer(demo);
-
     err = !(VK_SUCCESS);
     while (err != VK_SUCCESS) {
         // Get the index of the next available swapchain image:
@@ -979,6 +977,8 @@ static void demo_draw(struct demo *demo) {
         }
     }
 
+    demo_update_data_buffer(demo);
+
     if (demo->VK_GOOGLE_display_timing_enabled) {
         // Look at what happened to previous presents, and make appropriate
         // adjustments in timing: