/// Cleans up all resources dependent on the swapchain and the swapchain
/// itself.
/// * ImageViews
/// * Render Passes
/// * Graphics Pipelines
/// * Framebuffers
/// * Command Buffers.
///
/// Optionally takes in the old swapchain images and handle to clean up for
/// recreation, otherwise cleans up the currently active swapchain.
Cleans up all resources dependent on the swapchain and the swapchain
itself.
ImageViews
Render Passes
Graphics Pipelines
Framebuffers
Command Buffers.

Optionally takes in the old swapchain images and handle to clean up for
recreation, otherwise cleans up the currently active swapchain.
Cleans up all resources dependent on the swapchain and the swapchain itself . ImageViews Render Passes Graphics Pipelines Framebuffers Command Buffers . Optionally takes in the old swapchain images and handle to clean up for recreation otherwise cleans up the currently active swapchain .
unsafe fn cleanup_swapchain(
    &self, old_swapchain_bundle: Option<(&[ImageAndView], vk::SwapchainKHR)>,
  ) -> SarektResult<()> {
    let logical_device = &self.vulkan_device_structures.logical_device;
    self.draw_synchronization.wait_for_all_frames()?;
    info!("Destroying descriptor pools...");
    for &desc_pool in self.main_descriptor_pools.iter() {
      logical_device.destroy_descriptor_pool(desc_pool, None);
    }
    self.pipelines.cleanup(logical_device);
    let (images, swapchain) = old_swapchain_bundle.unwrap_or((
      self.render_target_bundle.render_targets.as_slice(),
      self.render_target_bundle.swapchain_and_extension.swapchain,
    ));
    self.render_target_bundle.cleanup_render_targets(
      &self.vulkan_device_structures,
      images,
      swapchain,
    );
    Ok(())
  }
unsafe fn cleanup_swapchain ( & self , old_swapchain_bundle : Option < ( & [ ImageAndView ] , vk :: SwapchainKHR ) > , ) -> SarektResult < ( ) > { let logical_device = & self . vulkan_device_structures . logical_device ; self . draw_synchronization . wait_for_all_frames ( ) ? ; info ! ( " " ) ; for & desc_pool in self . main_descriptor_pools . iter ( ) { logical_device . destroy_descriptor_pool ( desc_pool , None ) ; } self . pipelines . cleanup ( logical_device ) ; let ( images , swapchain ) = old_swapchain_bundle . unwrap_or ( ( self . render_target_bundle . render_targets . as_slice ( ) , self . render_target_bundle . swapchain_and_extension . swapchain , ) ) ; self . render_target_bundle . cleanup_render_targets ( & self . vulkan_device_structures , images , swapchain , ) ; Ok ( ( ) ) }
Cleans up all resources dependent on the swapchain and the swapchain
itself.
Cleans up all resources dependent on the swapchain and the swapchain itself .
&self
old_swapchain_bundle
Option<(&[ImageAndView], vk::SwapchainKHR)>