From c4e97979218407906adfc3681e706d55a7ff76bb Mon Sep 17 00:00:00 2001 From: Jinlei Li Date: Tue, 1 Mar 2022 14:40:44 +0800 Subject: [PATCH] metal: roll metal-rs, fix read_write_texture_tier --- Cargo.lock | 2 +- wgpu-hal/Cargo.toml | 2 +- wgpu-hal/src/metal/adapter.rs | 6 ++++++ wgpu-hal/src/metal/device.rs | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3dfed1e113..745c4d5d15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -996,7 +996,7 @@ dependencies = [ [[package]] name = "metal" version = "0.23.1" -source = "git+https://github.com/gfx-rs/metal-rs?rev=44af5cc#44af5cca340617d42d701264f9bf71d1f3e68096" +source = "git+https://github.com/gfx-rs/metal-rs?rev=a357159#a35715916fec38bbc08a510ecf7d115edc500c72" dependencies = [ "bitflags", "block", diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 80405a261c..44d3532ac4 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -77,7 +77,7 @@ winapi = { version = "0.3", features = ["libloaderapi", "windef", "winuser", "dc native = { package = "d3d12", version = "0.4.1", features = ["libloading"], optional = true } [target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies] -mtl = { package = "metal", git = "https://github.com/gfx-rs/metal-rs", rev = "44af5cc" } +mtl = { package = "metal", git = "https://github.com/gfx-rs/metal-rs", rev = "a357159" } objc = "0.2.5" core-graphics-types = "0.1" diff --git a/wgpu-hal/src/metal/adapter.rs b/wgpu-hal/src/metal/adapter.rs index 9da58bcebe..dcd8ac7725 100644 --- a/wgpu-hal/src/metal/adapter.rs +++ b/wgpu-hal/src/metal/adapter.rs @@ -660,6 +660,12 @@ impl super::PrivateCapabilities { read_write_texture_tier: if os_is_mac { if Self::version_at_least(major, minor, 10, 13) { device.read_write_texture_support() + } else if Self::version_at_least(major, minor, 10, 12) { + if Self::supports_any(device, &[MTLFeatureSet::macOS_ReadWriteTextureTier2]) { + mtl::MTLReadWriteTextureTier::Tier2 + } else { + mtl::MTLReadWriteTextureTier::Tier1 + } } else { mtl::MTLReadWriteTextureTier::TierNone } diff --git a/wgpu-hal/src/metal/device.rs b/wgpu-hal/src/metal/device.rs index e356cd0b35..b560bd0670 100644 --- a/wgpu-hal/src/metal/device.rs +++ b/wgpu-hal/src/metal/device.rs @@ -644,6 +644,7 @@ impl crate::Device for super::Device { mtl::MTLLanguageVersion::V2_1 => (2, 1), mtl::MTLLanguageVersion::V2_2 => (2, 2), mtl::MTLLanguageVersion::V2_3 => (2, 3), + mtl::MTLLanguageVersion::V2_4 => (2, 4), }, inline_samplers: Default::default(), spirv_cross_compatibility: false,