pub fn acquire_next_image(&mut self) -> VkResult<u32> {
        self.current_flip = (self.current_flip + 1) % self.image_count;
        let current = self.current_flip;

        // let acquired_fence = &mut self.acquired_fences[current];
        // assert_eq!(
        //     acquired_fence
        //         .wait(Some(Duration::from_nanos(5e10 as u64)))
        //         .unwrap(),
        //     VkSuccess::Success
        // );
        // acquired_fence.reset().unwrap();
        // let acquired_fence = acquired_fence.object();

        let acquire_semaphore = self.acquired_semaphores[current];

        let r = match self.vd.acquire_next_image(
            self.object(),
            u64::MAX,
            acquire_semaphore,
            VK_NULL_HANDLE, /* acquired_fence */
        ) {
            Ok(acquired_image_index) => {
                self.current_buffer_index = acquired_image_index as usize;
                Ok(acquired_image_index)
            }
            Err(e) => match e {
                VkError::OutOfDateKhr | VkError::SurfaceLostKhr | VkError::SuboptimalKhr => Err(e),
                _ => panic_with_log!("vkAcquireNextImageKHR(): Unexpected VkError"),
            },
        };

        r
    }
/// Acquire next available image from Vulkan swapchain.
Acquire next available image from Vulkan swapchain.
Acquire next available image from Vulkan swapchain .
pub fn acquire_next_image(&mut self) -> VkResult<u32> {
        self.current_flip = (self.current_flip + 1) % self.image_count;
        let current = self.current_flip;
        // let acquired_fence = &mut self.acquired_fences[current];
        // assert_eq!(
        //     acquired_fence
        //         .wait(Some(Duration::from_nanos(5e10 as u64)))
        //         .unwrap(),
        //     VkSuccess::Success
        // );
        // acquired_fence.reset().unwrap();
        // let acquired_fence = acquired_fence.object();
        let acquire_semaphore = self.acquired_semaphores[current];
        let r = match self.vd.acquire_next_image(
            self.object(),
            u64::MAX,
            acquire_semaphore,
            VK_NULL_HANDLE, /* acquired_fence */
        ) {
            Ok(acquired_image_index) => {
                self.current_buffer_index = acquired_image_index as usize;
                Ok(acquired_image_index)
            }
            Err(e) => match e {
                VkError::OutOfDateKhr | VkError::SurfaceLostKhr | VkError::SuboptimalKhr => Err(e),
                _ => panic_with_log!("vkAcquireNextImageKHR(): Unexpected VkError"),
            },
        };
        r
    }
pub fn acquire_next_image ( & mut self ) -> VkResult < u32 > { self . current_flip = ( self . current_flip + 1 ) % self . image_count ; let current = self . current_flip ; // let acquired_fence = &mut self.acquired_fences[current]; // assert_eq!( //     acquired_fence //         .wait(Some(Duration::from_nanos(5e10 as u64))) //         .unwrap(), //     VkSuccess::Success // ); // acquired_fence.reset().unwrap(); // let acquired_fence = acquired_fence.object(); let acquire_semaphore = self . acquired_semaphores [ current ] ; let r = match self . vd . acquire_next_image ( self . object ( ) , u64 :: MAX , acquire_semaphore , VK_NULL_HANDLE , /* acquired_fence */ ) { Ok ( acquired_image_index ) => { self . current_buffer_index = acquired_image_index as usize ; Ok ( acquired_image_index ) } Err ( e ) => match e { VkError :: OutOfDateKhr | VkError :: SurfaceLostKhr | VkError :: SuboptimalKhr => Err ( e ) , _ => panic_with_log ! ( " " ) , } , } ; r }
Acquire next available image from Vulkan swapchain.
Acquire next available image from Vulkan swapchain .
&mut self
&mut self