mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Hot patch for temp_suspected tracking
This commit is contained in:
@@ -312,15 +312,12 @@ impl<A: HalApi> LifetimeTracker<A> {
|
||||
pub(super) fn triage_suspected<G: GlobalIdentityHandlerFactory>(
|
||||
&mut self,
|
||||
hub: &Hub<A, G>,
|
||||
new_suspects: &SuspectedResources,
|
||||
trackers: &Mutex<TrackerSet>,
|
||||
#[cfg(feature = "trace")] trace: Option<&Mutex<trace::Trace>>,
|
||||
token: &mut Token<super::Device<A>>,
|
||||
) {
|
||||
profiling::scope!("triage_suspected");
|
||||
|
||||
self.suspected_resources.extend(new_suspects);
|
||||
|
||||
if !self.suspected_resources.render_bundles.is_empty() {
|
||||
let (mut guard, _) = hub.render_bundles.write(token);
|
||||
let mut trackers = trackers.lock();
|
||||
|
||||
@@ -358,9 +358,12 @@ impl<A: HalApi> Device<A> {
|
||||
profiling::scope!("maintain", "Device");
|
||||
let mut life_tracker = self.lock_life(token);
|
||||
|
||||
life_tracker
|
||||
.suspected_resources
|
||||
.extend(&self.temp_suspected);
|
||||
|
||||
life_tracker.triage_suspected(
|
||||
hub,
|
||||
&self.temp_suspected,
|
||||
&self.trackers,
|
||||
#[cfg(feature = "trace")]
|
||||
self.trace.as_ref(),
|
||||
@@ -455,6 +458,8 @@ impl<A: HalApi> Device<A> {
|
||||
self.lock_life(&mut token)
|
||||
.suspected_resources
|
||||
.extend(&self.temp_suspected);
|
||||
|
||||
self.temp_suspected.clear();
|
||||
}
|
||||
|
||||
fn create_buffer(
|
||||
@@ -4160,7 +4165,6 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let device = device_guard.get(device_id).map_err(|_| InvalidDevice)?;
|
||||
device.lock_life(&mut token).triage_suspected(
|
||||
&hub,
|
||||
&device.temp_suspected,
|
||||
&device.trackers,
|
||||
#[cfg(feature = "trace")]
|
||||
None,
|
||||
|
||||
@@ -795,6 +795,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
Err(WaitIdleError::StuckGpu) => return Err(QueueSubmitError::StuckGpu),
|
||||
};
|
||||
|
||||
device.temp_suspected.clear();
|
||||
|
||||
profiling::scope!("cleanup");
|
||||
if let Some(pending_execution) = device.pending_writes.post_submit(
|
||||
&device.command_allocator,
|
||||
|
||||
Reference in New Issue
Block a user