2021-06-04 05:19:36 +00:00
|
|
|
[package]
|
|
|
|
name = "wgpu-hal"
|
2024-07-17 21:05:46 +00:00
|
|
|
version = "22.0.0"
|
2023-10-27 04:15:51 +00:00
|
|
|
authors = ["gfx-rs developers"]
|
2022-12-15 20:46:28 +00:00
|
|
|
edition = "2021"
|
2021-06-04 05:19:36 +00:00
|
|
|
description = "WebGPU hardware abstraction layer"
|
2022-12-15 20:46:28 +00:00
|
|
|
homepage = "https://wgpu.rs/"
|
|
|
|
repository = "https://github.com/gfx-rs/wgpu"
|
|
|
|
keywords = ["graphics"]
|
|
|
|
license = "MIT OR Apache-2.0"
|
2022-11-23 21:22:03 +00:00
|
|
|
|
|
|
|
# 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.
|
2024-07-20 19:20:05 +00:00
|
|
|
rust-version = "1.76"
|
2021-06-04 05:19:36 +00:00
|
|
|
|
2022-10-26 21:07:25 +00:00
|
|
|
[package.metadata.docs.rs]
|
|
|
|
# Ideally we would enable all the features.
|
|
|
|
#
|
2023-12-06 20:12:46 +00:00
|
|
|
# However, the metal features fail to be documented because the docs.rs runner cross-compiling under
|
2022-10-26 21:07:25 +00:00
|
|
|
# x86_64-unknown-linux-gnu and metal-rs cannot compile in that environment at the moment. The same applies
|
2023-12-06 20:12:46 +00:00
|
|
|
# for the dx12 feature.
|
2022-10-26 21:07:25 +00:00
|
|
|
features = ["vulkan", "gles", "renderdoc"]
|
|
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
2023-02-09 20:38:40 +00:00
|
|
|
targets = [
|
|
|
|
"x86_64-unknown-linux-gnu",
|
|
|
|
"x86_64-apple-darwin",
|
|
|
|
"x86_64-pc-windows-msvc",
|
|
|
|
"wasm32-unknown-unknown",
|
|
|
|
]
|
2022-10-26 21:07:25 +00:00
|
|
|
|
2024-05-12 23:05:00 +00:00
|
|
|
[package.metadata.cargo-machete]
|
|
|
|
# Cargo machete can't check build.rs dependencies. See https://github.com/bnjbvr/cargo-machete/issues/100
|
|
|
|
ignored = ["cfg_aliases"]
|
|
|
|
|
2021-06-04 05:19:36 +00:00
|
|
|
[lib]
|
|
|
|
|
|
|
|
[features]
|
2024-07-06 09:04:02 +00:00
|
|
|
## 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",
|
|
|
|
]
|
2023-10-25 17:53:22 +00:00
|
|
|
vulkan = [
|
|
|
|
"naga/spv-out",
|
2024-05-12 06:45:35 +00:00
|
|
|
"dep:ash",
|
|
|
|
"dep:gpu-alloc",
|
|
|
|
"dep:gpu-descriptor",
|
|
|
|
"dep:libloading",
|
|
|
|
"dep:smallvec",
|
|
|
|
"dep:android_system_properties",
|
2024-03-14 17:00:43 +00:00
|
|
|
]
|
|
|
|
gles = [
|
|
|
|
"naga/glsl-out",
|
2024-10-03 20:40:43 +00:00
|
|
|
"dep:bytemuck",
|
2024-05-12 06:45:35 +00:00
|
|
|
"dep:glow",
|
|
|
|
"dep:glutin_wgl_sys",
|
|
|
|
"dep:khronos-egl",
|
|
|
|
"dep:libloading",
|
|
|
|
"dep:ndk-sys",
|
2024-07-21 19:35:50 +00:00
|
|
|
"windows/Win32_Graphics_OpenGL",
|
|
|
|
"windows/Win32_Graphics_Gdi",
|
|
|
|
"windows/Win32_System_LibraryLoader",
|
|
|
|
"windows/Win32_UI_WindowsAndMessaging",
|
2023-10-25 17:53:22 +00:00
|
|
|
]
|
2024-07-06 09:11:54 +00:00
|
|
|
## Enables the DX12 backend when targeting Windows.
|
|
|
|
##
|
|
|
|
## Has no effect if not targeting Windows.
|
2023-10-25 17:53:22 +00:00
|
|
|
dx12 = [
|
2024-07-06 09:11:54 +00:00
|
|
|
# DX12 is only available on Windows, therefore request HLSL output also only if we target Windows.
|
2024-05-12 06:45:35 +00:00
|
|
|
"dep:bit-set",
|
|
|
|
"dep:libloading",
|
|
|
|
"dep:range-alloc",
|
2024-08-20 15:48:37 +00:00
|
|
|
"dep:windows-core",
|
|
|
|
"gpu-allocator/d3d12",
|
|
|
|
"naga/hlsl-out-if-target-windows",
|
|
|
|
"windows/Win32_Graphics_Direct3D_Fxc",
|
2024-09-02 15:41:37 +00:00
|
|
|
"windows/Win32_Graphics_Direct3D_Dxc",
|
2024-08-20 15:48:37 +00:00
|
|
|
"windows/Win32_Graphics_Direct3D",
|
|
|
|
"windows/Win32_Graphics_Direct3D12",
|
|
|
|
"windows/Win32_Graphics_DirectComposition",
|
|
|
|
"windows/Win32_Graphics_Dxgi_Common",
|
|
|
|
"windows/Win32_Security",
|
|
|
|
"windows/Win32_System_Diagnostics_Debug",
|
|
|
|
"windows/Win32_System_Kernel",
|
|
|
|
"windows/Win32_System_Performance",
|
|
|
|
"windows/Win32_System_Threading",
|
|
|
|
"windows/Win32_UI_WindowsAndMessaging",
|
2023-10-25 17:53:22 +00:00
|
|
|
]
|
2024-05-12 06:45:35 +00:00
|
|
|
renderdoc = ["dep:libloading", "dep:renderdoc-sys"]
|
2023-06-29 20:31:18 +00:00
|
|
|
fragile-send-sync-non-atomic-wasm = ["wgt/fragile-send-sync-non-atomic-wasm"]
|
2024-02-21 16:35:24 +00:00
|
|
|
# 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 = []
|
2021-06-04 05:19:36 +00:00
|
|
|
|
2022-01-03 05:54:43 +00:00
|
|
|
[[example]]
|
|
|
|
name = "halmark"
|
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "raw-gles"
|
|
|
|
required-features = ["gles"]
|
|
|
|
|
2021-06-04 05:19:36 +00:00
|
|
|
[dependencies]
|
2024-07-26 16:48:01 +00:00
|
|
|
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
|
2021-06-05 05:44:21 +00:00
|
|
|
|
2021-06-11 06:09:03 +00:00
|
|
|
# backends common
|
2024-07-26 16:48:01 +00:00
|
|
|
arrayvec.workspace = true
|
|
|
|
rustc-hash.workspace = true
|
|
|
|
log.workspace = true
|
2021-07-14 16:40:01 +00:00
|
|
|
|
2021-06-18 04:38:27 +00:00
|
|
|
# backend: Gles
|
2024-10-03 20:40:43 +00:00
|
|
|
bytemuck = { workspace = true, optional = true }
|
2024-07-26 16:48:01 +00:00
|
|
|
glow = { workspace = true, optional = true }
|
2021-07-14 16:40:01 +00:00
|
|
|
|
2021-08-18 19:06:21 +00:00
|
|
|
[dependencies.wgt]
|
2022-12-15 20:46:28 +00:00
|
|
|
package = "wgpu-types"
|
|
|
|
path = "../wgpu-types"
|
2024-07-17 21:05:46 +00:00
|
|
|
version = "22.0.0"
|
2021-08-18 19:06:21 +00:00
|
|
|
|
2021-06-18 04:38:27 +00:00
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
2023-02-21 12:50:55 +00:00
|
|
|
# backend: Vulkan
|
2024-07-26 16:48:01 +00:00
|
|
|
ash = { workspace = true, optional = true }
|
|
|
|
gpu-alloc = { workspace = true, optional = true }
|
|
|
|
gpu-descriptor = { workspace = true, optional = true }
|
|
|
|
smallvec = { workspace = true, optional = true, features = ["union"] }
|
2023-02-21 12:50:55 +00:00
|
|
|
|
2024-07-26 16:48:01 +00:00
|
|
|
khronos-egl = { workspace = true, features = ["dynamic"], optional = true }
|
|
|
|
libloading = { workspace = true, optional = true }
|
|
|
|
renderdoc-sys = { workspace = true, optional = true }
|
2021-06-08 15:46:53 +00:00
|
|
|
|
2022-01-25 10:35:45 +00:00
|
|
|
[target.'cfg(target_os = "emscripten")'.dependencies]
|
2024-07-26 16:48:01 +00:00
|
|
|
khronos-egl = { workspace = true, features = ["static", "no-pkg-config"] }
|
2022-01-25 10:35:45 +00:00
|
|
|
#Note: it's unused by emscripten, but we keep it to have single code base in egl.rs
|
2024-07-26 16:48:01 +00:00
|
|
|
libloading = { workspace = true, optional = true }
|
2022-01-25 10:35:45 +00:00
|
|
|
|
2021-06-16 15:42:37 +00:00
|
|
|
[target.'cfg(windows)'.dependencies]
|
2024-07-21 19:35:50 +00:00
|
|
|
# backend: Dx12 and Gles
|
|
|
|
windows = { workspace = true, optional = true }
|
2023-02-21 12:50:55 +00:00
|
|
|
# backend: Dx12
|
2024-07-26 16:48:01 +00:00
|
|
|
bit-set = { workspace = true, optional = true }
|
|
|
|
range-alloc = { workspace = true, optional = true }
|
|
|
|
gpu-allocator = { workspace = true, optional = true }
|
2024-08-20 15:48:37 +00:00
|
|
|
# For core macros. This crate is also reexported as windows::core.
|
|
|
|
windows-core = { workspace = true, optional = true }
|
2024-07-26 16:48:01 +00:00
|
|
|
|
2023-10-18 18:40:33 +00:00
|
|
|
# backend: Gles
|
2024-07-26 16:48:01 +00:00
|
|
|
glutin_wgl_sys = { workspace = true, optional = true }
|
2023-02-21 12:50:55 +00:00
|
|
|
|
2021-06-16 15:42:37 +00:00
|
|
|
[target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies]
|
2023-02-21 12:50:55 +00:00
|
|
|
# backend: Metal
|
2024-07-26 16:48:01 +00:00
|
|
|
block = { workspace = true, optional = true }
|
2023-02-21 12:50:55 +00:00
|
|
|
|
2024-07-26 16:48:01 +00:00
|
|
|
metal.workspace = true
|
|
|
|
objc.workspace = true
|
|
|
|
core-graphics-types.workspace = true
|
2021-06-16 15:42:37 +00:00
|
|
|
|
2022-01-25 10:35:45 +00:00
|
|
|
[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
|
2024-07-26 16:48:01 +00:00
|
|
|
wasm-bindgen.workspace = true
|
|
|
|
web-sys = { workspace = true, features = [
|
2023-10-25 17:53:22 +00:00
|
|
|
"Window",
|
|
|
|
"HtmlCanvasElement",
|
|
|
|
"WebGl2RenderingContext",
|
|
|
|
"OffscreenCanvas",
|
|
|
|
] }
|
2024-07-26 16:48:01 +00:00
|
|
|
js-sys.workspace = true
|
2021-10-07 20:18:09 +00:00
|
|
|
|
2022-12-20 17:52:08 +00:00
|
|
|
[target.'cfg(unix)'.dependencies]
|
2024-07-26 16:48:01 +00:00
|
|
|
libc.workspace = true
|
2022-12-20 17:52:08 +00:00
|
|
|
|
2022-06-04 16:05:40 +00:00
|
|
|
[target.'cfg(target_os = "android")'.dependencies]
|
2024-07-26 16:48:01 +00:00
|
|
|
android_system_properties = { workspace = true, optional = true }
|
|
|
|
ndk-sys = { workspace = true, optional = true }
|
2022-06-04 16:05:40 +00:00
|
|
|
|
2021-06-05 05:44:21 +00:00
|
|
|
[dependencies.naga]
|
2023-10-25 20:51:36 +00:00
|
|
|
path = "../naga"
|
2024-07-17 21:05:46 +00:00
|
|
|
version = "22.0.0"
|
2021-06-08 18:58:48 +00:00
|
|
|
|
2024-01-14 05:59:59 +00:00
|
|
|
[build-dependencies]
|
|
|
|
cfg_aliases.workspace = true
|
|
|
|
|
2022-01-06 17:02:44 +00:00
|
|
|
# DEV dependencies
|
2021-06-08 18:58:48 +00:00
|
|
|
[dev-dependencies.naga]
|
2023-10-25 20:51:36 +00:00
|
|
|
path = "../naga"
|
2024-07-17 21:05:46 +00:00
|
|
|
version = "22.0.0"
|
2021-06-08 18:58:48 +00:00
|
|
|
features = ["wgsl-in"]
|
|
|
|
|
|
|
|
[dev-dependencies]
|
2024-07-26 16:48:01 +00:00
|
|
|
cfg-if.workspace = true
|
|
|
|
env_logger.workspace = true
|
2024-10-04 14:57:23 +00:00
|
|
|
glam.workspace = true # for ray-traced-triangle example
|
|
|
|
winit.workspace = true # for "halmark" example
|
2022-01-06 17:02:44 +00:00
|
|
|
|
2024-09-04 15:11:47 +00:00
|
|
|
[target.'cfg(not(any(target_arch = "wasm32", target_os = "ios")))'.dev-dependencies]
|
2024-10-04 14:57:23 +00:00
|
|
|
glutin-winit = { workspace = true, features = [
|
|
|
|
"egl",
|
|
|
|
"wgl",
|
|
|
|
"wayland",
|
|
|
|
"x11",
|
|
|
|
] } # for "raw-gles" example
|
|
|
|
glutin = { workspace = true, features = [
|
|
|
|
"egl",
|
|
|
|
"wgl",
|
|
|
|
"wayland",
|
|
|
|
"x11",
|
|
|
|
] } # for "raw-gles" example
|
[wgpu-hal] Upgrade `glutin` to `0.31` (#6150)
* [wgpu-hal] Upgrade `glutin` to `0.31`
`glutin 0.30` onwards completely refactored its internals to no longer
be reliant on `winit`, as they (by default) have no direct relation
except needing to perform _some_ operations (platform-specific) at
strategic times in window creation and event loop handling. Most of
that is handled by a new `glutin-winit` introp crate, while the core
`glutin` crate now exclusively focuses on wrapping the various OpenGL
context APIs (CGL, EGL, WGL, ...).
This does result in a little more verbose handling to get the right
`GLDisplay`, `GLConfig`, `GLContext` and `GLSurface`, but gives much
more control and makes all intricacies more explicit. Most of the
code was copied from `glutin 0.31`'s example crate, with the code for
transparency support removed.
Note that the example doesn't at all handle event loop events properly:
resizes and redraws are not listened to, and mobile-specific surface
events (`Resumed` and `Suspended`) are equally ignored.
* [wgpu-hal] Implement proper `Surface` availability semantics in `raw-gles` example
2024-08-27 17:05:47 +00:00
|
|
|
rwh_05 = { version = "0.5", package = "raw-window-handle" } # temporary compatibility for glutin-winit in "raw-gles" example
|
|
|
|
winit = { workspace = true, features = ["rwh_05"] } # for "raw-gles" example
|