Implement on_submitted_work_done (#7864)

This commit is contained in:
Drew Crawford 2025-07-01 12:21:27 -05:00 committed by GitHub
parent 86e6b1835b
commit 92cda27b41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -106,6 +106,7 @@ Bottom level categories:
#### WebGPU
- Fix setting unclipped_depth. By @atlv24 in [#7841](https://github.com/gfx-rs/wgpu/pull/7841)
- Implement `on_submitted_work_done` for WebGPU backend. By @drewcrawford in [#7864](https://github.com/gfx-rs/wgpu/pull/7864)
### Changes

View File

@ -2594,8 +2594,17 @@ impl dispatch::QueueInterface for WebQueue {
1.0
}
fn on_submitted_work_done(&self, _callback: dispatch::BoxSubmittedWorkDoneCallback) {
unimplemented!("on_submitted_work_done is not yet implemented");
fn on_submitted_work_done(&self, callback: dispatch::BoxSubmittedWorkDoneCallback) {
let promise = self.inner.on_submitted_work_done();
wasm_bindgen_futures::spawn_local(async move {
match wasm_bindgen_futures::JsFuture::from(promise).await {
Ok(_) => callback(),
Err(error) => {
log::error!("on_submitted_work_done promise failed: {:?}", error);
callback();
}
}
});
}
fn compact_blas(