Skip to content

Commit

Permalink
metal: roll metal-rs, fix read_write_texture_tier
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili authored and kvark committed Mar 2, 2022
1 parent e672974 commit c4e9797
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 6 additions & 0 deletions wgpu-hal/src/metal/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/metal/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c4e9797

Please sign in to comment.