Skip to content

Commit

Permalink
Use u sufix for buffer_size literal
Browse files Browse the repository at this point in the history
Without this, webgpu compute example does not work in Firefox, because naga (wgsl parsing library used in Firefox) [does not support automatic type conversations](https://github.com/gfx-rs/naga/issues/2127) yet.
  • Loading branch information
sagudev authored Jun 17, 2023
1 parent 9703a3f commit e09f767
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webgpu-compute-demo/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn main(
local_id : vec3u,
) {
// Avoid accessing the buffer out of bounds
if (global_id.x >= ${BUFFER_SIZE}) {
if (global_id.x >= ${BUFFER_SIZE}u) {
return;
}
Expand Down Expand Up @@ -129,4 +129,4 @@ async function init() {
console.log(new Float32Array(data));
}

init();
init();

0 comments on commit e09f767

Please sign in to comment.