Skip to content

Commit

Permalink
[WebGPU] Fix unexpected device lost error when intentional dispose (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieFRuan authored Aug 8, 2024
1 parent 11be832 commit 1fcb620
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ export class Instance implements Disposable {
// ctx release goes back into lib.
this.ctx.dispose();
this.lib.dispose();
this.deviceLostIsError = true;
// Cannot set deviceLostIsError back to true here because GPUDevice.destroy() is asynchronous.
}

/**
Expand Down Expand Up @@ -2122,6 +2122,7 @@ export class Instance implements Disposable {
this.dispose();
}
});
this.deviceLostIsError = true;

const webGPUContext = new WebGPUContext(
this.memory, device
Expand Down

0 comments on commit 1fcb620

Please sign in to comment.