wgpu/wgpu-hal/Cargo.toml

115 lines
3.6 KiB
TOML
Raw Normal View History

2021-06-04 05:19:36 +00:00
[package]
name = "wgpu-hal"
version.workspace = true
authors.workspace = true
edition.workspace = true
2021-06-04 05:19:36 +00:00
description = "WebGPU hardware abstraction layer"
homepage.workspace = true
repository.workspace = true
keywords.workspace = true
license.workspace = true
rust-version.workspace = true
2021-06-04 05:19:36 +00:00
[package.metadata.docs.rs]
# Ideally we would enable all the features.
#
# However the metal features fails 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
# with the dx11 and dx12 features.
features = ["vulkan", "gles", "renderdoc"]
rustdoc-args = ["--cfg", "docsrs"]
2021-06-04 05:19:36 +00:00
[lib]
[features]
default = ["gles"]
metal = ["naga/msl-out", "block", "foreign-types"]
vulkan = ["naga/spv-out", "ash", "gpu-alloc", "gpu-descriptor", "libloading", "smallvec"]
gles = ["naga/glsl-out", "glow", "egl", "libloading"]
2022-03-12 17:14:18 +00:00
dx11 = ["naga/hlsl-out", "native", "libloading", "winapi/d3d11", "winapi/d3d11_1", "winapi/d3d11_2", "winapi/d3d11sdklayers", "winapi/dxgi1_6"]
dx12 = ["naga/hlsl-out", "native", "bit-set", "range-alloc", "winapi/d3d12", "winapi/d3d12shader", "winapi/d3d12sdklayers", "winapi/dxgi1_6"]
2021-07-14 16:40:01 +00:00
renderdoc = ["libloading", "renderdoc-sys"]
2022-01-25 10:35:45 +00:00
emscripten = ["gles"]
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.workspace = true
parking_lot.workspace = true
profiling.workspace = true
raw-window-handle.workspace = true
thiserror.workspace = true
2021-06-05 05:44:21 +00:00
2021-06-11 06:09:03 +00:00
# backends common
arrayvec.workspace = true
fxhash.workspace = true
log.workspace = true
renderdoc-sys = { workspace = true, optional = true }
2021-07-14 16:40:01 +00:00
2021-06-11 06:09:03 +00:00
# backend: Metal
block = { workspace = true, optional = true }
foreign-types = { workspace = true, optional = true }
2021-07-14 16:40:01 +00:00
2021-06-11 06:09:03 +00:00
# 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"] }
2021-07-14 16:40:01 +00:00
# backend: Gles
glow = { workspace = true, optional = true }
2021-07-14 16:40:01 +00:00
2021-07-05 06:17:09 +00:00
# backend: Dx12
bit-set = { workspace = true, optional = true }
range-alloc = { workspace = true, optional = true }
[dependencies.wgt]
workspace = true
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
egl = { workspace = true, features = ["dynamic"], optional = true }
libloading = { 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]
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
libloading = { workspace = true, optional = true }
2022-01-25 10:35:45 +00:00
[target.'cfg(windows)'.dependencies]
winapi = { workspace = true, features = ["libloaderapi", "windef", "winuser", "dcomp"] }
native = { workspace = true, features = ["libloading"], optional = true }
[target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies]
mtl.workspace = true
objc.workspace = true
core-graphics-types.workspace = true
2022-01-25 10:35:45 +00:00
[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
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.workspace = 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]
workspace = true
features = ["clone"]
2021-06-08 18:58:48 +00:00
# DEV dependencies
2021-06-08 18:58:48 +00:00
[dev-dependencies.naga]
workspace = true
2021-06-08 18:58:48 +00:00
features = ["wgsl-in"]
[dev-dependencies]
env_logger.workspace = true
winit.workspace = true # for "halmark" example
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
glutin.workspace = true # for "gles" example