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

Method cleanup

code/17_swap_chain_recreation.cpp:161–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected