diff options
| author | Quentin Ladevie <ladevie.quentin@gmail.com> | 2021-03-14 23:28:39 +0100 |
|---|---|---|
| committer | Quentin Ladevie <ladevie.quentin@gmail.com> | 2021-03-14 23:28:39 +0100 |
| commit | da0bf8dc570f6e8421b8d80546dfce913b8251ad (patch) | |
| tree | 06646be201b1157923a8f08e7d7562859cb3f1a5 /src/vk-renderer.cpp | |
| parent | 26369a8cdf90320cdd472fdca23ee38f7ce48302 (diff) | |
Make it compile on mac
Diffstat (limited to 'src/vk-renderer.cpp')
| -rw-r--r-- | src/vk-renderer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vk-renderer.cpp b/src/vk-renderer.cpp index dfd2bca..8d074c5 100644 --- a/src/vk-renderer.cpp +++ b/src/vk-renderer.cpp @@ -2,8 +2,6 @@ #include <cstring> #include <cassert> -#include <functional> - #include "imgui.h" #include "vk-renderer.hpp" #include "thirdparty/vk_mem_alloc.h" @@ -34,7 +32,7 @@ vkrenderer::vkrenderer(window& wnd, const input_data& inputs) { VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT, - std::nullopt + VK_NULL_HANDLE ); compute_sets_bindings = { @@ -406,13 +404,16 @@ void vkrenderer::finish_frame() { void vkrenderer::recreate_swapchain() { VKRESULT(vkWaitForFences(api.context.device, submission_fences.size(), submission_fences.data(), VK_TRUE, UINT64_MAX)) + Swapchain old_swapchain = swapchain; swapchain = api.create_swapchain( platform_surface, min_swapchain_image_count, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT, - std::optional<std::reference_wrapper<Swapchain>> { std::ref(swapchain) } + old_swapchain.handle ); + api.destroy_swapchain(old_swapchain); + api.destroy_images(accumulation_images); VkExtent3D image_size = { .width = swapchain.extent.width, |
