Skip to content

Commit 7a6ac42

Browse files
committed
Remove pop + push logic
1 parent 7585e02 commit 7a6ac42

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wgpu-hal/src/vulkan/descriptor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,14 @@ impl DescriptorBucket {
335335
}
336336

337337
unsafe fn cleanup(&mut self, device: &super::DeviceShared) {
338-
while let Some(pool) = self.pools.pop_front() {
339-
if pool.allocated != 0 {
340-
self.pools.push_front(pool);
338+
while self.pools.len() > 1 {
339+
if self.pools.front().unwrap().allocated != 0 {
341340
break;
342341
}
343342

344343
log::trace!("Destroying old descriptor pool");
345344

345+
let pool = self.pools.pop_front().unwrap();
346346
unsafe { device.raw.destroy_descriptor_pool(pool.raw, None) };
347347
self.offset += 1;
348348
}

0 commit comments

Comments
 (0)