diff --git a/Cargo.lock b/Cargo.lock index 743a8dfda7..5a0221f47a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1514,16 +1514,17 @@ dependencies = [ [[package]] name = "metal" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +checksum = "550b24b0cd4cf923f36bae78eca457b3a10d8a6a14a9c84cb2687b527e6a84af" dependencies = [ "bitflags 1.3.2", "block", "core-graphics-types", - "foreign-types 0.3.2", + "foreign-types 0.5.0", "log", "objc", + "paste", ] [[package]] @@ -1872,6 +1873,12 @@ dependencies = [ "windows-sys 0.42.0", ] +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + [[package]] name = "percent-encoding" version = "2.2.0" @@ -3195,7 +3202,6 @@ dependencies = [ "core-graphics-types", "d3d12", "env_logger", - "foreign-types 0.3.2", "glow", "glutin", "gpu-alloc", diff --git a/Cargo.toml b/Cargo.toml index 84dddc4636..937ab3d07d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,8 +88,7 @@ winit = "0.27.1" # Metal dependencies block = "0.1" -foreign-types = "0.3" -metal = "0.24.0" +metal = "0.25.0" objc = "0.2.5" core-graphics-types = "0.1" diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 495c241c6e..6205a23a2e 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -34,7 +34,7 @@ targets = [ [features] default = [] -metal = ["naga/msl-out", "block", "foreign-types"] +metal = ["naga/msl-out", "block"] vulkan = ["naga/spv-out", "ash", "gpu-alloc", "gpu-descriptor", "libloading", "smallvec"] gles = ["naga/glsl-out", "glow", "khronos-egl", "libloading"] dx11 = ["naga/hlsl-out", "d3d12", "libloading", "winapi/d3d11", "winapi/std", "winapi/d3d11_1", "winapi/d3d11_2", "winapi/d3d11sdklayers", "winapi/dxgi1_6"] @@ -100,9 +100,8 @@ d3d12 = { version = "0.6.0", git = "https://github.com/gfx-rs/d3d12-rs", rev = " [target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies] # backend: Metal block = { version = "0.1", optional = true } -foreign-types = { version = "0.3", optional = true } -metal = "0.24.0" +metal = "0.25.0" objc = "0.2.5" core-graphics-types = "0.1" diff --git a/wgpu-hal/src/metal/device.rs b/wgpu-hal/src/metal/device.rs index f8a1ad9a9f..a39bc82ab7 100644 --- a/wgpu-hal/src/metal/device.rs +++ b/wgpu-hal/src/metal/device.rs @@ -325,7 +325,7 @@ impl crate::Device for super::Device { &self, desc: &crate::TextureDescriptor, ) -> DeviceResult { - use foreign_types::ForeignTypeRef; + use metal::foreign_types::ForeignType as _; let mtl_format = self.shared.private_caps.map_format(desc.format); diff --git a/wgpu-hal/src/metal/mod.rs b/wgpu-hal/src/metal/mod.rs index b77685bd94..6611f29548 100644 --- a/wgpu-hal/src/metal/mod.rs +++ b/wgpu-hal/src/metal/mod.rs @@ -13,6 +13,11 @@ end of the VS buffer table. !*/ +// `MTLFeatureSet` is superseded by `MTLGpuFamily`. +// However, `MTLGpuFamily` is only supported starting MacOS 10.15, whereas our minimum target is MacOS 10.13, +// See https://github.com/gpuweb/gpuweb/issues/1069 for minimum spec. +// TODO: Eventually all deprecated features should be abstracted and use new api when available. +#[allow(deprecated)] mod adapter; mod command; mod conv; @@ -28,7 +33,7 @@ use std::{ }; use arrayvec::ArrayVec; -use foreign_types::ForeignTypeRef as _; +use metal::foreign_types::ForeignTypeRef as _; use parking_lot::Mutex; #[derive(Clone)]