873: Grand cleanup and refactor of the descriptors in the API r=cwfitzgerald,grovesNL a=kvark **Connections** Cleanup follows https://github.com/gfx-rs/wgpu-rs/pull/501 Fixes #871 Fixes #848 **Description** There is a lot of small and big things crumbled in here. The major one is where descriptors live, and how they are parametrized. Logic is the following: - if something is useful by wgpu-rs's API leave it in `wgpu-types` - if *in addition* it's useful to `wgpu-native`(i.e. has `repr(C)`), we possibly parametrize it (currently, only label is). - otherwise, the type is moved to `wgpu-core` and stripped of generics - remove all the builders Some medium-sized things: - moves the subscriber out (#871) - moves the `RenderCommand` into the `draw` module (which is meant to contain shared things) - makes `TextureViewDescriptor` fields optional, but receives it directly now (#848) - moves stencil stuff out into `StencilStateDescriptor`, so that we can derive `Default` for it - stop accepting raw strings for labels in the `Device` API: neither the clients, or gfx-rs need that shape, and it can't be safe Some smaller things: - using NonZeroU8 for anisotropy - using NonZeroU32 for descriptor count - putting sampler addressing modes into an array - add labels to command buffers and pipeline layouts - improves errors for exceeding binding limits **Testing** Tested on https://github.com/gfx-rs/wgpu-rs/pull/503 Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
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- tracing subscribers to use with
wgpuplayer- 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