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