From cf6d62b5212f38a535ac83b675f08c84757cefb7 Mon Sep 17 00:00:00 2001 From: aliasifhuawei Date: Mon, 25 Nov 2024 15:11:04 -0800 Subject: [PATCH] Moved tear down code to destructor as this is called once. --- samples/api/hello_triangle_1_3/hello_triangle_1_3.cpp | 10 +--------- samples/api/hello_triangle_1_3/hello_triangle_1_3.h | 2 -- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/samples/api/hello_triangle_1_3/hello_triangle_1_3.cpp b/samples/api/hello_triangle_1_3/hello_triangle_1_3.cpp index 427200397..6c908e6ed 100644 --- a/samples/api/hello_triangle_1_3/hello_triangle_1_3.cpp +++ b/samples/api/hello_triangle_1_3/hello_triangle_1_3.cpp @@ -1126,10 +1126,7 @@ void HelloTriangleV13::transition_image_layout( vkCmdPipelineBarrier2(cmd, &dependency_info); } -/** - * @brief Tears down the Vulkan context. - */ -void HelloTriangleV13::teardown() +HelloTriangleV13::~HelloTriangleV13() { // Don't release anything until the GPU is completely idle. vkDeviceWaitIdle(context.device); @@ -1200,11 +1197,6 @@ void HelloTriangleV13::teardown() vk_instance.reset(); } -HelloTriangleV13::~HelloTriangleV13() -{ - teardown(); -} - bool HelloTriangleV13::prepare(const vkb::ApplicationOptions &options) { assert(options.window != nullptr); diff --git a/samples/api/hello_triangle_1_3/hello_triangle_1_3.h b/samples/api/hello_triangle_1_3/hello_triangle_1_3.h index 59cb182aa..0193414ef 100644 --- a/samples/api/hello_triangle_1_3/hello_triangle_1_3.h +++ b/samples/api/hello_triangle_1_3/hello_triangle_1_3.h @@ -169,8 +169,6 @@ class HelloTriangleV13 : public vkb::Application void transition_image_layout(VkCommandBuffer cmd, VkImage image, VkImageLayout oldLayout, VkImageLayout newLayout, VkAccessFlags2 srcAccessMask, VkAccessFlags2 dstAccessMask, VkPipelineStageFlags2 srcStage, VkPipelineStageFlags2 dstStage); - void teardown(); - uint32_t find_memory_type(VkPhysicalDevice physical_device, uint32_t type_filter, VkMemoryPropertyFlags properties); private: