Cross-platform, safe, pure-rust graphics api.
Go to file
bors[bot] da39957062
Merge #1728
1728: Move error formatting functionality  r=kvark a=scoopr

**Connections**
This is an attempt to implement #1082 

**Description**
This is a fairly straightforward move of the error formatting that were in wgpu-rs in to wgpu-code.

The enriching of some of the errors with the additional `ContextError` were still left with the wgpu-rs code, as I realised the current error messages refer to the API names as they appear in rust code and might not make sense for all the consumers of wgpu-core. It could be left as is and other consumers might enrich in their own ways, or the messages could be reformatted to be more conversational

**Testing**
Limited testing with the examples


Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2021-08-03 14:59:38 +00:00
.github Add --no-fail-fast to CI 2021-07-29 09:24:07 -04:00
dummy Remove MPL 2.0 header in files 2021-06-19 21:06:08 +03:00
etc Document coordinate systems in README 2021-07-24 13:17:04 -07:00
player Update winit to 0.25 2021-07-23 14:30:38 +03:00
wgpu Error formatting impls closer to errors 2021-08-03 01:30:06 +03:00
wgpu-core Remove AsDisplay trait in error formatting 2021-08-03 01:30:36 +03:00
wgpu-hal Fix New Clippy Lints From Rust 1.54.0 2021-07-29 16:29:46 -05:00
wgpu-info Update testing limits for rpi4 2021-07-02 00:13:33 -04:00
wgpu-types Improve Docs for DownlevelFlags 2021-07-28 19:00:43 -05:00
.gitattributes [rs] Demonstrate obj loading in the skybox example 2021-02-12 22:33:17 -05:00
.gitignore Finish reftest and test running infra 2021-06-23 19:10:11 -04:00
.monocodus Add monocodus config with clippy support 2020-07-16 09:57:13 -04:00
bors.toml Removes nightly from bors 2021-07-14 16:21:26 -04:00
Cargo.lock hal/dx12: support base vertex/instance 2021-07-27 08:59:41 -04:00
Cargo.toml hal/gles: compressed ETC2 texture support 2021-06-30 12:06:59 -04:00
CHANGELOG.md Rename texture usage names 2021-07-28 00:17:54 -04:00
LICENSE.APACHE Relicense to MIT/Apache 2021-06-18 13:40:31 -04:00
LICENSE.MIT Relicense to MIT/Apache 2021-06-18 13:40:31 -04:00
logo.png Update logo and move bindings section 2020-03-03 00:10:04 -03:30
README.md Document coordinate systems in README 2021-07-24 13:17:04 -07:00
rustfmt.toml Rustfmt stable pass 2020-04-06 08:55:39 -04:00

wgpu

Matrix Matrix Build Status codecov.io

This is an implementation of WebGPU API in Rust, targeting both native and the Web. See the upstream WebGPU specification (work in progress).

The repository hosts the following parts:

  • Crates.io docs.rs - public Rust API for users
  • Crates.io docs.rs - internal Rust API for WebGPU implementations to use
  • Crates.io docs.rs - internal unsafe GPU abstraction API
  • Crates.io - program that prints out information about all the adapters on the system or invokes a command for every adapter.
  • Crates.io docs.rs - Rust types shared between wgpu-core and wgpu-rs
  • player - standalone application for replaying the API traces, uses winit

Rust examples can be found at wgpu/examples. wgpu is a default member, so you can run the examples directly from the root, e.g. cargo run --example boids.

If you are looking for the native implementation or bindings to the API in other languages, you need wgpu-native.

Supported Platforms

API Windows 7/10 Linux & Android macOS & iOS
DX11 🚧
DX12 🆗
Vulkan
Metal
GLes3 🆗

= Primary support — 🆗 = Secondary support — 🚧 = Unsupported, but support in progress

Testing Infrastructure

wgpu features a set of unit, integration, and example based tests. All framework based examples are automatically reftested against the screenshot in the example directory. The wgpu-info example contains the logic which can automatically run the tests multiple times for all the adapters present on the system. These tests are also run on CI on windows and linux over Vulkan/DX12/DX11/GL on software adapters.

To run the test suite, run the following command:

cargo run --bin wgpu-info -- cargo test --no-fail-fast

To run any individual test on a specific adapter, populate the following environment variables:

  • WGPU_ADAPTER_NAME with a substring of the name of the adapter you want to use (ex. "1080" will match "NVIDIA GeForce 1080ti").
  • WGPU_BACKEND with the name of the backend you want to use (vulkan, metal, dx12, dx11, or gl).

Then to run an example's reftests, run:

cargo test --example <example-name> --no-fail-fast

Or run a part of the integration test suite:

cargo test -p wgpu -- <name-of-test>

If you are a user and want a way to help contribute to wgpu, we always need more help writing test cases.

Coordinate Systems

wgpu uses the coordinate systems of DX and Metal:

Render Depth Texture
render_coordinates depth_coordinates texture_coordinates