@@ -21,6 +21,7 @@ use crate::{
21
21
ParentDevice , ResourceErrorIdent , StagingBuffer , Texture , TextureInner , Trackable ,
22
22
} ,
23
23
resource_log,
24
+ snatch:: SnatchGuard ,
24
25
track:: { self , Tracker , TrackerIndex } ,
25
26
FastHashMap , SubmissionIndex ,
26
27
} ;
@@ -107,6 +108,26 @@ impl Queue {
107
108
pub ( crate ) fn lock_life < ' a > ( & ' a self ) -> MutexGuard < ' a , LifetimeTracker > {
108
109
self . life_tracker . lock ( )
109
110
}
111
+
112
+ pub ( crate ) fn maintain (
113
+ & self ,
114
+ submission_index : u64 ,
115
+ snatch_guard : & SnatchGuard ,
116
+ ) -> (
117
+ SmallVec < [ SubmittedWorkDoneClosure ; 1 ] > ,
118
+ Vec < super :: BufferMapPendingClosure > ,
119
+ bool ,
120
+ ) {
121
+ let mut life_tracker = self . lock_life ( ) ;
122
+ let submission_closures =
123
+ life_tracker. triage_submissions ( submission_index, & self . device . command_allocator ) ;
124
+
125
+ let mapping_closures = life_tracker. handle_mapping ( snatch_guard) ;
126
+
127
+ let queue_empty = life_tracker. queue_empty ( ) ;
128
+
129
+ ( submission_closures, mapping_closures, queue_empty)
130
+ }
110
131
}
111
132
112
133
crate :: impl_resource_type!( Queue ) ;
@@ -1505,7 +1526,7 @@ fn validate_command_buffer(
1505
1526
command_buffer : & CommandBuffer ,
1506
1527
queue : & Queue ,
1507
1528
cmd_buf_data : & crate :: command:: CommandBufferMutable ,
1508
- snatch_guard : & crate :: snatch :: SnatchGuard < ' _ > ,
1529
+ snatch_guard : & SnatchGuard ,
1509
1530
submit_surface_textures_owned : & mut FastHashMap < * const Texture , Arc < Texture > > ,
1510
1531
used_surface_textures : & mut track:: TextureUsageScope ,
1511
1532
) -> Result < ( ) , QueueSubmitError > {
0 commit comments