[package] name = "wgpu-hal" version.workspace = true authors.workspace = true edition.workspace = true description = "WebGPU hardware abstraction layer" homepage.workspace = true repository.workspace = true keywords.workspace = true license.workspace = true rust-version.workspace = true [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"] [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"] 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"] renderdoc = ["libloading", "renderdoc-sys"] emscripten = ["gles"] [[example]] name = "halmark" [[example]] name = "raw-gles" required-features = ["gles"] [dependencies] bitflags.workspace = true parking_lot.workspace = true profiling.workspace = true raw-window-handle.workspace = true thiserror.workspace = true # backends common arrayvec.workspace = true fxhash.workspace = true log.workspace = true renderdoc-sys = { workspace = true, optional = true } # backend: Metal block = { workspace = true, optional = true } foreign-types = { workspace = true, optional = true } # 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"] } # backend: Gles glow = { workspace = true, optional = true } # 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 } [target.'cfg(target_os = "emscripten")'.dependencies] 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] 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 [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(target_os = "android")'.dependencies] android_system_properties.workspace = true [dependencies.naga] workspace = true features = ["clone"] # DEV dependencies [dev-dependencies.naga] workspace = true 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