File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,9 @@ function armSabFrameWake(): void {
426426 const h = frameTransport . controlHeader ;
427427 const seq = Atomics . load ( h , FRAME_SAB_CONTROL_PUBLISHED_SEQ_WORD ) ;
428428 if ( seq > lastConsumedSabPublishedSeq ) {
429+ // Avoid timer-driven SAB mailbox polling; when we can observe that a newer
430+ // frame is available, sync it now and schedule an immediate submit tick.
431+ syncPendingSabFrameFromMailbox ( ) ;
429432 scheduleTickNow ( ) ;
430433 return ;
431434 }
@@ -449,6 +452,7 @@ function armSabFrameWake(): void {
449452 if ( waiter . async !== true ) {
450453 if ( ! running ) return ;
451454 if ( epoch !== sabWakeEpoch ) return ;
455+ syncPendingSabFrameFromMailbox ( ) ;
452456 scheduleTickNow ( ) ;
453457 return ;
454458 }
@@ -460,6 +464,7 @@ function armSabFrameWake(): void {
460464 if ( epoch !== sabWakeEpoch ) return ;
461465 sabWakeArmed = false ;
462466 if ( ! running ) return ;
467+ syncPendingSabFrameFromMailbox ( ) ;
463468 scheduleTickNow ( ) ;
464469 } ,
465470 ( ) => {
@@ -616,9 +621,6 @@ function shutdownNow(): void {
616621function tick ( ) : void {
617622 if ( ! running ) return ;
618623 if ( engineId === null ) return ;
619- if ( frameTransport . kind === FRAME_TRANSPORT_SAB_V1 ) {
620- syncPendingSabFrameFromMailbox ( ) ;
621- }
622624
623625 let didSubmitDrawlistThisTick = false ;
624626 let didFrameWork = false ;
You can’t perform that action at this time.
0 commit comments