From 6538ac5d266434f85171254d61a6ec0b3bea4c8b Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Sun, 24 Jan 2021 12:23:28 -0500 Subject: [PATCH] Remove temporary allocation for gpu-descriptor --- wgpu-core/src/device/descriptor.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wgpu-core/src/device/descriptor.rs b/wgpu-core/src/device/descriptor.rs index 891caad2bd..3b350233eb 100644 --- a/wgpu-core/src/device/descriptor.rs +++ b/wgpu-core/src/device/descriptor.rs @@ -141,13 +141,11 @@ impl unsafe fn alloc_descriptor_sets<'a>( &self, pool: &mut B::DescriptorPool, - layouts: impl Iterator, + layouts: impl ExactSizeIterator, sets: &mut impl Extend, ) -> Result<(), gpu_descriptor::DeviceAllocationError> { use gpu_descriptor::DeviceAllocationError as Dae; - //TODO: https://github.com/zakarumych/gpu-descriptor/pull/10 - let temp_layouts = layouts.collect::>(); - match hal::pso::DescriptorPool::allocate(pool, temp_layouts, sets) { + match hal::pso::DescriptorPool::allocate(pool, layouts, sets) { Ok(()) => Ok(()), Err(hal::pso::AllocationError::OutOfMemory(oom)) => Err(match oom { hal::device::OutOfMemory::Host => Dae::OutOfHostMemory,