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

Without this change, `LifetimeTracker::triage_suspected` never notices
that compute or render pipelines are free, and they stick around until
the hub is destroyed.

Fixes #2564.
This commit is contained in:
Jim Blandy authored and Dzmitry Malyshau committed 2022-03-31 22:59:11 -07:00
1 parent 85e5c36b68
commit 84fadca870
1 file changed
+18
+18
View File
@@ -4520,8 +4520,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);
};
@@ -4652,8 +4661,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);
};