Skip to content

Commit e09f767

Browse files
authored
Use u sufix for buffer_size literal
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.
1 parent 9703a3f commit e09f767

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webgpu-compute-demo/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main(
1515
local_id : vec3u,
1616
) {
1717
// Avoid accessing the buffer out of bounds
18-
if (global_id.x >= ${BUFFER_SIZE}) {
18+
if (global_id.x >= ${BUFFER_SIZE}u) {
1919
return;
2020
}
2121
@@ -129,4 +129,4 @@ async function init() {
129129
console.log(new Float32Array(data));
130130
}
131131

132-
init();
132+
init();

0 commit comments

Comments
 (0)