mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
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:
committed by
Dzmitry Malyshau
parent
85e5c36b68
commit
84fadca870
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user