forked from gfx-rs/wgpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cargo.toml
216 lines (189 loc) · 6.33 KB
/
Cargo.toml
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
[package]
name = "wgpu-hal"
version = "22.0.0"
authors = ["gfx-rs developers"]
edition = "2021"
description = "WebGPU hardware abstraction layer"
homepage = "https://wgpu.rs/"
repository = "https://github.com/gfx-rs/wgpu"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
# Override the workspace's `rust-version` key. Firefox uses `cargo vendor` to
# copy the crates it actually uses out of the workspace, so it's meaningful for
# them to have less restrictive MSRVs individually than the workspace as a
# whole, if their code permits. See `../README.md` for details.
rust-version = "1.76"
[package.metadata.docs.rs]
# Ideally we would enable all the features.
#
# However, the metal features fail to be documented because the docs.rs runner cross-compiling under
# x86_64-unknown-linux-gnu and metal-rs cannot compile in that environment at the moment. The same applies
# for the dx12 feature.
features = ["vulkan", "gles", "renderdoc"]
rustdoc-args = ["--cfg", "docsrs"]
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"wasm32-unknown-unknown",
]
[package.metadata.cargo-machete]
# Cargo machete can't check build.rs dependencies. See https://github.com/bnjbvr/cargo-machete/issues/100
ignored = ["cfg_aliases"]
[lib]
[features]
## Enables the Metal backend when targeting Apple platforms.
##
## Has no effect on non-Apple platforms.
metal = [
# Metal is only available on Apple platforms, therefore request MSL output also only if we target an Apple platform.
"naga/msl-out-if-target-apple",
"dep:block",
]
vulkan = [
"naga/spv-out",
"dep:ash",
"dep:gpu-alloc",
"dep:gpu-descriptor",
"dep:libloading",
"dep:smallvec",
"dep:android_system_properties",
]
gles = [
"naga/glsl-out",
"dep:glow",
"dep:glutin_wgl_sys",
"dep:khronos-egl",
"dep:libloading",
"dep:ndk-sys",
"windows/Win32_Graphics_OpenGL",
"windows/Win32_Graphics_Gdi",
"windows/Win32_System_LibraryLoader",
"windows/Win32_UI_WindowsAndMessaging",
]
## Enables the DX12 backend when targeting Windows.
##
## Has no effect if not targeting Windows.
dx12 = [
# DX12 is only available on Windows, therefore request HLSL output also only if we target Windows.
"naga/hlsl-out-if-target-windows",
"dep:d3d12",
"dep:bit-set",
"dep:libloading",
"dep:range-alloc",
"winapi/std",
"winapi/winbase",
"winapi/d3d12",
"winapi/d3d12shader",
"winapi/d3d12sdklayers",
"winapi/dxgi1_6",
"winapi/errhandlingapi",
]
# TODO: This is a separate feature until Mozilla okays windows-rs, see https://github.com/gfx-rs/wgpu/issues/3207 for the tracking issue.
windows_rs = ["dep:gpu-allocator"]
dxc_shader_compiler = ["dep:hassle-rs"]
renderdoc = ["dep:libloading", "dep:renderdoc-sys"]
fragile-send-sync-non-atomic-wasm = ["wgt/fragile-send-sync-non-atomic-wasm"]
# Panic when running into an out-of-memory error (for debugging purposes).
#
# Only affects the d3d12 and vulkan backends.
oom_panic = []
# Panic when running into a device lost error (for debugging purposes).
# Only affects the d3d12 and vulkan backends.
device_lost_panic = []
# Panic when running into an internal error other than out-of-memory and device lost
# (for debugging purposes).
#
# Only affects the d3d12 and vulkan backends.
internal_error_panic = []
[[example]]
name = "halmark"
[[example]]
name = "raw-gles"
required-features = ["gles"]
[dependencies]
bitflags.workspace = true
parking_lot.workspace = true
profiling = { workspace = true, default-features = false }
raw-window-handle.workspace = true
thiserror.workspace = true
once_cell.workspace = true
# backends common
arrayvec.workspace = true
rustc-hash.workspace = true
log.workspace = true
# backend: Gles
glow = { workspace = true, optional = true }
[dependencies.wgt]
package = "wgpu-types"
path = "../wgpu-types"
version = "22.0.0"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# backend: Vulkan
ash = { workspace = true, optional = true }
gpu-alloc = { workspace = true, optional = true }
gpu-descriptor = { workspace = true, optional = true }
smallvec = { workspace = true, optional = true, features = ["union"] }
khronos-egl = { workspace = true, features = ["dynamic"], optional = true }
libloading = { workspace = true, optional = true }
renderdoc-sys = { workspace = true, optional = true }
[target.'cfg(target_os = "emscripten")'.dependencies]
khronos-egl = { workspace = true, features = ["static", "no-pkg-config"] }
#Note: it's unused by emscripten, but we keep it to have single code base in egl.rs
libloading = { workspace = true, optional = true }
[target.'cfg(windows)'.dependencies]
# backend: Dx12 and Gles
windows = { workspace = true, optional = true }
# backend: Dx12
bit-set = { workspace = true, optional = true }
range-alloc = { workspace = true, optional = true }
gpu-allocator = { workspace = true, optional = true }
hassle-rs = { workspace = true, optional = true }
# backend: Gles
glutin_wgl_sys = { workspace = true, optional = true }
winapi = { version = "0.3", features = [
"profileapi",
"windef",
"winuser",
"dcomp",
] }
d3d12 = { path = "../d3d12/", version = "22.0.0", optional = true, features = [
"libloading",
] }
[target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies]
# backend: Metal
block = { workspace = true, optional = true }
metal.workspace = true
objc.workspace = true
core-graphics-types.workspace = true
[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
wasm-bindgen.workspace = true
web-sys = { workspace = true, features = [
"Window",
"HtmlCanvasElement",
"WebGl2RenderingContext",
"OffscreenCanvas",
] }
js-sys.workspace = true
[target.'cfg(unix)'.dependencies]
libc.workspace = true
[target.'cfg(target_os = "android")'.dependencies]
android_system_properties = { workspace = true, optional = true }
ndk-sys = { workspace = true, optional = true }
[dependencies.naga]
path = "../naga"
version = "22.0.0"
[build-dependencies]
cfg_aliases.workspace = true
# DEV dependencies
[dev-dependencies.naga]
path = "../naga"
version = "22.0.0"
features = ["wgsl-in"]
[dev-dependencies]
cfg-if.workspace = true
env_logger.workspace = true
glam.workspace = true # for ray-traced-triangle example
winit.workspace = true # for "halmark" example
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
glutin.workspace = true # for "gles" example