Skip to content

Commit

Permalink
[js/webgpu] fix RangeError in buffer download (microsoft#16165)
Browse files Browse the repository at this point in the history
### Description
this is a following up fix for microsoft#15990, which should resolve the
RangeError issue.
  • Loading branch information
fs-eire authored May 30, 2023
1 parent 9388478 commit 1d164c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/lib/wasm/jsep/backend-webgpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export class WebGpuBackend {
// the underlying buffer may be changed after the async function is called. so we use a getter function to make sure
// the buffer is up-to-date.
const data = getTargetBuffer();
data.set(new Uint8Array(arrayBuffer));
data.set(new Uint8Array(arrayBuffer, 0, data.byteLength));
}

alloc(size: number): number {
Expand Down

0 comments on commit 1d164c8

Please sign in to comment.