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

Method cleanup

code/21_index_buffer.cpp:213–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211 }
212
213 void cleanup() {
214 cleanupSwapChain();
215
216 vkDestroyPipeline(device, graphicsPipeline, nullptr);
217 vkDestroyPipelineLayout(device, pipelineLayout, nullptr);
218 vkDestroyRenderPass(device, renderPass, nullptr);
219
220 vkDestroyBuffer(device, indexBuffer, nullptr);
221 vkFreeMemory(device, indexBufferMemory, nullptr);
222
223 vkDestroyBuffer(device, vertexBuffer, nullptr);
224 vkFreeMemory(device, vertexBufferMemory, nullptr);
225
226 for (size_t i = 0; i < MAX_FRAMES_IN_FLIGHT; i++) {
227 vkDestroySemaphore(device, renderFinishedSemaphores[i], nullptr);
228 vkDestroySemaphore(device, imageAvailableSemaphores[i], nullptr);
229 vkDestroyFence(device, inFlightFences[i], nullptr);
230 }
231
232 vkDestroyCommandPool(device, commandPool, nullptr);
233
234 vkDestroyDevice(device, nullptr);
235
236 if (enableValidationLayers) {
237 DestroyDebugUtilsMessengerEXT(instance, debugMessenger, nullptr);
238 }
239
240 vkDestroySurfaceKHR(instance, surface, nullptr);
241 vkDestroyInstance(instance, nullptr);
242
243 glfwDestroyWindow(window);
244
245 glfwTerminate();
246 }
247
248 void recreateSwapChain() {
249 int width = 0, height = 0;

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected