Hot patch for temp_suspected tracking

This commit is contained in:
Dzmitry Malyshau authored and Dzmitry Malyshau committed 2021-06-19 01:39:35 -04:00
1 parent 51c3eeaec8
commit 44243d82c5
3 files changed
+8 -5

No files matched your search

-3
View File
@@ -378,15 +378,12 @@ impl<B: GfxBackend> LifetimeTracker<B> {
pub(super) fn triage_suspected<G: GlobalIdentityHandlerFactory>(
&mut self,
hub: &Hub<B, G>,
new_suspects: &SuspectedResources,
trackers: &Mutex<TrackerSet>,
#[cfg(feature = "trace")] trace: Option<&Mutex<trace::Trace>>,
token: &mut Token<super::Device<B>>,
) {
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();
+6 -2
View File
@@ -427,9 +427,12 @@ impl<B: GfxBackend> Device<B> {
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(),
@@ -511,6 +514,8 @@ impl<B: GfxBackend> Device<B> {
self.lock_life(&mut token)
.suspected_resources
.extend(&self.temp_suspected);
self.temp_suspected.clear();
}
fn create_buffer(
@@ -4589,7 +4594,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,
+2
View File
@@ -801,6 +801,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Err(WaitIdleError::StuckGpu) => return Err(QueueSubmitError::StuckGpu),
};
device.temp_suspected.clear();
profiling::scope!("cleanup");
super::Device::lock_life_internal(&device.life_tracker, &mut token).track_submission(
submit_index,