From a77ea9053b1b600e7e2b8ef29c5e70534da632be Mon Sep 17 00:00:00 2001 From: saschawillems Date: Sat, 4 Feb 2017 15:58:46 +0100 Subject: [PATCH] Ensure all device operations have been finished before recreating resources on window resize (could cause validation errors in some example) --- base/vulkanexamplebase.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 3116b889..2e6a1c0e 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -771,7 +771,7 @@ void VulkanExampleBase::initVulkan() { // The report flags determine what type of messages for the layers will be displayed // For validating (debugging) an appplication the error and warning bits should suffice - VkDebugReportFlagsEXT debugReportFlags = VK_DEBUG_REPORT_ERROR_BIT_EXT; // | VK_DEBUG_REPORT_WARNING_BIT_EXT | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; + VkDebugReportFlagsEXT debugReportFlags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; // Additional flags include performance info, loader and layer debug messages, etc. vkDebug::setupDebugging(instance, debugReportFlags, VK_NULL_HANDLE); } @@ -1974,6 +1974,9 @@ void VulkanExampleBase::windowResize() } prepared = false; + // Ensure all operations on the device have been finished before destroying resources + vkDeviceWaitIdle(device); + // Recreate swap chain width = destWidth; height = destHeight; @@ -1998,7 +2001,6 @@ void VulkanExampleBase::windowResize() createCommandBuffers(); buildCommandBuffers(); - vkQueueWaitIdle(queue); vkDeviceWaitIdle(device); if (enableTextOverlay)