Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Hang in Multithreaded Compute Test #4975

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading