Skip to content

Commit

Permalink
[dawn][emscripten] Fix promise handling and pass callback.
Browse files Browse the repository at this point in the history
- Before the code was effectively doing:
    ```
    let ret = resolve(futureId);
    promise.finally(ret);
    ```
  With the lambda wrapping the resolve call, the callback
  only happens after the resolution of the parent promise.

Bug: 358445329
Change-Id: I9aca5e3476b08660780a32cac6d2cb8d70360ed1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/203420
Reviewed-by: Austin Eng <[email protected]>
Commit-Queue: Austin Eng <[email protected]>
Commit-Queue: Loko Kung <[email protected]>
Auto-Submit: Loko Kung <[email protected]>
Reviewed-by: Shrek Shao <[email protected]>
  • Loading branch information
lokokung authored and Dawn LUCI CQ committed Aug 22, 2024
1 parent 5d8a49e commit 9ff1536
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion third_party/emdawnwebgpu/library_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var LibraryWebGPU = {
#if ASYNCIFY
var futureId = futureIdH * 0x100000000 + futureIdL;
WebGPU._futures[futureId] =
new Promise((resolve) => promise.finally(resolve(futureId)));
new Promise((resolve) => promise.finally(() => resolve(futureId)));
#endif
},
_waitAnyPromisesList: [],
Expand Down

0 comments on commit 9ff1536

Please sign in to comment.