diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 670b2e8d..2b12eaab 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -1556,7 +1556,8 @@ dispatch_group_t concurrentGroup; { vulkanExample->quit = YES; dispatch_group_wait(concurrentGroup, DISPATCH_TIME_FOREVER); - delete vulkanExample; + vkDeviceWaitIdle(vulkanExample->vulkanDevice->logicalDevice); + delete(vulkanExample); } @end diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 7fa6373c..e8a04ae2 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -59,15 +59,11 @@ function(buildExample EXAMPLE_NAME) endif(WIN32) set_target_properties(${EXAMPLE_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) - #if(OpenMP_CXX_FOUND) - # SRS - target_compile_options is not needed when using target_link_libraries( OpenMP::OpenMP_CXX) syntax below - #target_compile_options(${EXAMPLE_NAME} PRIVATE ${OpenMP_CXX_FLAGS}) - IF(${EXAMPLE_NAME} STREQUAL "texture3d") - if(OpenMP_CXX_FOUND) - target_link_libraries(${EXAMPLE_NAME} OpenMP::OpenMP_CXX) - endif() + if(${EXAMPLE_NAME} STREQUAL "texture3d") + if(OpenMP_CXX_FOUND) + target_link_libraries(${EXAMPLE_NAME} OpenMP::OpenMP_CXX) endif() - #endif() + endif() if(RESOURCE_INSTALL_DIR) install(TARGETS ${EXAMPLE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/examples/computeraytracing/computeraytracing.cpp b/examples/computeraytracing/computeraytracing.cpp index e857d1cd..6cb83490 100644 --- a/examples/computeraytracing/computeraytracing.cpp +++ b/examples/computeraytracing/computeraytracing.cpp @@ -94,9 +94,6 @@ public: ~VulkanExample() { - // SRS - Ensure all operations on the device have finished before destroying resources - vkDeviceWaitIdle(device); - // Graphics vkDestroyPipeline(device, graphics.pipeline, nullptr); vkDestroyPipelineLayout(device, graphics.pipelineLayout, nullptr); diff --git a/examples/gltfscenerendering/gltfscenerendering.h b/examples/gltfscenerendering/gltfscenerendering.h index 1d6cffe3..1e1d673c 100644 --- a/examples/gltfscenerendering/gltfscenerendering.h +++ b/examples/gltfscenerendering/gltfscenerendering.h @@ -15,7 +15,7 @@ #define TINYGLTF_IMPLEMENTATION #define STB_IMAGE_IMPLEMENTATION #define TINYGLTF_NO_STB_IMAGE_WRITE -//#define TINYGLTF_NO_STB_IMAGE // SRS - Comment out to enable default image loader, otherwise LoadImageData() is undefined +#define TINYGLTF_NO_STB_IMAGE #define TINYGLTF_NO_EXTERNAL_IMAGE #ifdef VK_USE_PLATFORM_ANDROID_KHR #define TINYGLTF_ANDROID_LOAD_FROM_ASSETS diff --git a/examples/triangle/triangle.cpp b/examples/triangle/triangle.cpp index 694cd8be..fc775197 100644 --- a/examples/triangle/triangle.cpp +++ b/examples/triangle/triangle.cpp @@ -126,9 +126,6 @@ public: ~VulkanExample() { - // SRS - Ensure all operations on the device have finished before destroying resources - vkDeviceWaitIdle(device); - // Clean up used Vulkan resources // Note: Inherited destructor cleans up resources stored in base class vkDestroyPipeline(device, pipeline, nullptr); diff --git a/examples/vertexattributes/vertexattributes.h b/examples/vertexattributes/vertexattributes.h index d51f96ec..1630ee5d 100644 --- a/examples/vertexattributes/vertexattributes.h +++ b/examples/vertexattributes/vertexattributes.h @@ -9,7 +9,7 @@ #define TINYGLTF_IMPLEMENTATION #define STB_IMAGE_IMPLEMENTATION #define TINYGLTF_NO_STB_IMAGE_WRITE -//#define TINYGLTF_NO_STB_IMAGE // SRS - Comment out to enable default image loader, otherwise LoadImageData() is undefined +#define TINYGLTF_NO_STB_IMAGE #define TINYGLTF_NO_EXTERNAL_IMAGE #ifdef VK_USE_PLATFORM_ANDROID_KHR #define TINYGLTF_ANDROID_LOAD_FROM_ASSETS diff --git a/xcode/MVKExample.cpp b/xcode/MVKExample.cpp index ab6acc53..82488305 100644 --- a/xcode/MVKExample.cpp +++ b/xcode/MVKExample.cpp @@ -125,5 +125,6 @@ MVKExample::MVKExample(void* view, double scaleUI) { } MVKExample::~MVKExample() { - delete _vulkanExample; + vkDeviceWaitIdle(_vulkanExample->vulkanDevice->logicalDevice); + delete(_vulkanExample); }