You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, LLVM can be installed via the binary release or using Chocolatey. Then set the LIBCLANG_PATH (default location is C:\Program Files\LLVM\lib (or C:\Program Files (x86)\LLVM\lib for x86).
(Windows only) Updated Windows SDK
To build native examples:
C compiler which matches the Rust target (e.g. MSVC, Clang, or GCC)
To ensure the examples run correctly, it's also useful to ensure drivers for any installed graphics APIs (e.g. Vulkan, DirectX 12, etc.) are up-to-date.
Clone the repo
You can clone the wgpu-native repo as you'd normally do, but you also need to initialize the submodules to populate the ffi/webgpu-headers directory:
git submodule update --init
Update Rust and Cargo
You may need to do this once in a while:
rustup update
cargo update
Generating Rust glue
TODO
Generating static library
Rust code can be compiled separately into a static library.
In the Makefile, the static library commands are prefixed by lib-.
To generate the wgpu static library, use the following command:
make lib-native
The static libraries will be located in the target folder in the root of the project.
Running an example
The examples are located under the examples directory. We are using a Makefile for running the examples.
In the Makefile, the example commands are prefixed by example-.
Triangle
To generate the Triangle example, use the following command:
make run-example-triangle
Compute
To generate the Compute example, use the following command:
make run-example-compute
Capture
To generate the Capture example, use the following command: