File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -75,24 +75,22 @@ export default class TimestampQueryManager {
75
75
}
76
76
77
77
// Once resolved, we can read back the value of timestamps
78
- readAsync ( onTimestampReadBack : ( timestamps : BigUint64Array ) => void ) {
79
- if ( ! this . timestampSupported ) return new Promise ( ( ) => { } ) ;
80
- if ( this . hasOngoingTimestampReadback ) return new Promise ( ( ) => { } ) ;
78
+ readAsync ( onTimestampReadBack : ( timestamps : BigUint64Array ) => void ) : void {
79
+ if ( ! this . timestampSupported ) return ;
80
+ if ( this . hasOngoingTimestampReadback ) return ;
81
81
82
82
this . hasOngoingTimestampReadback = true ;
83
83
84
84
const buffer = this . timestampMapBuffer ;
85
- return new Promise ( resolve => {
86
- buffer . mapAsync ( GPUMapMode . READ , 0 , buffer . size )
85
+ void buffer . mapAsync ( GPUMapMode . READ )
87
86
. then ( ( ) => {
88
- const rawData = buffer . getMappedRange ( 0 , buffer . size ) ;
87
+ const rawData = buffer . getMappedRange ( ) ;
89
88
const timestamps = new BigUint64Array ( rawData ) ;
90
89
91
90
onTimestampReadBack ( timestamps ) ;
92
91
93
92
buffer . unmap ( ) ;
94
93
this . hasOngoingTimestampReadback = false ;
95
- } )
96
- } ) ;
94
+ } ) ;
97
95
}
98
96
}
You can’t perform that action at this time.
0 commit comments