Cross-platform, safe, pure-rust graphics api.
Go to file
bors[bot] aed736da12
Merge #1522
1522: Reduce feature flag surface for descriptor arrays. r=cwfitzgerald a=ElectronicRU

DYNAMIC_INDEXING is checked by default, since WGPU doesn't allow
for any kind of specialization constants and constant indexing is
nigh useless.

STORAGE_RESOURCE_BINDING_ARRAY is enabled iff the device supports:
- both or neither of uniform and buffer arrays with dynamic indexing;
- both or neither of sampled and storage images with dynamic indexing.

NONUNIFORM_INDEXING is enabled iff for ALL types of descriptor arrays
*that are supported for dynamic indexing*, nonuniform indexing is
also allowed.

These flags have a limitation in that some platforms
(eg.
https://vulkan.gpuinfo.org/displayreport.php?id=11692#features_core_12)
may support a strange subset of those features (example device
supporting non-uniform indexing for textures and storage buffers,
but NOT for storage textures or uniform buffers). In that case feature
will be reported as missing, even though it is partially present.

In the author's opinion, this flag set is convenient for the
users to query; however, due to aforementioned limitations, it would be
desirable to obtain statistics about "edge-case" platforms and what
percentage of reports they comprise.

**Connections**
Implementation of proposal outlined in #1515. 


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-28 11:45:27 +00:00
.github Fix cargo-tarpaulin 2021-06-24 01:30:17 -04:00
dummy Remove MPL 2.0 header in files 2021-06-19 21:06:08 +03:00
etc Add license to big-picture.xml 2020-12-03 14:52:38 -05:00
player Reorder & reassign flags to group up the binding flags together. 2021-06-28 14:44:08 +03:00
wgpu Reduce feature flag surface for descriptor arrays. 2021-06-28 14:44:00 +03:00
wgpu-core Reduce feature flag surface for descriptor arrays. 2021-06-28 14:44:00 +03:00
wgpu-hal Reduce feature flag surface for descriptor arrays. 2021-06-28 14:44:00 +03:00
wgpu-info Remove holes from wgpu-info 2021-06-23 21:29:44 -04:00
wgpu-types Reorder & reassign flags to group up the binding flags together. 2021-06-28 14:44:08 +03: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 web: restore CI for WebGPU 2021-06-21 01:32:24 -02:30
Cargo.lock Update naga to 57b3256020 2021-06-27 01:44:49 -04:00
Cargo.toml Assorted touchups 2021-06-23 20:23:19 -04:00
CHANGELOG.md Merge #1563 2021-06-27 21:25:37 +00: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 Assorted touchups 2021-06-23 20:23:19 -04: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

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>

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.