aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Barbour <tony@LunarG.com>2016-11-10 16:45:15 -0700
committerTony Barbour <tony@LunarG.com>2016-11-11 10:48:02 -0700
commitffa9a42864644b8953d6fe876eb5f7dacf78f5c1 (patch)
treee93dd3c45a016c90ab7e120a8d52c7e24f94f2ee
parent98fd881b2ba3589445078085c18b3bc07518aa8a (diff)
downloadusermoji-ffa9a42864644b8953d6fe876eb5f7dacf78f5c1.tar.xz
demos: Call DeviceWaitIdle before DestroyDevice
Complying with best practice from Vulkan Programming Guide page 31 - Shutting Down Cleanly Change-Id: I19640071d26f765ffc0a2f5e5fc4d60920395e0b
-rw-r--r--demos/cube.c1
-rw-r--r--demos/vulkaninfo.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/demos/cube.c b/demos/cube.c
index 050a513e..078b6245 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -2062,6 +2062,7 @@ static void demo_cleanup(struct demo *demo) {
if (demo->separate_present_queue) {
vkDestroyCommandPool(demo->device, demo->present_cmd_pool, NULL);
}
+ vkDeviceWaitIdle(demo->device);
vkDestroyDevice(demo->device, NULL);
if (demo->validate) {
demo->DestroyDebugReportCallback(demo->inst, demo->msg_callback, NULL);
diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c
index 63401876..677a04c7 100644
--- a/demos/vulkaninfo.c
+++ b/demos/vulkaninfo.c
@@ -505,6 +505,7 @@ static void app_dev_init(struct app_dev *dev, struct app_gpu *gpu) {
}
static void app_dev_destroy(struct app_dev *dev) {
+ vkDeviceWaitIdle(dev->obj);
vkDestroyDevice(dev->obj, NULL);
}