File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1378,6 +1378,14 @@ impl Queue {
13781378 guard. push_signal ( SemaphoreType :: Binary ( semaphore) ) ;
13791379 }
13801380 }
1381+
1382+ /// Remove `semaphore` from the pending signal list if it is still present.
1383+ ///
1384+ /// Returns `true` if the semaphore was found and removed. If the submit
1385+ /// already consumed it, this is a harmless no-op that returns `false`.
1386+ pub fn remove_signal_semaphore ( & self , semaphore : vk:: Semaphore ) -> bool {
1387+ self . signal_semaphores . lock ( ) . remove ( semaphore)
1388+ }
13811389}
13821390
13831391/// Maps
Original file line number Diff line number Diff line change @@ -147,6 +147,29 @@ impl SemaphoreList {
147147 self . check ( ) ;
148148 }
149149
150+ /// Remove all entries matching `semaphore` from the list. Returns `true`
151+ /// if anything was removed.
152+ pub fn remove ( & mut self , semaphore : vk:: Semaphore ) -> bool {
153+ let mut removed = false ;
154+ let mut i = 0 ;
155+ while i < self . semaphores . len ( ) {
156+ if self . semaphores [ i] == semaphore {
157+ self . semaphores . swap_remove ( i) ;
158+ if !self . values . is_empty ( ) {
159+ self . values . swap_remove ( i) ;
160+ }
161+ if !self . stage_masks . is_empty ( ) {
162+ self . stage_masks . swap_remove ( i) ;
163+ }
164+ removed = true ;
165+ } else {
166+ i += 1 ;
167+ }
168+ }
169+ self . check ( ) ;
170+ removed
171+ }
172+
150173 /// Append `other` to `self`, leaving `other` empty.
151174 pub fn append ( & mut self , other : & mut Self ) {
152175 assert_eq ! ( self . mode, other. mode) ;
You can’t perform that action at this time.
0 commit comments