1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
[]
= "wgpu"
= true
= true
= true
= "Cross-platform, safe, pure-rust graphics API"
= true
= true
= true
= true
= true
= "../README.md"
= ["Cargo.lock"]
[]
= true
= ["--cfg", "docsrs"]
= [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"wasm32-unknown-unknown",
]
[]
# Cargo machete can't check build.rs dependencies. See https://github.com/bnjbvr/cargo-machete/issues/100
= ["cfg_aliases"]
[]
[]
= [
"std",
"parking_lot",
"dx12",
"metal",
"gles",
"vulkan",
"wgsl",
"webgpu",
]
#! ### Backends
# --------------------------------------------------------------------
## Enables the DX12 backend on Windows.
= ["wgpu-core?/dx12"]
## Enables the Metal backend on macOS & iOS.
= ["wgpu-core?/metal"]
## Enables the Vulkan backend on Windows, Linux, and Android.
= ["wgpu-core?/vulkan"]
## Enables the OpenGL/GLES backend on Windows, Linux, Android, and Emscripten.
= ["wgpu-core?/gles"]
## Enables the WebGPU backend on WebAssembly.
= [
"web",
"naga?/wgsl-out",
"dep:wasm-bindgen-futures",
"web-sys/Document",
"web-sys/Event",
"web-sys/Navigator",
"web-sys/NodeList",
"web-sys/Window",
"web-sys/WorkerGlobalScope",
"web-sys/WorkerNavigator",
]
#! ### Conditional Backends
## Enables the GLES backend on macOS only for use with [ANGLE](https://github.com/google/angle).
= ["wgpu-core?/angle"]
## Enables the Vulkan backend on macOS & iOS only for use with [MoltenVK](https://github.com/KhronosGroup/MoltenVK).
= ["wgpu-core?/vulkan-portability"]
## Enables the GLES backend on WebAssembly only.
= ["web", "wgpu-core/webgl", "dep:wgpu-hal", "dep:smallvec"]
## Enables the noop backend for testing.
##
## This backend allows creating resources such as buffers and textures,
## but performs no computation.
## Because it lacks basic functionality, it is only actually used if explicitly enabled
## through `NoopBackendOptions`.
= ["wgpu-core/noop", "dep:wgpu-hal", "dep:smallvec"]
#! **Note:** In the documentation, if you see that an item depends on a backend,
#! it means that the item is only available when that backend is enabled _and_ the backend
#! is supported on the current platform.
= []
#! ### Shading language support
# --------------------------------------------------------------------
#! These features enable support for that input language on all platforms.
#! We will translate the input language to whatever the backend requires.
## Enable accepting SPIR-V shaders as input.
= ["naga/spv-in", "wgpu-core?/spirv"]
## Enable accepting GLSL shaders as input.
= ["naga/glsl-in", "wgpu-core?/glsl"]
## Enable accepting WGSL shaders as input.
= ["wgpu-core?/wgsl"]
## Enable accepting naga IR shaders as input.
= ["dep:naga"]
#! ### Assertions and Serialization
# --------------------------------------------------------------------
## Apply run-time checks, even in release builds. These are in addition
## to the validation carried out at public APIs in all builds.
= ["wgpu-core?/strict_asserts", "wgpu-types/strict_asserts"]
## Enables serialization via `serde` on common wgpu types.
= ["wgpu-core?/serde", "wgpu-types/serde"]
# Uncomment once we get to https://github.com/gfx-rs/wgpu/issues/5974
# ## Allow writing of trace capture files. See [`Adapter::request_device`].
# trace = ["serde", "wgpu-core/trace"]
#! ### External libraries
# --------------------------------------------------------------------
#! The following features facilitate integration with third-party supporting libraries.
## Enables statically linking DXC.
##
## Normally, to use the modern DXC shader compiler with wgpu, the final application
## must be shipped alongside `dxcompiler.dll` (min v1.8.2502) (which can be downloaded from [Microsoft's GitHub][dxc]).
## This feature statically links a version of DXC so that no external binaries are required
## to compile DX12 shaders.
##
## [dxc]: https://github.com/Microsoft/DirectXShaderCompiler
= ["wgpu-core?/static-dxc"]
#! ### Other
# --------------------------------------------------------------------
## Internally count resources and events for debugging purposes. If the counters
## feature is disabled, the counting infrastructure is removed from the build and
## the exposed counters always return 0.
= ["wgpu-core?/counters"]
## Implement `Send` and `Sync` on Wasm, but only if atomics are not enabled.
##
## WebGL/WebGPU objects can not be shared between threads.
## However, it can be useful to artificially mark them as `Send` and `Sync`
## anyways to make it easier to write cross-platform code.
## This is technically *very* unsafe in a multithreaded environment,
## but on a wasm binary compiled without atomics is a definitionally single-threaded environment.
= [
"wgpu-core?/fragile-send-sync-non-atomic-wasm",
"wgpu-types/fragile-send-sync-non-atomic-wasm",
]
## Use web-specific libraries on WASM
##
## Those libraties (wasm-bindgen, web-sys, js-sys) can only be used when there is a JavaScript
## context around the WASM VM, e.g., when the WASM binary is used in a browser.
= ["dep:wasm-bindgen", "dep:js-sys", "dep:web-sys", "wgpu-types/web"]
## Enables use of the standard library within `wgpu` and its dependencies.
##
## This can allow for better error reporting and for improved multithreading
## support.
= ["raw-window-handle/std", "wgpu-types/std", "wgpu-core?/std"]
## Uses `parking_lot` as the implementation for locking primitives.
##
## This is a recommended feature for most users and should only be disabled when
## required, e.g., for `no_std` support.
## If disabled, either `std::sync::Mutex` or `core::cell::RefCell` will be used,
## based on whether `std` is enabled or not.
= ["dep:parking_lot"]
#########################
# Standard Dependencies #
#########################
[]
= { = true, = true, = ["termcolor"] }
= { = true, = true }
= true
# Needed for both wgpu-core and webgpu
= true
= true
= true
= true
= true
= true
= { = true, = true }
= true
= { = true, = ["alloc"] }
= true
########################################
# Target Specific Feature Dependencies #
########################################
###################
# Not Webassembly #
###################
[]
# Needed for only wgpu-core backend. Not optional as only wgpu-core backend exists on native platforms.
= { = true, = [
"raw-window-handle",
"renderdoc",
"wgsl", # needed for indirect draw/dispatch validation
"portable-atomic",
] }
= true
= true
###############
# Webassembly #
###############
[]
# Needed for all backends
= { = true, = true, = ["default"] }
= { = true, = true }
= { = true, = true, = [
"HtmlCanvasElement",
"OffscreenCanvas",
] }
# Needed for only wgpu-core backend. Optional as webgl is optional on WebAssembly.
= { = true, = true, = [
"raw-window-handle",
] }
= { = true, = true }
= { = true, = true }
# Needed for the webgpu backend. Optional as webgpu is optional on WebAssembly.
= { = true, = true }
##############
# Emscripten #
##############
[]
= { = true, = ["raw-window-handle"] }
= true
= true
[]
= true
[]
# Used in doc-tests
= true
[]
= true