MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator / FinalizeApplication

Function FinalizeApplication

src/VulkanSample.cpp:2316–2410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2314}
2315
2316static void FinalizeApplication()
2317{
2318 vkDeviceWaitIdle(g_hDevice);
2319
2320 DestroySwapchain(true);
2321
2322 if(g_hDescriptorPool != VK_NULL_HANDLE)
2323 {
2324 vkDestroyDescriptorPool(g_hDevice, g_hDescriptorPool, g_Allocs);
2325 g_hDescriptorPool = VK_NULL_HANDLE;
2326 }
2327
2328 if(g_hDescriptorSetLayout != VK_NULL_HANDLE)
2329 {
2330 vkDestroyDescriptorSetLayout(g_hDevice, g_hDescriptorSetLayout, g_Allocs);
2331 g_hDescriptorSetLayout = VK_NULL_HANDLE;
2332 }
2333
2334 if(g_hTextureImageView != VK_NULL_HANDLE)
2335 {
2336 vkDestroyImageView(g_hDevice, g_hTextureImageView, g_Allocs);
2337 g_hTextureImageView = VK_NULL_HANDLE;
2338 }
2339 if(g_hTextureImage != VK_NULL_HANDLE)
2340 {
2341 vmaDestroyImage(g_hAllocator, g_hTextureImage, g_hTextureImageAlloc);
2342 g_hTextureImage = VK_NULL_HANDLE;
2343 }
2344
2345 if(g_hIndexBuffer != VK_NULL_HANDLE)
2346 {
2347 vmaDestroyBuffer(g_hAllocator, g_hIndexBuffer, g_hIndexBufferAlloc);
2348 g_hIndexBuffer = VK_NULL_HANDLE;
2349 }
2350 if(g_hVertexBuffer != VK_NULL_HANDLE)
2351 {
2352 vmaDestroyBuffer(g_hAllocator, g_hVertexBuffer, g_hVertexBufferAlloc);
2353 g_hVertexBuffer = VK_NULL_HANDLE;
2354 }
2355
2356 if(g_hSampler != VK_NULL_HANDLE)
2357 {
2358 vkDestroySampler(g_hDevice, g_hSampler, g_Allocs);
2359 g_hSampler = VK_NULL_HANDLE;
2360 }
2361
2362 if(g_ImmediateFence)
2363 {
2364 vkDestroyFence(g_hDevice, g_ImmediateFence, g_Allocs);
2365 g_ImmediateFence = VK_NULL_HANDLE;
2366 }
2367
2368 for(size_t i = COMMAND_BUFFER_COUNT; i--; )
2369 {
2370 if(g_MainCommandBufferExecutedFences[i] != VK_NULL_HANDLE)
2371 {
2372 vkDestroyFence(g_hDevice, g_MainCommandBufferExecutedFences[i], g_Allocs);
2373 g_MainCommandBufferExecutedFences[i] = VK_NULL_HANDLE;

Callers 1

WndProcFunction · 0.85

Calls 4

DestroySwapchainFunction · 0.85
vmaDestroyImageFunction · 0.85
vmaDestroyBufferFunction · 0.85
vmaDestroyAllocatorFunction · 0.85

Tested by

no test coverage detected