ac9587e9ce
696: Rustification of Extensions and SamplerDescriptor r=kvark a=cwfitzgerald **Connections** This begins the rustificaiton of `wgpu-types` as discussed in #689, starting with `Extensions` and `SamplerDescriptor`. #691 and the resulting discussion was used to advise the shape of the extension struct. **Description** The PR should be fairly straight forward. As discussed, I have left extensions as a bitflag until the webgpu-native issue can be opened and discussed regarding allocation of extensions. The most controversial part of this will be the `AnisotropyLevel` enum. I created it for two reasons, one that matters, one that doesn't: - It means that, with the exception of enabling the aniso extension (and lod_bias), the sampler is correct by construction, which is helpful to both beginners and experts. It also better exposes the range of valid values and means less panics in user code. - It saves a byte in the `Option<u8>` 😄 I definitely think that, if at all possible, we should have explicitly typed enums for "numbers" which have a limited amount of valid values (so _not_ lod bias, though that may be better expressed, idk) to make it very explicit which values can be accepted. This also feels more "rusty" and reduces the amount of "magicness" in the interface. Ofc, I'm not married to the idea. **Testing** Follow up PR into wgpu-rs will include conversion of the examples. **TODO** - [x] wgpu-native pr rolling up this PR and #690 (https://github.com/gfx-rs/wgpu-native/pull/34) - [x] wgpu-rs pr updating examples with the new structures (https://github.com/gfx-rs/wgpu-rs/pull/345) Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com> |
||
---|---|---|
.github | ||
player | ||
wgpu-core | ||
wgpu-types | ||
.gitignore | ||
bors.toml | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
LICENSE | ||
logo.png | ||
README.md | ||
rustfmt.toml |
This is an active GitHub mirror of the WebGPU implementation in Rust, which now lives in "gfx/wgpu" of Mozilla-central. Issues and pull requests are accepted, but some bidirectional synchronization may be involved.
WebGPU
This is the core logic of an experimental WebGPU implementation. It's written in Rust and is based on gfx-hal with help of gfx-extras. See the upstream WebGPU specification (work in progress).
The implementation consists of the following parts:
- - internal Rust API for WebGPU implementations to use
- - Rust types shared between
wgpu-core
,wgpu-native
, andwgpu-rs
player
- standalone application for replaying the API traces, useswinit
This repository contains the core of wgpu
, and is not usable directly by applications.
If you are looking for the user-facing Rust API, you need wgpu-rs.
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 | ✔️ | ||
OpenGL | 🚧 | 🚧 | 🚧 |
✔️ = Primary support — ✅ = Secondary support — 🚧 = Unsupported, but support in progress