pub fn swap_images(
        &mut self,
        device: &Device,
        swapchain_loader: &Swapchain,
        swapchain: vk::SwapchainKHR,
    ) -> (vk::Semaphore, vk::Semaphore, vk::Fence, u32) {
        //TODO: What is the bool for?
        let (image_index, _) = unsafe {
            swapchain_loader.acquire_next_image(
                swapchain,
                u64::MAX,
                self.image_available_semaphores[self.frame],
                vk::Fence::null(),
            )
        }
        .unwrap();

        let image_in_flight = self.images_in_flight[image_index as usize];
        if image_in_flight != vk::Fence::null() {
            unsafe { device.wait_for_fences(&[image_in_flight], true, u64::MAX) }.unwrap();
        }
        self.images_in_flight[image_index as usize] = self.in_flight_fences[self.frame];

        (
            self.image_available_semaphores[self.frame],
            self.render_finished_semaphores[self.frame],
            self.in_flight_fences[self.frame],
            image_index,
        )
    }
///Swaps the queued images and returns a tuple containing:
///- next available semaphore
///- finished semaphore
///- in flight fence
///- swapimage index
Swaps the queued images and returns a tuple containing:
next available semaphore
finished semaphore
in flight fence
swapimage index
Swaps the queued images and returns a tuple containing : next available semaphore finished semaphore in flight fence swapimage index
pub fn swap_images(
        &mut self,
        device: &Device,
        swapchain_loader: &Swapchain,
        swapchain: vk::SwapchainKHR,
    ) -> (vk::Semaphore, vk::Semaphore, vk::Fence, u32) {
        //TODO: What is the bool for?
        let (image_index, _) = unsafe {
            swapchain_loader.acquire_next_image(
                swapchain,
                u64::MAX,
                self.image_available_semaphores[self.frame],
                vk::Fence::null(),
            )
        }
        .unwrap();
        let image_in_flight = self.images_in_flight[image_index as usize];
        if image_in_flight != vk::Fence::null() {
            unsafe { device.wait_for_fences(&[image_in_flight], true, u64::MAX) }.unwrap();
        }
        self.images_in_flight[image_index as usize] = self.in_flight_fences[self.frame];
        (
            self.image_available_semaphores[self.frame],
            self.render_finished_semaphores[self.frame],
            self.in_flight_fences[self.frame],
            image_index,
        )
    }
pub fn swap_images ( & mut self , device : & Device , swapchain_loader : & Swapchain , swapchain : vk :: SwapchainKHR , ) -> ( vk :: Semaphore , vk :: Semaphore , vk :: Fence , u32 ) { //TODO: What is the bool for? let ( image_index , _ ) = unsafe { swapchain_loader . acquire_next_image ( swapchain , u64 :: MAX , self . image_available_semaphores [ self . frame ] , vk :: Fence :: null ( ) , ) } . unwrap ( ) ; let image_in_flight = self . images_in_flight [ image_index as usize ] ; if image_in_flight != vk :: Fence :: null ( ) { unsafe { device . wait_for_fences ( & [ image_in_flight ] , true , u64 :: MAX ) } . unwrap ( ) ; } self . images_in_flight [ image_index as usize ] = self . in_flight_fences [ self . frame ] ; ( self . image_available_semaphores [ self . frame ] , self . render_finished_semaphores [ self . frame ] , self . in_flight_fences [ self . frame ] , image_index , ) }
Swaps the queued images and returns a tuple containing:
next available semaphore
finished semaphore
in flight fence
swapimage index
Swaps the queued images and returns a tuple containing : next available semaphore finished semaphore in flight fence swapimage index
&mut self
device
&Device
swapchain_loader
&Swapchain
swapchain
vk::SwapchainKHR