[package]
name = "wgpu-hal"
version.workspace = true
authors.workspace = true
edition.workspace = true
description = "Hardware abstraction layer for wgpu, the cross-platform, safe, pure-rust graphics API"
homepage.workspace = true
repository.workspace = true
keywords.workspace = true
license.workspace = true
rust-version = "1.87"
[package.metadata.docs.rs]
features = ["metal", "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]
ignored = ["cfg_aliases"]
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(feature, values("cargo-clippy"))',
'cfg(web_sys_unstable_apis)',
] }
[lib]
[features]
metal = [
"naga/msl-out",
"dep:arrayvec",
"dep:block2",
"dep:bytemuck",
"dep:hashbrown",
"dep:libc",
"dep:objc2",
"dep:objc2-core-foundation",
"dep:objc2-foundation",
"dep:objc2-metal",
"dep:objc2-quartz-core",
"dep:parking_lot",
"dep:profiling",
"dep:smallvec",
"dep:raw-window-metal",
]
vulkan = [
"naga/spv-out",
"dep:android_system_properties",
"dep:arrayvec",
"dep:ash",
"dep:bytemuck",
"dep:gpu-descriptor",
"dep:hashbrown",
"dep:libc",
"dep:libloading",
"dep:ordered-float",
"dep:parking_lot",
"dep:profiling",
"dep:raw-window-metal",
"dep:smallvec",
"dep:windows",
"gpu-allocator/vulkan",
"windows/Win32",
]
gles = [
"dep:arrayvec",
"dep:bytemuck",
"dep:glow",
"dep:glutin_wgl_sys",
"dep:hashbrown",
"dep:js-sys",
"dep:khronos-egl",
"dep:libloading",
"dep:ndk-sys",
"dep:objc2",
"dep:parking_lot",
"dep:profiling",
"dep:wasm-bindgen",
"dep:wayland-sys",
"dep:web-sys",
"dep:windows-result",
"naga/glsl-out",
"wgpu-types/web",
"windows-result/std",
"windows/Win32_Graphics_Gdi",
"windows/Win32_Graphics_OpenGL",
"windows/Win32_System_LibraryLoader",
"windows/Win32_UI_WindowsAndMessaging",
]
dx12 = [
"dep:arrayvec",
"dep:bit-set",
"dep:bytemuck",
"dep:gpu-allocator",
"dep:hashbrown",
"dep:libloading",
"dep:once_cell",
"dep:ordered-float",
"dep:parking_lot",
"dep:profiling",
"dep:range-alloc",
"dep:windows-core",
"gpu-allocator/d3d12",
"naga/hlsl-out",
"once_cell/std",
"windows/Win32_Devices_DeviceAndDriverInstallation",
"windows/Win32_Graphics_Direct3D_Dxc",
"windows/Win32_Graphics_Direct3D_Fxc",
"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",
]
static-dxc = ["dep:mach-dxcompiler-rs"]
renderdoc = ["dep:libloading", "dep:renderdoc-sys"]
fragile-send-sync-non-atomic-wasm = [
"wgpu-types/fragile-send-sync-non-atomic-wasm",
]
portable-atomic = ["dep:portable-atomic", "dep:portable-atomic-util"]
device_lost_panic = []
internal_error_panic = []
validation_canary = ["dep:parking_lot"]
[[example]]
name = "halmark"
[[example]]
name = "raw-gles"
required-features = ["gles"]
[dependencies]
naga.workspace = true
wgpu-naga-bridge.workspace = true
wgpu-types = { workspace = true, default-features = false }
bitflags.workspace = true
cfg-if.workspace = true
log = { workspace = true }
parking_lot = { workspace = true, optional = true }
raw-window-handle.workspace = true
thiserror.workspace = true
arrayvec = { workspace = true, optional = true }
bytemuck = { workspace = true, optional = true, features = ["derive"] }
hashbrown = { workspace = true, optional = true }
ordered-float = { workspace = true, optional = true }
profiling = { workspace = true, optional = true, default-features = false }
glow = { workspace = true, optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
gpu-allocator = { workspace = true, optional = true }
ash = { 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(unix)'.dependencies]
libc = { workspace = true, optional = true }
wayland-sys = { version = "0.31.3", features = [
"client",
"dlopen",
"egl",
], optional = true }
[target.'cfg(windows)'.dependencies]
windows = { workspace = true, optional = true }
windows-core = { workspace = true, optional = true }
windows-result = { workspace = true, optional = true }
bit-set = { workspace = true, optional = true }
range-alloc = { workspace = true, optional = true }
once_cell = { workspace = true, optional = true }
glutin_wgl_sys = { workspace = true, optional = true }
[target.'cfg(all(windows, not(target_arch = "aarch64"), target_env = "msvc"))'.dependencies]
mach-dxcompiler-rs = { workspace = true, optional = true }
[target.'cfg(target_vendor = "apple")'.dependencies]
block2 = { workspace = true, optional = true }
bytemuck = { workspace = true, optional = true }
objc2 = { workspace = true, optional = true }
objc2-core-foundation = { workspace = true, optional = true }
objc2-foundation = { workspace = true, optional = true }
objc2-metal = { workspace = true, optional = true }
objc2-quartz-core = { workspace = true, optional = true }
raw-window-metal = { workspace = true, optional = true }
[target.'cfg(target_os = "android")'.dependencies]
android_system_properties = { workspace = true, optional = true }
ndk-sys = { workspace = true, optional = true }
[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
wasm-bindgen = { workspace = true, optional = true }
web-sys = { workspace = true, optional = true, features = [
"default",
"Window",
"HtmlCanvasElement",
"WebGl2RenderingContext",
"OffscreenCanvas",
] }
js-sys = { workspace = true, optional = true, default-features = true }
[target.'cfg(target_os = "emscripten")'.dependencies]
khronos-egl = { workspace = true, optional = true, features = [
"static",
"no-pkg-config",
] }
libloading = { workspace = true, optional = true }
[target.'cfg(any(not(target_has_atomic = "64"), not(target_has_atomic = "ptr")))'.dependencies]
portable-atomic = { workspace = true, optional = true }
[target.'cfg(not(target_has_atomic = "ptr"))'.dependencies]
portable-atomic-util = { workspace = true, features = [
"alloc",
], optional = true }
[build-dependencies]
cfg_aliases.workspace = true
[dev-dependencies]
env_logger.workspace = true
glam.workspace = true
naga = { workspace = true, features = ["wgsl-in", "termcolor"] }
winit.workspace = true
[target.'cfg(not(any(target_arch = "wasm32", target_os = "ios", target_os = "visionos", target_env = "ohos")))'.dev-dependencies]
glutin-winit = { workspace = true, features = ["egl", "wgl", "wayland", "x11"] }
glutin = { workspace = true, features = ["egl", "wgl", "wayland", "x11"] }