| 198 | } |
| 199 | |
| 200 | void cleanup() { |
| 201 | cleanupSwapChain(); |
| 202 | |
| 203 | vkDestroyPipeline(device, graphicsPipeline, nullptr); |
| 204 | vkDestroyPipelineLayout(device, pipelineLayout, nullptr); |
| 205 | vkDestroyRenderPass(device, renderPass, nullptr); |
| 206 | |
| 207 | for (size_t i = 0; i < MAX_FRAMES_IN_FLIGHT; i++) { |
| 208 | vkDestroySemaphore(device, renderFinishedSemaphores[i], nullptr); |
| 209 | vkDestroySemaphore(device, imageAvailableSemaphores[i], nullptr); |
| 210 | vkDestroyFence(device, inFlightFences[i], nullptr); |
| 211 | } |
| 212 | |
| 213 | vkDestroyCommandPool(device, commandPool, nullptr); |
| 214 | |
| 215 | vkDestroyDevice(device, nullptr); |
| 216 | |
| 217 | if (enableValidationLayers) { |
| 218 | DestroyDebugUtilsMessengerEXT(instance, debugMessenger, nullptr); |
| 219 | } |
| 220 | |
| 221 | vkDestroySurfaceKHR(instance, surface, nullptr); |
| 222 | vkDestroyInstance(instance, nullptr); |
| 223 | |
| 224 | glfwDestroyWindow(window); |
| 225 | |
| 226 | glfwTerminate(); |
| 227 | } |
| 228 | |
| 229 | void recreateSwapChain() { |
| 230 | int width = 0, height = 0; |
nothing calls this directly
no test coverage detected