See README.md for procedural information about contributing.
See wgsl/README.md for more details about building the WGSL spec.
A GitHub Codespace is a very convenient way to make changes without setting up toolchains locally. It requires an internet connection and may be a little slower to build than your local machine.
The Free and Pro plans for personal accounts include free use of GitHub Codespaces up to a fixed amount of usage every month.
For more info on GitHub Codespaces billing, see this help page.
-
Fork the repository at https://github.com/gpuweb/gpuweb/fork
-
On your fork:
- Click the big green "Code" button
- Switch to the "Codespaces" tab
- Click the "+" to create a new Codespace
This will open the Codespace in a tab. To get back to it:
- Click the big green "Code" button (on your fork or the upstream repository gpuweb/gpuweb)
- Switch to the "Codespaces" tab
- Click on the name of your Codespace
-
Using the built-in terminal:
-
Create a branch:
git checkout -b my-new-change
-
See the "Building"/"Previewing" instructions below.
-
When you start a web server inside the Codespace, you'll get a notification on the editor page. Click on it to get to the web-visible URL for your server.
-
Please see https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository.
On a local system, you'll need to install dependencies. To install all tools, run:
./tools/install-dependencies.sh bikeshed diagrams wgsl
(Alternatively, you can invoke pip3
/npx
directly, using the commands in
that script.) More details:
The specifications are written using Bikeshed. Installing Bikeshed is optional; if Bikeshed is not installed locally, the Bikeshed API will be used to generate the specification (but this is generally slower).
Diagrams generated using Mermaid. This isn't required unless you're modifying or creating diagrams.
The WGSL spec uses some additional tools for language parsing; see wgsl/README.md if you want to know more.
To build all documents:
make -j
To build just the WebGPU specification (spec/index.html
):
make -C spec index.html
To build just the WGSL specification (wgsl/index.html
):
make -C wgsl index.html
Alternatively, cd
into your target document's subdirectory, and call make
or make -j
.
Both spec
and wgsl
also have other targets in their Makefile
s, which are documented inline.
The other documents in this repository (correspondence
and explainer
) can be built similarly.
Launch a local web server to preview your spec changes, for example:
python3 -m http.server
(Add -b localhost
if developing locally so the port won't be exposed to your network.)
or:
npx http-server
(Add -a localhost
if developing locally so the port won't be exposed to your network.)