pub fn update(
        &mut self,
        device: &ash::Device,
    ) -> VkResult<()> {
        self.frame_index += Wrapping(1);

        // Determine how many pools we can drain
        let mut pools_to_drain = 0;
        for in_flight_pool in &self.in_flight_pools {
            // If frame_index matches or exceeds live_until_frame, then the result will be a very
            // high value due to wrapping a negative value to u32::MAX
            if in_flight_pool.live_until_frame - self.frame_index > Wrapping(std::u32::MAX / 2) {
                pools_to_drain += 1;
            } else {
                break;
            }
        }

        // Reset them and add them to the list of pools ready to be allocated
        let pools_to_reset: Vec<_> = self.in_flight_pools.drain(0..pools_to_drain).collect();
        for mut pool_to_reset in pools_to_reset {
            T::reset(device, &mut pool_to_reset.pool)?;
            self.reset_pools.push(pool_to_reset.pool);
        }

        Ok(())
    }
/// Call when we are ready to reset another set of resources, most likely when a frame is
/// presented or a new frame begins
Call when we are ready to reset another set of resources, most likely when a frame is
presented or a new frame begins
Call when we are ready to reset another set of resources most likely when a frame is presented or a new frame begins
pub fn update(
        &mut self,
        device: &ash::Device,
    ) -> VkResult<()> {
        self.frame_index += Wrapping(1);
        // Determine how many pools we can drain
        let mut pools_to_drain = 0;
        for in_flight_pool in &self.in_flight_pools {
            // If frame_index matches or exceeds live_until_frame, then the result will be a very
            // high value due to wrapping a negative value to u32::MAX
            if in_flight_pool.live_until_frame - self.frame_index > Wrapping(std::u32::MAX / 2) {
                pools_to_drain += 1;
            } else {
                break;
            }
        }
        // Reset them and add them to the list of pools ready to be allocated
        let pools_to_reset: Vec<_> = self.in_flight_pools.drain(0..pools_to_drain).collect();
        for mut pool_to_reset in pools_to_reset {
            T::reset(device, &mut pool_to_reset.pool)?;
            self.reset_pools.push(pool_to_reset.pool);
        }
        Ok(())
    }
pub fn update ( & mut self , device : & ash :: Device , ) -> VkResult < ( ) > { self . frame_index += Wrapping ( 1 ) ; // Determine how many pools we can drain let mut pools_to_drain = 0 ; for in_flight_pool in & self . in_flight_pools { // If frame_index matches or exceeds live_until_frame, then the result will be a very // high value due to wrapping a negative value to u32::MAX if in_flight_pool . live_until_frame - self . frame_index > Wrapping ( std :: u32 :: MAX / 2 ) { pools_to_drain += 1 ; } else { break ; } } // Reset them and add them to the list of pools ready to be allocated let pools_to_reset : Vec < _ > = self . in_flight_pools . drain ( 0 .. pools_to_drain ) . collect ( ) ; for mut pool_to_reset in pools_to_reset { T :: reset ( device , & mut pool_to_reset . pool ) ? ; self . reset_pools . push ( pool_to_reset . pool ) ; } Ok ( ( ) ) }
Call when we are ready to reset another set of resources, most likely when a frame is
presented or a new frame begins
Call when we are ready to reset another set of resources most likely when a frame is presented or a new frame begins
&mut self
device
&ash::Device
&mut self
device
&ash::Device