Skip to content

๐Ÿš€ A minimal WebGPU example written in C, compiled to WebAssembly (wasm). ๐Ÿ› ๏ธ Ideal for experimenting and preparing for native development without install dependencies (dawn, wgpu-rs).

License

Notifications You must be signed in to change notification settings

wdj0729/webgpu-wasm-c

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

webgpu-wasm-c

A minimal WebGPU example written in C, compiled to WebAssembly (wasm).

๐Ÿ‘๏ธ

Getting started

Clone

git clone https://github.com/seyhajin/webgpu-wasm-c.git

Alternatively, download zip from Github repository and extract wherever you want.

Build

Build the example will generate 3 new files (.html, .js, .wasm).

Launch build script according to your system :

Windows

build.bat

Linux & MacOS

sh build.bat

Alternatively, type the below command to build example (all platforms):

emcc main.c -o webgpu.html --shell-file shell.html -s -USE_WEBGPU=1

Run

Launch 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.

Prerequisites

About

๐Ÿš€ A minimal WebGPU example written in C, compiled to WebAssembly (wasm). ๐Ÿ› ๏ธ Ideal for experimenting and preparing for native development without install dependencies (dawn, wgpu-rs).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 84.2%
  • HTML 13.8%
  • Shell 2.0%