From feaad992ef5891682bdb8290d88dc4e049029422 Mon Sep 17 00:00:00 2001 From: crowlkats Date: Sat, 10 Jun 2023 00:00:42 +0200 Subject: [PATCH 1/2] feat: add link feature --- Cargo.lock | 5 ++--- wgpu-core/Cargo.toml | 4 +++- wgpu-hal/Cargo.toml | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c86e7db5b..fed7f6238f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1449,10 +1449,9 @@ dependencies = [ [[package]] name = "metal" version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" +source = "git+https://github.com/gfx-rs/metal-rs.git?rev=a6a0446#a6a04463db388e8fd3e99095ab4fbb87cbe9d69c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.3.1", "block", "core-graphics-types", "foreign-types 0.5.0", diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index dc44dbe59f..221d5fad3b 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -22,7 +22,7 @@ targets = [ [lib] [features] -default = [] +default = ["link"] # Backends, passed through to wgpu-hal metal = ["hal/metal"] @@ -30,6 +30,7 @@ vulkan = ["hal/vulkan"] gles = ["hal/gles"] dx11 = ["hal/dx11"] dx12 = ["hal/dx12"] +link = ["hal/link"] # Support the Renderdoc graphics debugger: # https://renderdoc.org/ @@ -80,6 +81,7 @@ version = "0.16" package = "wgpu-hal" path = "../wgpu-hal" version = "0.16" +default_features = false [target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies] web-sys = { version = "0.3.60", features = ["HtmlCanvasElement", "OffscreenCanvas"] } diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index d63964522e..f9122d3074 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -33,7 +33,7 @@ targets = [ [lib] [features] -default = [] +default = ["link"] metal = ["naga/msl-out", "block"] vulkan = ["naga/spv-out", "ash", "gpu-alloc", "gpu-descriptor", "libloading", "smallvec"] gles = ["naga/glsl-out", "glow", "khronos-egl", "libloading"] @@ -43,6 +43,7 @@ dx12 = ["naga/hlsl-out", "d3d12", "bit-set", "range-alloc", "winapi/std", "winap windows_rs = ["gpu-allocator"] dxc_shader_compiler = ["hassle-rs"] renderdoc = ["libloading", "renderdoc-sys"] +link = ["metal/link"] [[example]] name = "halmark" @@ -101,7 +102,7 @@ d3d12 = { version = "0.6.0", git = "https://github.com/gfx-rs/d3d12-rs", rev = " # backend: Metal block = { version = "0.1", optional = true } -metal = "0.25.0" +metal = { git = "https://github.com/gfx-rs/metal-rs.git", rev = "a6a0446", default_features = false } objc = "0.2.5" core-graphics-types = "0.1" From 7832420ae0a75597594ed9c7cf8071d2730ca84b Mon Sep 17 00:00:00 2001 From: crowlkats Date: Wed, 28 Jun 2023 01:51:59 +0200 Subject: [PATCH 2/2] add doc --- wgpu-core/Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 221d5fad3b..57df82684e 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -30,6 +30,8 @@ vulkan = ["hal/vulkan"] gles = ["hal/gles"] dx11 = ["hal/dx11"] dx12 = ["hal/dx12"] + +# Use static linking for libraries. Disale to manually link. Enabled by default. link = ["hal/link"] # Support the Renderdoc graphics debugger: