feat: add link feature (#3853)

This commit is contained in:
Leo Kettmeir 2023-06-28 12:30:28 +02:00 committed by GitHub
parent 757245cdfc
commit 973cd3ebf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

5
Cargo.lock generated
View File

@ -1463,10 +1463,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",

View File

@ -22,7 +22,7 @@ targets = [
[lib]
[features]
default = []
default = ["link"]
# Backends, passed through to wgpu-hal
metal = ["hal/metal"]
@ -31,6 +31,9 @@ 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:
# https://renderdoc.org/
renderdoc = ["hal/renderdoc"]
@ -80,6 +83,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"] }

View File

@ -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"