@@ -24,7 +24,7 @@ use crate::{
2424 CommandAllocator , CommandBuffer , CommandEncoder , CommandEncoderError , CopySide ,
2525 TransferError ,
2626 } ,
27- device:: { DeviceError , FenceReadGuard , FenceWriteGuard , WaitIdleError } ,
27+ device:: { DeviceError , FenceReadGuard , WaitIdleError } ,
2828 get_lowest_common_denom,
2929 global:: Global ,
3030 hal_label,
@@ -566,7 +566,7 @@ impl WebGpuError for QueueSubmitError {
566566pub ( crate ) struct PendingSubmission < ' a > {
567567 queue : & ' a Queue ,
568568 snatch_guard : SnatchGuard < ' a > ,
569- fence : FenceWriteGuard < ' a > ,
569+ fence : FenceReadGuard < ' a > ,
570570 command_index_guard : RwLockWriteGuard < ' a , CommandIndices > ,
571571 // Command buffers to be executed, along with trackers for the resources they use.
572572 pub executions : Vec < EncoderInFlight > ,
@@ -1557,7 +1557,7 @@ impl Queue {
15571557 ) -> ( PendingSubmission < ' a > , SubmissionIndex ) {
15581558 // Lock ordering requires that the fence lock be acquired after the snatch lock and
15591559 // before the command index lock.
1560- let fence = self . device . fence . write ( ) ;
1560+ let fence = self . device . fence . read ( ) ;
15611561
15621562 let mut command_index_guard = self . device . command_indices . write ( ) ;
15631563 command_index_guard. active_submission_index += 1 ;
@@ -1600,7 +1600,7 @@ impl Queue {
16001600 let PendingSubmission {
16011601 queue : _,
16021602 snatch_guard,
1603- mut fence,
1603+ fence,
16041604 command_index_guard,
16051605 mut executions,
16061606 mut surface_textures,
@@ -1671,7 +1671,7 @@ impl Queue {
16711671 self . raw ( ) . submit (
16721672 & hal_command_buffers,
16731673 & submit_surface_textures,
1674- ( fence. as_mut ( ) , submit_index) ,
1674+ ( fence. as_ref ( ) , submit_index) ,
16751675 )
16761676 }
16771677 . map_err ( |e| self . device . handle_hal_error ( e) ) ?;
@@ -1692,7 +1692,7 @@ impl Queue {
16921692 self . lock_life ( ) . track_submission ( submit_index, executions) ;
16931693
16941694 Ok ( SubmissionResult {
1695- fence : RwLockWriteGuard :: downgrade ( fence ) ,
1695+ fence,
16961696 snatch_guard,
16971697 } )
16981698 }
0 commit comments