From e09f767a7132b75c1b232042bc6142c0815a218d Mon Sep 17 00:00:00 2001 From: Samson <16504129+sagudev@users.noreply.github.com> Date: Sat, 17 Jun 2023 19:36:28 +0200 Subject: [PATCH] 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. --- webgpu-compute-demo/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webgpu-compute-demo/script.js b/webgpu-compute-demo/script.js index e7a3b0a2..92dd752a 100644 --- a/webgpu-compute-demo/script.js +++ b/webgpu-compute-demo/script.js @@ -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; } @@ -129,4 +129,4 @@ async function init() { console.log(new Float32Array(data)); } -init(); \ No newline at end of file +init();