diff --git a/VulkanTutorial.cpp b/VulkanTutorial.cpp index 55b7fa8..cb3dc3e 100644 --- a/VulkanTutorial.cpp +++ b/VulkanTutorial.cpp @@ -112,6 +112,7 @@ void HelloTriangleApplication::initVulkan() { creatImageView(); + createRenderPass(); createGraphicPipeline(); } @@ -130,9 +131,10 @@ void HelloTriangleApplication::mainLoop(GLFWwindow* window){ void HelloTriangleApplication::cleanup(GLFWwindow* window) { - std::cout << "start to destroy resource" << std::endl; + std::cout << "\nstart to destroy resource\n" << std::endl; vkDestroyPipelineLayout(device, pipelineLayout, nullptr); + vkDestroyRenderPass(device, renderPass, nullptr); for (auto imageView : swapChainImageViews) { @@ -603,6 +605,44 @@ VkShaderModule HelloTriangleApplication::createShaderModule(const std::vector swapChainImageViews; + VkRenderPass renderPass; VkPipelineLayout pipelineLayout; struct QueueFamilyIndices @@ -128,6 +129,7 @@ private: void creatImageView(); + void createRenderPass(); void createGraphicPipeline(); static std::vector readFile(const std::string& filename);