Skip to content

Commit

Permalink
Fix hang in multithreaded test (#4975)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald authored Jan 3, 2024
1 parent d03e290 commit fd37dbf
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions wgpu-core/src/device/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
trace.add(trace::Action::CreateBindGroup(fid.id(), desc.clone()));
}

let bind_group_layout_guard = hub.bind_group_layouts.read();
let bind_group_layout = match bind_group_layout_guard.get(desc.layout) {
let bind_group_layout = match hub.bind_group_layouts.get(desc.layout) {
Ok(layout) => layout,
Err(..) => break binding_model::CreateBindGroupError::InvalidLayout,
};
Expand All @@ -1146,7 +1145,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
break DeviceError::WrongDevice.into();
}

let bind_group = match device.create_bind_group(bind_group_layout, desc, hub) {
let bind_group = match device.create_bind_group(&bind_group_layout, desc, hub) {
Ok(bind_group) => bind_group,
Err(e) => break e,
};
Expand Down Expand Up @@ -1779,9 +1778,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
let hub = A::hub(self);

let error = loop {
let pipeline_guard = hub.compute_pipelines.read();

let pipeline = match pipeline_guard.get(pipeline_id) {
let pipeline = match hub.compute_pipelines.get(pipeline_id) {
Ok(pipeline) => pipeline,
Err(_) => break binding_model::GetBindGroupLayoutError::InvalidPipeline,
};
Expand Down

0 comments on commit fd37dbf

Please sign in to comment.