|
3 | 3 | //! To start using the API, create an [`Instance`].
|
4 | 4 | //!
|
5 | 5 | //! ## Feature flags
|
6 |
| -// NOTE: feature docs. below should be kept in sync. with `Cargo.toml`! |
7 |
| -//! |
8 |
| -//! ### Backends |
9 |
| -//! |
10 |
| -//! ⚠️ WIP: Not all backends can be manually configured today. On Windows & Linux the **Vulkan & GLES |
11 |
| -//! backends are always enabled**. See [#3514](https://github.com/gfx-rs/wgpu/issues/3514) for more |
12 |
| -//! details. |
13 |
| -//! |
14 |
| -//! - **`dx12`** _(enabled by default)_ --- Enables the DX12 backend on Windows. |
15 |
| -//! - **`metal`** _(enabled by default)_ --- Enables the Metal backend on macOS & iOS. |
16 |
| -//! - **`webgpu`** _(enabled by default)_ --- Enables the WebGPU backend on Wasm. Disabled when targeting `emscripten`. |
17 |
| -//! - **`angle`** --- Enables the GLES backend via [ANGLE](https://github.com/google/angle) on macOS. |
18 |
| -//! - **`vulkan-portability`** --- Enables the Vulkan backend on macOS & iOS. |
19 |
| -//! - **`webgl`** --- Enables the GLES backend on Wasm. |
20 |
| -//! - ⚠️ WIP: Currently will also enable GLES dependencies on any other targets. |
21 |
| -//! |
22 |
| -//! **Note:** In the documentation, if you see that an item depends on a backend, |
23 |
| -//! it means that the item is only available when that backend is enabled _and_ the backend |
24 |
| -//! is supported on the current platform. |
25 |
| -//! |
26 |
| -//! ### Shading language support |
27 |
| -//! |
28 |
| -//! - **`wgsl`** _(enabled by default)_ --- Enable accepting WGSL shaders as input. |
29 |
| -//! - **`spirv`** --- Enable accepting SPIR-V shaders as input. |
30 |
| -//! - **`glsl`** --- Enable accepting GLSL shaders as input. |
31 |
| -//! - **`naga-ir`** --- Enable accepting Naga IR shaders as input. |
32 |
| -//! |
33 |
| -//! ### Logging & Tracing |
34 |
| -//! |
35 |
| -//! The following features do not have any effect on the WebGPU backend. |
36 |
| -//! |
37 |
| -//! - **`strict_asserts`** --- Apply run-time checks, even in release builds. These are in addition |
38 |
| -//! to the validation carried out at public APIs in all builds. |
39 |
| -//! - **`api_log_info`** --- Log all API entry points at info instead of trace level. |
40 |
| -//! - **`serde`** --- Enables serialization via `serde` on common wgpu types. |
41 |
| -//! - **`trace`** --- Allow writing of trace capture files. See [`Adapter::request_device`]. |
42 |
| -//! - **`replay`** --- Allow deserializing of trace capture files that were written with the `trace` |
43 |
| -//! feature. To replay a trace file use the [wgpu |
44 |
| -//! player](https://github.com/gfx-rs/wgpu/tree/trunk/player). |
45 |
| -//! |
46 |
| -//! ### Other |
47 |
| -//! |
48 |
| -//! - **`fragile-send-sync-non-atomic-wasm`** --- Implement `Send` and `Sync` on Wasm, but only if |
49 |
| -//! atomics are not enabled. |
50 |
| -//! |
51 |
| -//! WebGL/WebGPU objects can not be shared between threads. However, it can be useful to |
52 |
| -//! artificially mark them as `Send` and `Sync` anyways to make it easier to write cross-platform |
53 |
| -//! code. This is technically _very_ unsafe in a multithreaded environment, but on a wasm binary |
54 |
| -//! compiled without atomics we know we are definitely not in a multithreaded environment. |
| 6 | +#![doc = document_features::document_features!()] |
55 | 7 | //!
|
56 | 8 | //! ### Feature Aliases
|
57 | 9 | //!
|
|
0 commit comments