Code Review: a) revert TinyGLTF #defines, b) call vkDeviceWaitIdle() in macOS/iOS termination handlers, c) remove OpenMP target_compile_options() in CMakeLists
This commit is contained in:
parent
46b2027dd1
commit
c89d4eb776
7 changed files with 10 additions and 18 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(<target> 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})
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -125,5 +125,6 @@ MVKExample::MVKExample(void* view, double scaleUI) {
|
|||
}
|
||||
|
||||
MVKExample::~MVKExample() {
|
||||
delete _vulkanExample;
|
||||
vkDeviceWaitIdle(_vulkanExample->vulkanDevice->logicalDevice);
|
||||
delete(_vulkanExample);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue