| 123 | } |
| 124 | |
| 125 | void cleanup() { |
| 126 | for (auto framebuffer : swapChainFramebuffers) { |
| 127 | vkDestroyFramebuffer(device, framebuffer, nullptr); |
| 128 | } |
| 129 | |
| 130 | vkDestroyPipeline(device, graphicsPipeline, nullptr); |
| 131 | vkDestroyPipelineLayout(device, pipelineLayout, nullptr); |
| 132 | vkDestroyRenderPass(device, renderPass, nullptr); |
| 133 | |
| 134 | for (auto imageView : swapChainImageViews) { |
| 135 | vkDestroyImageView(device, imageView, nullptr); |
| 136 | } |
| 137 | |
| 138 | vkDestroySwapchainKHR(device, swapChain, nullptr); |
| 139 | vkDestroyDevice(device, nullptr); |
| 140 | |
| 141 | if (enableValidationLayers) { |
| 142 | DestroyDebugUtilsMessengerEXT(instance, debugMessenger, nullptr); |
| 143 | } |
| 144 | |
| 145 | vkDestroySurfaceKHR(instance, surface, nullptr); |
| 146 | vkDestroyInstance(instance, nullptr); |
| 147 | |
| 148 | glfwDestroyWindow(window); |
| 149 | |
| 150 | glfwTerminate(); |
| 151 | } |
| 152 | |
| 153 | void createInstance() { |
| 154 | if (enableValidationLayers && !checkValidationLayerSupport()) { |
nothing calls this directly
no test coverage detected