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

Method cleanup

code/14_command_buffers.cpp:130–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128 }
129
130 void cleanup() {
131 vkDestroyCommandPool(device, commandPool, nullptr);
132
133 for (auto framebuffer : swapChainFramebuffers) {
134 vkDestroyFramebuffer(device, framebuffer, nullptr);
135 }
136
137 vkDestroyPipeline(device, graphicsPipeline, nullptr);
138 vkDestroyPipelineLayout(device, pipelineLayout, nullptr);
139 vkDestroyRenderPass(device, renderPass, nullptr);
140
141 for (auto imageView : swapChainImageViews) {
142 vkDestroyImageView(device, imageView, nullptr);
143 }
144
145 vkDestroySwapchainKHR(device, swapChain, nullptr);
146 vkDestroyDevice(device, nullptr);
147
148 if (enableValidationLayers) {
149 DestroyDebugUtilsMessengerEXT(instance, debugMessenger, nullptr);
150 }
151
152 vkDestroySurfaceKHR(instance, surface, nullptr);
153 vkDestroyInstance(instance, nullptr);
154
155 glfwDestroyWindow(window);
156
157 glfwTerminate();
158 }
159
160 void createInstance() {
161 if (enableValidationLayers && !checkValidationLayerSupport()) {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected