move cleanup stuff to vk_finish

This commit is contained in:
jacekpoz 2024-09-25 19:33:20 +02:00
parent 22f41e1172
commit 96721f78ee
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
3 changed files with 10 additions and 4 deletions

View file

@ -197,10 +197,7 @@ int ptk_run(PtkHandle root) {
}
}
vkDeviceWaitIdle(g_dev);
vk_cleanup();
vk_components_cleanup();
vk_finish();
return EXIT_SUCCESS;
}

View file

@ -346,6 +346,13 @@ bool vk_is_done(void) {
return glfwWindowShouldClose(g_window);
}
void vk_finish(void) {
vkDeviceWaitIdle(g_dev);
vk_cleanup();
vk_components_cleanup();
}
void vk_cleanup(void) {
vk_cleanup_swapchain(g_dev);

View file

@ -36,6 +36,8 @@ bool vk_init(GLFWwindow *window, const size_t width, const size_t height, const
bool vk_is_done(void);
void vk_finish(void);
bool vk_transfer_vertex_data(void);
bool vk_record_command_buffer(const VkCommandBuffer command_buffer, const uint32_t image_index);