pub fn acquire_resource_usage(&mut self) -> PassResourceUsage {
        let mut result = PassResourceUsage::default();
        result.buffers.reserve(self.buffer_usages.len());
        result.textures.reserve(self.texture_usages.len());
        for (buffer, usage) in self.buffer_usages.drain() {
            result.buffers.push((buffer, usage));
        }
        for (texture, usage) in self.texture_usages.drain() {
            result.textures.push((texture, usage));
        }
        result
    }
// TODO: Verify that this is draining operation. Dawn doesn't explicitly
//      drain the buffer_usages or texture_usages, but the pass tracker
//      object only lives for a single pass and it wouldn't make sense
//      for more commands to record usage after the pass has ended.
//      By draining here, we can prevent Arc::clone on all the buffers
//      and textures.
Verify that this is draining operation. Dawn doesn't explicitly
drain the buffer_usages or texture_usages, but the pass tracker
object only lives for a single pass and it wouldn't make sense
for more commands to record usage after the pass has ended.
By draining here, we can prevent Arc::clone on all the buffers
and textures.
Verify that this is draining operation . Dawn doesn ' t explicitly drain the buffer_usages or texture_usages but the pass tracker object only lives for a single pass and it wouldn ' t make sense for more commands to record usage after the pass has ended . By draining here we can prevent Arc :: clone on all the buffers and textures .
pub fn acquire_resource_usage(&mut self) -> PassResourceUsage {
        let mut result = PassResourceUsage::default();
        result.buffers.reserve(self.buffer_usages.len());
        result.textures.reserve(self.texture_usages.len());
        for (buffer, usage) in self.buffer_usages.drain() {
            result.buffers.push((buffer, usage));
        }
        for (texture, usage) in self.texture_usages.drain() {
            result.textures.push((texture, usage));
        }
        result
    }
pub fn acquire_resource_usage ( & mut self ) -> PassResourceUsage { let mut result = PassResourceUsage :: default ( ) ; result . buffers . reserve ( self . buffer_usages . len ( ) ) ; result . textures . reserve ( self . texture_usages . len ( ) ) ; for ( buffer , usage ) in self . buffer_usages . drain ( ) { result . buffers . push ( ( buffer , usage ) ) ; } for ( texture , usage ) in self . texture_usages . drain ( ) { result . textures . push ( ( texture , usage ) ) ; } result }
TODO: Verify that this is draining operation.
TODO : Verify that this is draining operation .
&mut self
&mut self