GitXplorerGitXplorer
e

HelloWebGPU

public
5 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
edbf9bffb08ca542a840fac717d9cdcb5bb4df67

Screenshot and run info

eemepetres committed 5 years ago
Unverified
5a9a12c7638aa1f7742cde232ff1a5f5a92ed72f

Shader compilation and related work info

eemepetres committed 5 years ago
Unverified
aea26b2d3b69a72381f0047813a5f468f5472f43

EMSDK path configurable. Readme updated.

eemepetres committed 5 years ago
Unverified
746175f6639249eae46ce240813873844c7d2488

Rendering a red triangle on the web

eemepetres committed 5 years ago
Unverified
04a82337ae26abd3d7c6f9c8225f7dcaa6aaa2f6

Triangle pipeline

eemepetres committed 5 years ago
Unverified
5eda9e48f9f94565c8cb8871d633b1eb173363ec

Triangle test skeleton

eemepetres committed 5 years ago

README

The README file for this repository.

HelloWebGPU

This a bare minimum test that shows how to draw a red triangle in a web browser using WebGPU and WebAssembly (Emscripten)

Triangle rendered on Chrome Canary

Tested with Chrome Canary 86.0 and Microsoft Edge Canary 85.0 with chrome://flags/#enable-unsafe-webgpu enabled, and with Firefox Nightly 80.0a1 with dom.webgpu.enabled and gfx.webrender.all enabled,

Requirements

The sample is built under linux/WSL, however it should work in Windows or Mac as well by translating the build script to each platform.

Build

build.sh [-d] [--emsdk PATH_TO_EMSDK]

  • -d to compile in debug mode
  • --emsdk to specify the Emscripten SDK path

By default, the build script tries to find the Emscripten SDK at $HOME/mono/sdks/builds/toolchains/emsdk. This is because this work is originally meant to serve as an external test of MONO + WebGPU + Emscripten integration.

To compile the shaders:

glslc -Os -mfmt=num -o - -c in.vert glslc -Os -mfmt=num -o - -c in.frag

Run

cd www
python server.py

Related work

The sample is partially based on WebGPU samples and hello-webgpu