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

wgpu-core: Register new pipelines with device's tracker. #2565

Merged
merged 2 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
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
18 changes: 18 additions & 0 deletions wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4484,8 +4484,17 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(pair) => pair,
Err(e) => break e,
};
let ref_count = pipeline.life_guard.add_ref();

let id = fid.assign(pipeline, &mut token);
log::info!("Created render pipeline {:?} with {:?}", id, desc);

device
.trackers
.lock()
.render_pipes
.init(id, ref_count, PhantomData)
.unwrap();
return (id.0, None);
};

Expand Down Expand Up @@ -4615,8 +4624,17 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(pair) => pair,
Err(e) => break e,
};
let ref_count = pipeline.life_guard.add_ref();

let id = fid.assign(pipeline, &mut token);
log::info!("Created compute pipeline {:?} with {:?}", id, desc);

device
.trackers
.lock()
.compute_pipes
.init(id, ref_count, PhantomData)
.unwrap();
return (id.0, None);
};

Expand Down
4 changes: 4 additions & 0 deletions wgpu-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,12 @@ platform supports.";
///
/// Uses of this macro have the form:
///
/// ```ignore
///
/// gfx_select!(id => global.method(args...))
///
/// ```
///
/// where `id` is some [`id::Id`] resource id, `global` is a [`hub::Global`],
/// and `method` is any method on [`Global`] that takes a single generic
/// parameter that implements [`hal::Api`] (for example,
Expand Down