| 159 | } |
| 160 | |
| 161 | void cleanup() { |
| 162 | cleanupSwapChain(); |
| 163 | |
| 164 | vkDestroyPipeline(device, graphicsPipeline, nullptr); |
| 165 | vkDestroyPipelineLayout(device, pipelineLayout, nullptr); |
| 166 | |
| 167 | vkDestroyRenderPass(device, renderPass, nullptr); |
| 168 | |
| 169 | for (size_t i = 0; i < MAX_FRAMES_IN_FLIGHT; i++) { |
| 170 | vkDestroySemaphore(device, renderFinishedSemaphores[i], nullptr); |
| 171 | vkDestroySemaphore(device, imageAvailableSemaphores[i], nullptr); |
| 172 | vkDestroyFence(device, inFlightFences[i], nullptr); |
| 173 | } |
| 174 | |
| 175 | vkDestroyCommandPool(device, commandPool, nullptr); |
| 176 | |
| 177 | vkDestroyDevice(device, nullptr); |
| 178 | |
| 179 | if (enableValidationLayers) { |
| 180 | DestroyDebugUtilsMessengerEXT(instance, debugMessenger, nullptr); |
| 181 | } |
| 182 | |
| 183 | vkDestroySurfaceKHR(instance, surface, nullptr); |
| 184 | vkDestroyInstance(instance, nullptr); |
| 185 | |
| 186 | glfwDestroyWindow(window); |
| 187 | |
| 188 | glfwTerminate(); |
| 189 | } |
| 190 | |
| 191 | void recreateSwapChain() { |
| 192 | int width = 0, height = 0; |
nothing calls this directly
no test coverage detected