@@ -35,10 +35,10 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wgpu_validate_locks)'] }
35
35
[lib ]
36
36
37
37
[features ]
38
- # # Internally count resources and events for debugging purposes. If the counters
39
- # # feature is disabled, the counting infrastructure is removed from the build and
40
- # # the exposed counters always return 0.
41
- counters = [ " wgpu-types/counters " ]
38
+ # ! See docuemntation for the `wgpu` crate for more in-depth information on these features.
39
+
40
+ # ! ### Logging Configuration
41
+ # --------------------------------------------------------------------
42
42
43
43
# # Log all API entry points at info instead of trace level.
44
44
# # Also, promotes certain debug log calls to info.
@@ -47,33 +47,44 @@ api_log_info = []
47
47
# # Log resource lifecycle management at info instead of trace level.
48
48
resource_log_info = []
49
49
50
- # # Support the Renderdoc graphics debugger:
51
- # # <https://renderdoc.org/>
52
- renderdoc = [" wgpu-hal/renderdoc" ]
50
+ # ! ### Runtime Checks
51
+ # --------------------------------------------------------------------
52
+
53
+ # # Validates indirect draw/dispatch calls. This will also enable naga's
54
+ # # WGSL frontend since we use a WGSL compute shader to do the validation.
55
+ indirect-validation = [" naga/wgsl-in" ]
53
56
54
57
# # Apply run-time checks, even in release builds. These are in addition
55
58
# # to the validation carried out at public APIs in all builds.
56
59
strict_asserts = [" wgpu-types/strict_asserts" ]
57
60
58
- # # Validates indirect draw/dispatch calls. This will also enable naga's
59
- # # WGSL frontend since we use a WGSL compute shader to do the validation.
60
- indirect-validation = [" naga/wgsl-in" ]
61
+ # ! ### Debugging
62
+ # --------------------------------------------------------------------
63
+
64
+ # # Enable lock order observation.
65
+ observe_locks = [" dep:ron" , " serde/serde_derive" ]
66
+
67
+ # ! ### Serialization
68
+ # --------------------------------------------------------------------
61
69
62
70
# # Enables serialization via `serde` on common wgpu types.
63
71
serde = [" dep:serde" , " wgpu-types/serde" , " arrayvec/serde" , " hashbrown/serde" ]
64
72
65
73
# # Enable API tracing.
66
74
trace = [" dep:ron" , " serde" , " naga/serialize" ]
67
75
68
- # # Enable lock order observation.
69
- observe_locks = [" dep:ron" , " serde/serde_derive" ]
70
-
71
76
# # Enable API replaying
72
77
replay = [" serde" , " naga/deserialize" ]
73
78
74
- # # Enable creating instances using raw-window-handle
79
+ # ! ### Surface Support
80
+ # --------------------------------------------------------------------
81
+
82
+ # # Enable creating surfaces using raw-window-handle
75
83
raw-window-handle = [" dep:raw-window-handle" ]
76
84
85
+ # ! ### Shading Language Support
86
+ # --------------------------------------------------------------------
87
+
77
88
# # Enable `ShaderModuleSource::Wgsl`
78
89
wgsl = [" naga/wgsl-in" ]
79
90
@@ -83,40 +94,68 @@ glsl = ["naga/glsl-in"]
83
94
# # Enable `ShaderModuleSource::SpirV`
84
95
spirv = [" naga/spv-in" , " dep:bytemuck" ]
85
96
97
+ # ! ### Other
98
+ # --------------------------------------------------------------------
99
+
100
+ # # Internally count resources and events for debugging purposes. If the counters
101
+ # # feature is disabled, the counting infrastructure is removed from the build and
102
+ # # the exposed counters always return 0.
103
+ counters = [" wgpu-types/counters" ]
104
+
86
105
# # Implement `Send` and `Sync` on Wasm, but only if atomics are not enabled.
87
- # #
88
- # # WebGL/WebGPU objects can not be shared between threads.
89
- # # However, it can be useful to artificially mark them as `Send` and `Sync`
90
- # # anyways to make it easier to write cross-platform code.
91
- # # This is technically *very* unsafe in a multithreaded environment,
92
- # # but on a wasm binary compiled without atomics we know we are definitely
93
- # # not in a multithreaded environment.
94
106
fragile-send-sync-non-atomic-wasm = [
95
107
" wgpu-hal/fragile-send-sync-non-atomic-wasm" ,
96
- " wgpu-types/fragile-send-sync-non-atomic-wasm" ,
97
108
]
98
109
99
- # ! ### Backends, passed through to wgpu-hal
110
+ # ! ### External libraries
100
111
# --------------------------------------------------------------------
112
+ # ! The following features facilitate integration with third-party supporting libraries.
101
113
102
- # # Enable the `metal` backend .
103
- metal = [" wgpu-hal/metal " ]
114
+ # # Enable using the `mach-dxcompiler-rs` crate to compile DX12 shaders .
115
+ static-dxc = [" wgpu-hal/static-dxc " ]
104
116
105
- # # Enable the `vulkan` backend.
106
- vulkan = [" wgpu-hal/vulkan" ]
107
-
108
- # # Enable the `GLES` backend.
109
- # #
110
- # # This is used for all of GLES, OpenGL, and WebGL.
111
- gles = [" wgpu-hal/gles" ]
117
+ # ! ### Target Conditional Features
118
+ # --------------------------------------------------------------------
119
+ # Look to wgpu-hal's Cargo.toml for explaination how these features and the wgpu-core
120
+ # platform crates collude to provide platform-specific behavior.
121
+
122
+ # # DX12 backend
123
+ dx12 = [" wgpu-core-deps-windows-linux-android/dx12" ]
124
+ # # Metal backend
125
+ metal = [" wgpu-core-deps-apple/metal" ]
126
+ # # Vulkan backend, only available on Windows, Linux, Android
127
+ vulkan = [" wgpu-core-deps-windows-linux-android/vulkan" ]
128
+ # # OpenGL backend, only available on Windows, Linux, Android, and Emscripten
129
+ gles = [
130
+ " wgpu-core-deps-windows-linux-android/gles" ,
131
+ " wgpu-core-deps-emscripten/gles" ,
132
+ ]
112
133
113
- # # Enable the `dx12` backend.
114
- dx12 = [" wgpu-hal/dx12" ]
134
+ # # WebGL backend, only available on Emscripten
135
+ webgl = [" wgpu-core-deps-wasm/webgl" ]
136
+ # # OpenGL backend, on macOS only
137
+ angle = [" wgpu-core-deps-apple/angle" ]
138
+ # # Vulkan portability backend, only available on macOS
139
+ vulkan-portability = [" wgpu-core-deps-apple/vulkan-portability" ]
140
+ # # Renderdoc integration, only available on Windows, Linux, and Android
141
+ renderdoc = [" wgpu-core-deps-windows-linux-android/renderdoc" ]
115
142
116
143
# # Enable the `noop` backend.
117
144
# TODO(https://github.com/gfx-rs/wgpu/issues/7120): there should be a hal feature
118
145
noop = []
119
146
147
+ # The target limitation here isn't needed, but prevents more than one of these
148
+ # platform crates from being included in the build at a time, preventing users
149
+ # from getting confused by seeing them in the list of crates.
150
+ [target .'cfg(target_vendor = "apple")' .dependencies ]
151
+ wgpu-core-deps-apple = { workspace = true , optional = true }
152
+ [target .'cfg(target_os = "emscripten")' .dependencies ]
153
+ wgpu-core-deps-emscripten = { workspace = true , optional = true }
154
+ [target .'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))' .dependencies ]
155
+ wgpu-core-deps-wasm = { workspace = true , optional = true }
156
+ [target .'cfg(any(windows, target_os = "linux", target_os = "android"))' .dependencies ]
157
+ wgpu-core-deps-windows-linux-android = { workspace = true , optional = true }
158
+
120
159
[dependencies ]
121
160
naga.workspace = true
122
161
wgpu-hal.workspace = true
0 commit comments