File tree 3 files changed +24
-24
lines changed
3 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -1472,23 +1472,25 @@ impl Global {
1472
1472
)
1473
1473
. collect :: < Vec < _ > > ( ) ;
1474
1474
1475
- let mut submit_surface_textures =
1476
- SmallVec :: < [ _ ; 2 ] > :: with_capacity ( submit_surface_textures_owned. len ( ) ) ;
1477
-
1478
- for texture in submit_surface_textures_owned. values ( ) {
1479
- submit_surface_textures. extend ( match texture. inner . get ( & snatch_guard) {
1480
- Some ( TextureInner :: Surface { raw, .. } ) => raw. as_ref ( ) ,
1481
- _ => None ,
1482
- } ) ;
1483
- }
1475
+ {
1476
+ let mut submit_surface_textures =
1477
+ SmallVec :: < [ _ ; 2 ] > :: with_capacity ( submit_surface_textures_owned. len ( ) ) ;
1478
+
1479
+ for texture in submit_surface_textures_owned. values ( ) {
1480
+ submit_surface_textures. extend ( match texture. inner . get ( & snatch_guard) {
1481
+ Some ( TextureInner :: Surface { raw, .. } ) => raw. as_ref ( ) ,
1482
+ _ => None ,
1483
+ } ) ;
1484
+ }
1484
1485
1485
- unsafe {
1486
- queue
1487
- . raw
1488
- . as_ref ( )
1489
- . unwrap ( )
1490
- . submit ( & refs, & submit_surface_textures, ( fence, submit_index) )
1491
- . map_err ( DeviceError :: from) ?;
1486
+ unsafe {
1487
+ queue
1488
+ . raw
1489
+ . as_ref ( )
1490
+ . unwrap ( )
1491
+ . submit ( & refs, & submit_surface_textures, ( fence, submit_index) )
1492
+ . map_err ( DeviceError :: from) ?;
1493
+ }
1492
1494
}
1493
1495
1494
1496
profiling:: scope!( "cleanup" ) ;
Original file line number Diff line number Diff line change @@ -467,7 +467,7 @@ impl<A: HalApi> Drop for Buffer<A> {
467
467
}
468
468
469
469
impl < A : HalApi > Buffer < A > {
470
- pub ( crate ) fn raw ( & self , guard : & SnatchGuard ) -> Option < & A :: Buffer > {
470
+ pub ( crate ) fn raw < ' a > ( & ' a self , guard : & ' a SnatchGuard ) -> Option < & ' a A :: Buffer > {
471
471
self . raw . get ( guard)
472
472
}
473
473
@@ -1054,7 +1054,7 @@ impl<A: HalApi> Texture<A> {
1054
1054
1055
1055
pub ( crate ) fn inner_mut < ' a > (
1056
1056
& ' a self ,
1057
- guard : & mut ExclusiveSnatchGuard ,
1057
+ guard : & ' a mut ExclusiveSnatchGuard ,
1058
1058
) -> Option < & ' a mut TextureInner < A > > {
1059
1059
self . inner . get_mut ( guard)
1060
1060
}
@@ -1153,10 +1153,8 @@ impl Global {
1153
1153
let buffer_opt = { hub. buffers . try_get ( id) . ok ( ) . flatten ( ) } ;
1154
1154
let buffer = buffer_opt. as_ref ( ) . unwrap ( ) ;
1155
1155
1156
- let hal_buffer = {
1157
- let snatch_guard = buffer. device . snatchable_lock . read ( ) ;
1158
- buffer. raw ( & snatch_guard)
1159
- } ;
1156
+ let snatch_guard = buffer. device . snatchable_lock . read ( ) ;
1157
+ let hal_buffer = buffer. raw ( & snatch_guard) ;
1160
1158
1161
1159
hal_buffer_callback ( hal_buffer)
1162
1160
}
Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ impl<T> Snatchable<T> {
33
33
}
34
34
35
35
/// Get read access to the value. Requires a the snatchable lock's read guard.
36
- pub fn get ( & self , _guard : & SnatchGuard ) -> Option < & T > {
36
+ pub fn get < ' a > ( & ' a self , _guard : & ' a SnatchGuard ) -> Option < & ' a T > {
37
37
unsafe { ( * self . value . get ( ) ) . as_ref ( ) }
38
38
}
39
39
40
40
/// Get write access to the value. Requires a the snatchable lock's write guard.
41
- pub fn get_mut ( & self , _guard : & mut ExclusiveSnatchGuard ) -> Option < & mut T > {
41
+ pub fn get_mut < ' a > ( & ' a self , _guard : & ' a mut ExclusiveSnatchGuard ) -> Option < & ' a mut T > {
42
42
unsafe { ( * self . value . get ( ) ) . as_mut ( ) }
43
43
}
44
44
You can’t perform that action at this time.
0 commit comments