dorkhub

webgpu-wasm-c

🚀 A minimal WebGPU example written in C, compiled to WebAssembly (wasm). 🛠️ Ideal for experimenting and preparing for…

seyhajin
C683 forksMITupdated 6 months ago
visit the demogit clone https://github.com/seyhajin/webgpu-wasm-c.gitseyhajin/webgpu-wasm-c

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 --use-port=emdawnwebgpu

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

  • emscripten 4.0.22+
  • git (optional)
  • python3 (optional)

more like this

TachiSnap

TachiSnap — Pixel Snapper for animation pixel artists. Rust + WebAssembly client-side tool for cleaning up AI-generated…

HTML50

urge

The Universal Ruby Game Engine (URGE) Project

C++50

RaylibWasm

.Net 10 (.Net 8+) webassembly starter project using raylib-cs nuget 7.0.2 and raylib 5.5

C#50

WebGPU-Lab

Demos and experiments in WebGPU technology. Focus on compute shaders.

TypeScript50

search

search projects, people, and tags