pub fn rebuild_swapchain(
        &mut self,
        window_surface: &dyn WindowSurface,
    ) -> Result<Arc<Swapchain>> {
        unsafe {
            self.device.logical_device.device_wait_idle()?;
            self.frames_in_flight.clear();
        }
        self.swapchain = self.swapchain.rebuild(window_surface)?;
        self.frames_in_flight =
            Frame::create_n_frames(&self.device, &self.swapchain.framebuffers)?;
        self.swapchain_state = SwapchainState::Ok;

        Ok(self.swapchain.clone())
    }
/// Wait for all rendering operations to complete on every frame, then
/// rebuild the swapchain.
///
/// Returns a clone of the swapchain which can be used by other systems.
Wait for all rendering operations to complete on every frame, then
rebuild the swapchain.

Returns a clone of the swapchain which can be used by other systems.
Wait for all rendering operations to complete on every frame then rebuild the swapchain . Returns a clone of the swapchain which can be used by other systems .
pub fn rebuild_swapchain(
        &mut self,
        window_surface: &dyn WindowSurface,
    ) -> Result<Arc<Swapchain>> {
        unsafe {
            self.device.logical_device.device_wait_idle()?;
            self.frames_in_flight.clear();
        }
        self.swapchain = self.swapchain.rebuild(window_surface)?;
        self.frames_in_flight =
            Frame::create_n_frames(&self.device, &self.swapchain.framebuffers)?;
        self.swapchain_state = SwapchainState::Ok;
        Ok(self.swapchain.clone())
    }
pub fn rebuild_swapchain ( & mut self , window_surface : & dyn WindowSurface , ) -> Result < Arc < Swapchain > > { unsafe { self . device . logical_device . device_wait_idle ( ) ? ; self . frames_in_flight . clear ( ) ; } self . swapchain = self . swapchain . rebuild ( window_surface ) ? ; self . frames_in_flight = Frame :: create_n_frames ( & self . device , & self . swapchain . framebuffers ) ? ; self . swapchain_state = SwapchainState :: Ok ; Ok ( self . swapchain . clone ( ) ) }
Wait for all rendering operations to complete on every frame, then
rebuild the swapchain.
Wait for all rendering operations to complete on every frame then rebuild the swapchain .
&mut self
window_surface
&dyn WindowSurface