wgpu/wgpu-hal/Cargo.toml

202 lines
5.4 KiB
TOML
Raw Normal View History

2021-06-04 05:19:36 +00:00
[package]
name = "wgpu-hal"
2024-01-17 19:42:11 +00:00
version = "0.19.0"
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"
# 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.74"
2021-06-04 05:19:36 +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
# 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.
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",
]
2021-06-04 05:19:36 +00:00
[lib]
[features]
2023-06-28 10:30:28 +00:00
default = ["link"]
metal = ["naga/msl-out", "block"]
2023-10-25 17:53:22 +00:00
vulkan = [
"naga/spv-out",
"ash",
"gpu-alloc",
"gpu-descriptor",
"libloading",
"smallvec",
"android_system_properties",
]
gles = [
"naga/glsl-out",
"glow",
"glutin_wgl_sys",
"khronos-egl",
"libloading",
"ndk-sys",
2023-10-25 17:53:22 +00:00
]
dx12 = [
"naga/hlsl-out",
"d3d12",
"bit-set",
"libloading",
"range-alloc",
"winapi/std",
"winapi/winbase",
"winapi/d3d12",
"winapi/d3d12shader",
"winapi/d3d12sdklayers",
"winapi/dxgi1_6",
]
# 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 = ["gpu-allocator"]
dxc_shader_compiler = ["hassle-rs"]
2021-07-14 16:40:01 +00:00
renderdoc = ["libloading", "renderdoc-sys"]
fragile-send-sync-non-atomic-wasm = ["wgt/fragile-send-sync-non-atomic-wasm"]
2023-06-28 10:30:28 +00:00
link = ["metal/link"]
# 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
[[example]]
name = "halmark"
[[example]]
name = "raw-gles"
required-features = ["gles"]
2021-06-04 05:19:36 +00:00
[dependencies]
bitflags = "2"
2022-12-15 20:46:28 +00:00
parking_lot = ">=0.11,<0.13"
profiling = { version = "1", default-features = false }
raw-window-handle = "0.6"
2022-12-15 20:46:28 +00:00
thiserror = "1"
once_cell = "1.19.0"
2021-06-05 05:44:21 +00:00
2021-06-11 06:09:03 +00:00
# backends common
2022-12-15 20:46:28 +00:00
arrayvec = "0.7"
rustc-hash = "1.1"
2022-12-15 20:46:28 +00:00
log = "0.4"
2021-07-14 16:40:01 +00:00
# backend: Gles
2024-01-17 20:23:50 +00:00
glow = { version = "0.13.1", optional = true }
2021-07-14 16:40:01 +00:00
[dependencies.wgt]
2022-12-15 20:46:28 +00:00
package = "wgpu-types"
path = "../wgpu-types"
2024-01-17 19:42:11 +00:00
version = "0.19.0"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# backend: Vulkan
ash = { version = "0.37.3", optional = true }
gpu-alloc = { version = "0.6", optional = true }
gpu-descriptor = { version = "0.2", optional = true }
smallvec = { version = "1", optional = true, features = ["union"] }
2023-10-05 18:01:32 +00:00
khronos-egl = { version = "6", features = ["dynamic"], optional = true }
libloading = { version = ">=0.7, <0.9", optional = true }
renderdoc-sys = { version = "1.1.0", optional = true }
2021-06-08 15:46:53 +00:00
2022-01-25 10:35:45 +00:00
[target.'cfg(target_os = "emscripten")'.dependencies]
2023-10-05 18:01:32 +00:00
khronos-egl = { version = "6", 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
libloading = { version = ">=0.7, <0.9", optional = true }
2022-01-25 10:35:45 +00:00
[target.'cfg(windows)'.dependencies]
# backend: Dx12
bit-set = { version = "0.5", optional = true }
range-alloc = { version = "0.1", optional = true }
gpu-allocator = { version = "0.25", default_features = false, features = [
2023-10-25 17:53:22 +00:00
"d3d12",
"public-winapi",
], optional = true }
hassle-rs = { version = "0.11", optional = true }
# backend: Gles
glutin_wgl_sys = { version = "0.5", optional = true }
2023-10-25 17:53:22 +00:00
winapi = { version = "0.3", features = [
"profileapi",
"libloaderapi",
"windef",
"winuser",
"dcomp",
] }
2024-01-17 19:42:11 +00:00
d3d12 = { path = "../d3d12/", version = "0.19.0", optional = true, features = [
"libloading",
] }
[target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies]
# backend: Metal
block = { version = "0.1", optional = true }
2023-10-25 18:04:01 +00:00
metal = "0.27.0"
2022-12-15 20:46:28 +00:00
objc = "0.2.5"
core-graphics-types = "0.1"
2022-01-25 10:35:45 +00:00
[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
wasm-bindgen = "0.2.87"
web-sys = { version = "0.3.69", features = [
2023-10-25 17:53:22 +00:00
"Window",
"HtmlCanvasElement",
"WebGl2RenderingContext",
"OffscreenCanvas",
] }
js-sys = "0.3.69"
[target.'cfg(unix)'.dependencies]
libc = "0.2"
Acquire texture: `Option<std::time::Duration>` timeouts (#2724) * surface.acquire_texture: pass Option<Duration> for timeout A std::time::Duration allows for timeouts to be specified more clearly in Rust using whatever units are convenient for the caller, and an Option also makes it clearer in case no timeout is wanted, as opposed to passing a bitwise !0 as special timeout value. Notably there was an impedance mismatch with the Vulkan backend that takes a 64bit timeout in nanoseconds and uses u64::MAX to indicate no timeout and the backend was not mapping a given u32::MAX into a u64::MAX * surface.acquire_texture: ignore timeout for Android < 11 Prior to Android 11 then Android's vkAcquireNextImageKHR implementation was non-conformant and didn't support timeouts and additionally would log a verbose warning if a timeout was requested. For reference this version of AcquireNextImageKHR doesn't support timeouts: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-mainline-10.0.0_r13/vulkan/libvulkan/swapchain.cpp#1426 and this version does: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-mainline-11.0.0_r45/vulkan/libvulkan/swapchain.cpp#1438 (i.e. timeout support was added in Android 11) This patch adds a dependency on the `android-properties` crate that provides a simple wrapper for the `__system_property_set` syscall so that the platform version can be read via the `ro.build.version.sdk` property and then for versions < 30 (corresponds to Android 11) any timeout given to `acquire_texture` will be ignored (and `u64::MAX` will be passed to Vulkan)
2022-06-04 16:05:40 +00:00
[target.'cfg(target_os = "android")'.dependencies]
android_system_properties = { version = "0.1.1", optional = true }
ndk-sys = { version = "0.5.0", optional = true }
Acquire texture: `Option<std::time::Duration>` timeouts (#2724) * surface.acquire_texture: pass Option<Duration> for timeout A std::time::Duration allows for timeouts to be specified more clearly in Rust using whatever units are convenient for the caller, and an Option also makes it clearer in case no timeout is wanted, as opposed to passing a bitwise !0 as special timeout value. Notably there was an impedance mismatch with the Vulkan backend that takes a 64bit timeout in nanoseconds and uses u64::MAX to indicate no timeout and the backend was not mapping a given u32::MAX into a u64::MAX * surface.acquire_texture: ignore timeout for Android < 11 Prior to Android 11 then Android's vkAcquireNextImageKHR implementation was non-conformant and didn't support timeouts and additionally would log a verbose warning if a timeout was requested. For reference this version of AcquireNextImageKHR doesn't support timeouts: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-mainline-10.0.0_r13/vulkan/libvulkan/swapchain.cpp#1426 and this version does: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-mainline-11.0.0_r45/vulkan/libvulkan/swapchain.cpp#1438 (i.e. timeout support was added in Android 11) This patch adds a dependency on the `android-properties` crate that provides a simple wrapper for the `__system_property_set` syscall so that the platform version can be read via the `ro.build.version.sdk` property and then for versions < 30 (corresponds to Android 11) any timeout given to `acquire_texture` will be ignored (and `u64::MAX` will be passed to Vulkan)
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-01-17 19:42:11 +00:00
version = "0.19.0"
2021-06-08 18:58:48 +00:00
[build-dependencies]
cfg_aliases.workspace = true
# DEV dependencies
2021-06-08 18:58:48 +00:00
[dev-dependencies.naga]
2023-10-25 20:51:36 +00:00
path = "../naga"
2024-01-17 19:42:11 +00:00
version = "0.19.0"
2021-06-08 18:58:48 +00:00
features = ["wgsl-in"]
[dev-dependencies]
cfg-if = "1"
env_logger = "0.11"
glam = "0.25.0" # for ray-traced-triangle example
winit = { version = "0.29.14", features = [
"android-native-activity",
] } # for "halmark" example
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
2022-12-15 20:46:28 +00:00
glutin = "0.29.1" # for "gles" example