emepetres / HelloWebGPU.Net

WebGPU Triangle sample using C# and Dawn
MIT License
12 stars 2 forks source link

Hello WebGPU.Net

This an example of how to use WebGPU on .Net (Windows and Browser), leveraging the WaveEngine WebGPU bindings.

https://webgpu.z28.web.core.windows.net/

Check https://webgpu.z28.web.core.windows.net/ for a live preview.

WebGPU on the browser is only currently supported on Chrome/Edge Canary versions, and Firefox Nightly.

Run it locally

Set-Up environment

Right now compilation must be finished on linux. Follow the dotnet-setup.sh script to install necessary dependencies (tested on Ubuntu 18 LTS).

Compile & Link

First, compile the project with MSBuild, then go to Linux if you are on windows (Ubuntu 18 LTS - WSL1) and run package.sh with the specific arguments of your project:

./package.sh [PATH_TO_PROJECT]/HelloWebGPUNet/HelloWebGPUNet.Web/bin/Release/netstandard2.0 $HOME/.build HelloWebGPUNet.Web.dll -a

-a option builds the project on AOT mode (the only one supported for now due to a bug in mono). Check the full list of arguments at package.sh

After compilation and linking are successfull, serve the folder bin/\$(Configuration)/wasm with a static server.

libWebGPU.o

TODO