git clone https://github.com/seyhajin/webgpu-wasm-c.gitAlternatively, download zip from Github repository and extract wherever you want.
Build the example will generate 3 new files (.html, .js, .wasm).
Launch build script according to your system :
Windows
build.batLinux & MacOS
sh build.batAlternatively, type the below command to build example (all platforms):
emcc main.c -o webgpu.html --shell-file shell.html --use-port=emdawnwebgpuLaunch a web server to run example before open it to WebGPU compatible web browser (Chrome Canary, Brave Nightly, etc.).
e.g. : launch python3 -m http.server and open web browser to localhost:8000.
Tip
Use Live Server extension in Visual Studio Code to open the HTML file. This extension will update automatically page in real-time when you rebuild the example.
- emscripten 4.0.22+
- git (optional)
- python3 (optional)
