MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ cleanup()

void MayaFlux::Core::WindowRenderContext::cleanup ( VKContext context)

Definition at line 14 of file BackendWindowHandler.cpp.

15{
16 vk::Device device = context.get_device();
17
18 device.waitIdle();
19
20 for (auto& img : image_available) {
21 if (img) {
22 device.destroySemaphore(img);
23 }
24 }
25 image_available.clear();
26
27 for (auto& render : render_finished) {
28 if (render) {
29 device.destroySemaphore(render);
30 }
31 }
32 render_finished.clear();
33
35
36 for (auto& fence : in_flight) {
37 if (fence) {
38 device.destroyFence(fence);
39 }
40 }
41 in_flight.clear();
42
43 if (depth_image && depth_image->is_initialized()) {
44 const auto& res = depth_image->get_image_resources();
45 if (res.image_view) {
46 device.destroyImageView(res.image_view);
47 }
48 if (res.memory) {
49 device.freeMemory(res.memory);
50 }
51 if (res.image) {
52 device.destroyImage(res.image);
53 }
54 depth_image.reset();
55 }
56
57 if (swapchain) {
58 swapchain->cleanup();
59 swapchain.reset();
60 }
61
62 if (surface) {
63 context.destroy_surface(surface);
64 surface = nullptr;
65 }
66
67 window->set_graphics_registered(false);
68}
std::vector< vk::Semaphore > image_available
std::unique_ptr< VKSwapchain > swapchain
std::vector< vk::Semaphore > render_finished
std::vector< vk::CommandBuffer > clear_command_buffers

References clear_command_buffers, depth_image, MayaFlux::Core::VKContext::destroy_surface(), MayaFlux::Core::VKContext::get_device(), image_available, in_flight, render_finished, surface, swapchain, and window.

+ Here is the call graph for this function: