Skip to content

Commit

Permalink
Simplify code and add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
yanchith committed Dec 13, 2019
1 parent 6a33725 commit 8d96012
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions wgpu-core/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1183,11 +1183,14 @@ impl<F: IdentityFilter<BindGroupLayoutId>> Global<F> {
let bindings = unsafe { slice::from_raw_parts(desc.bindings, desc.bindings_length) };

{
//TODO: figure out if binding order matters
let (bind_group_layout_guard, _) = hub.bind_group_layouts.read(&mut token);
for (id, value) in bind_group_layout_guard.iter(device_id.backend()) {
if &value.bindings[..] == bindings {
return id;
}
let bgl = bind_group_layout_guard
.iter(device_id.backend())
.find(|(_, value)| &value.bindings[..] == bindings);

if let Some((id, _)) = bgl {
return id;
}
}

Expand Down

0 comments on commit 8d96012

Please sign in to comment.