metal: roll metal-rs, fix read_write_texture_tier

This commit is contained in:
Jinlei Li
2022-03-01 14:40:44 +08:00
committed by Dzmitry Malyshau
parent e672974d9d
commit c4e9797921
4 changed files with 9 additions and 2 deletions

2
Cargo.lock generated
View File

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

View File

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

View File

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

View File

@@ -644,6 +644,7 @@ impl crate::Device<super::Api> 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,