diff options
Diffstat (limited to 'third_party/rust/wgpu-hal/src/dx12/device.rs')
-rw-r--r-- | third_party/rust/wgpu-hal/src/dx12/device.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/third_party/rust/wgpu-hal/src/dx12/device.rs b/third_party/rust/wgpu-hal/src/dx12/device.rs index 3603b033b8..23bd409dc4 100644 --- a/third_party/rust/wgpu-hal/src/dx12/device.rs +++ b/third_party/rust/wgpu-hal/src/dx12/device.rs @@ -323,7 +323,9 @@ impl super::Device { } } -impl crate::Device<super::Api> for super::Device { +impl crate::Device for super::Device { + type A = super::Api; + unsafe fn exit(mut self, _queue: super::Queue) { self.rtv_pool.lock().free_handle(self.null_rtv_handle); self.mem_allocator = None; @@ -1098,7 +1100,16 @@ impl crate::Device<super::Api> for super::Device { } let mut dynamic_buffers = Vec::new(); - for (layout, entry) in desc.layout.entries.iter().zip(desc.entries.iter()) { + let layout_and_entry_iter = desc.entries.iter().map(|entry| { + let layout = desc + .layout + .entries + .iter() + .find(|layout_entry| layout_entry.binding == entry.binding) + .expect("internal error: no layout entry found with binding slot"); + (layout, entry) + }); + for (layout, entry) in layout_and_entry_iter { match layout.ty { wgt::BindingType::Buffer { has_dynamic_offset: true, |