From fd37dbfae98de6f743a37ee7744dabdb0d36f996 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Wed, 3 Jan 2024 17:05:35 -0500 Subject: [PATCH] Fix hang in multithreaded test (#4975) --- wgpu-core/src/device/global.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wgpu-core/src/device/global.rs b/wgpu-core/src/device/global.rs index 914d220c1a..8ec7cf49be 100644 --- a/wgpu-core/src/device/global.rs +++ b/wgpu-core/src/device/global.rs @@ -1136,8 +1136,7 @@ impl Global { 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, }; @@ -1146,7 +1145,7 @@ impl Global { 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, }; @@ -1779,9 +1778,7 @@ impl Global { 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, };