yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

yumfix compiler bug lolf8cb9c4d6

master
4 files

files

README.md662 B
example.js5.4 KiB
index.html262 B
shader.slang521 B

Simple WebGPU example using Slang WebAssembly library

Description

This is a simple example showing how WebGPU applications can use the slang-wasm library to compile slang shaders at runtime to WGSL. The resulting application shows a green triangle rendered on a black background.

Instructions

Follow the WebAssembly build instructions in docs/building.md to produce slang-wasm.js and slang-wasm.wasm, and place these files in this directory.

Start a web server, for example by running the following command in this directory:

$ python -m http.server

Finally, visit http://localhost:8000/ to see the application running in your browser.