MCPcopy Create free account
hub / github.com/Overv/VulkanTutorial / cleanup

Method cleanup

code/13_framebuffers.cpp:125–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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()) {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected