| 692 | |
| 693 | template <vkb::BindingType bindingType> |
| 694 | inline void RenderContext<bindingType>::recreate() |
| 695 | { |
| 696 | LOGI("Recreated swapchain"); |
| 697 | |
| 698 | vk::Extent2D swapchain_extent = swapchain->get_extent(); |
| 699 | vk::Extent3D extent{swapchain_extent.width, swapchain_extent.height, 1}; |
| 700 | |
| 701 | auto frame_it = frames.begin(); |
| 702 | |
| 703 | for (auto &image_handle : swapchain->get_images()) |
| 704 | { |
| 705 | vkb::core::HPPImage swapchain_image{device, image_handle, extent, swapchain->get_format(), swapchain->get_usage()}; |
| 706 | |
| 707 | auto render_target = create_render_target_func(std::move(swapchain_image)); |
| 708 | |
| 709 | if (frame_it != frames.end()) |
| 710 | { |
| 711 | (*frame_it)->update_render_target(std::move(render_target)); |
| 712 | } |
| 713 | else |
| 714 | { |
| 715 | // Create a new frame if the new swapchain has more images than current frames |
| 716 | frames.emplace_back(std::make_unique<vkb::rendering::RenderFrameCpp>(device, std::move(render_target), thread_count)); |
| 717 | } |
| 718 | |
| 719 | ++frame_it; |
| 720 | } |
| 721 | |
| 722 | device.get_resource_cache().clear_framebuffers(); |
| 723 | } |
| 724 | |
| 725 | template <vkb::BindingType bindingType> |
| 726 | inline void RenderContext<bindingType>::recreate_swapchain() |
nothing calls this directly
no test coverage detected