aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Stroyan <mike@LunarG.com>2015-08-28 10:58:06 -0600
committerMike Stroyan <mike@LunarG.com>2015-08-28 12:49:03 -0600
commit15fed6bfd429f758057717254aebc91e68d573fb (patch)
tree83812549baf6cc36f4312f1859072e5b85ffbdce
parentd7b7c269fe296687513cbca5448fe68fbe7b8a15 (diff)
downloadusermoji-15fed6bfd429f758057717254aebc91e68d573fb.tar.xz
demos: vkDestroySemaphore only after it is unused.
Semaphores should not be destroyed when in use. Call vkQueueWaitIdle before calling vkDestroySemaphore.
-rw-r--r--demos/cube.c6
-rw-r--r--demos/tri.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/demos/cube.c b/demos/cube.c
index e641a14c..5778df31 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -629,11 +629,11 @@ static void demo_draw(struct demo *demo)
// return codes
assert(!err);
- err = vkDestroySemaphore(demo->device, presentCompleteSemaphore);
- assert(!err);
-
err = vkQueueWaitIdle(demo->queue);
assert(err == VK_SUCCESS);
+
+ err = vkDestroySemaphore(demo->device, presentCompleteSemaphore);
+ assert(!err);
}
static void demo_prepare_buffers(struct demo *demo)
diff --git a/demos/tri.c b/demos/tri.c
index 09491c39..78105b2d 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -451,11 +451,11 @@ static void demo_draw(struct demo *demo)
// return codes
assert(!err);
- err = vkDestroySemaphore(demo->device, presentCompleteSemaphore);
- assert(!err);
-
err = vkQueueWaitIdle(demo->queue);
assert(err == VK_SUCCESS);
+
+ err = vkDestroySemaphore(demo->device, presentCompleteSemaphore);
+ assert(!err);
}
static void demo_prepare_buffers(struct demo *demo)