From 4b06c5d7a27c6ab8655b9b28066ff4ef72ff2e0c Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 12 Jan 2025 09:49:47 +0100 Subject: [PATCH] Add missing MTLRasterizationRateLayerDescriptor methods `sampleCount` was skipped because it was defined twice, so let's define it manually instead. `setSampleCount:` was accidentally skipped too. --- .../objc2/src/topics/about_generated/CHANGELOG.md | 2 ++ framework-crates/objc2-metal/src/lib.rs | 2 ++ .../objc2-metal/src/rasterization_rate.rs | 13 +++++++++++++ .../objc2-metal/translation-config.toml | 1 - generated | 2 +- 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 framework-crates/objc2-metal/src/rasterization_rate.rs diff --git a/crates/objc2/src/topics/about_generated/CHANGELOG.md b/crates/objc2/src/topics/about_generated/CHANGELOG.md index 8acf8838e..98ceb7b3c 100644 --- a/crates/objc2/src/topics/about_generated/CHANGELOG.md +++ b/crates/objc2/src/topics/about_generated/CHANGELOG.md @@ -192,6 +192,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). `NSWindowSharingType`, `MTLFeatureSet` etc. now have correctly stripped variant names (`NSWindowSharingType::None` instead of `NSWindowSharingType::NSWindowSharingNone`). +* Added the missing mapping for the `sampleCount` property on + `MTLRasterizationRateLayerDescriptor`. ## 0.2.2 - 2024-05-21 diff --git a/framework-crates/objc2-metal/src/lib.rs b/framework-crates/objc2-metal/src/lib.rs index 6b83a3340..551915ef5 100644 --- a/framework-crates/objc2-metal/src/lib.rs +++ b/framework-crates/objc2-metal/src/lib.rs @@ -60,6 +60,8 @@ mod generated; mod packed; #[cfg(feature = "unstable-private")] mod private; +#[cfg(feature = "MTLRasterizationRate")] +mod rasterization_rate; #[cfg(feature = "MTLResource")] mod resource; mod slice; diff --git a/framework-crates/objc2-metal/src/rasterization_rate.rs b/framework-crates/objc2-metal/src/rasterization_rate.rs new file mode 100644 index 000000000..ac431383e --- /dev/null +++ b/framework-crates/objc2-metal/src/rasterization_rate.rs @@ -0,0 +1,13 @@ +use crate::MTLRasterizationRateLayerDescriptor; +use objc2::extern_methods; + +extern_methods!( + unsafe impl MTLRasterizationRateLayerDescriptor { + /// The number of quality samples that this descriptor uses to + /// describe its current function, for the horizontal and vertical + /// axis. The depth component of the returned `MTLSize` is always 0. + #[cfg(feature = "MTLTypes")] + #[method(sampleCount)] + pub fn sampleCount(&self) -> crate::MTLSize; + } +); diff --git a/framework-crates/objc2-metal/translation-config.toml b/framework-crates/objc2-metal/translation-config.toml index 9176db0d7..d75dc1916 100644 --- a/framework-crates/objc2-metal/translation-config.toml +++ b/framework-crates/objc2-metal/translation-config.toml @@ -24,7 +24,6 @@ protocol.MTLDevice.methods."newRenderPipelineStateWithMeshDescriptor:options:ref # Duplicated property class.MTLRasterizationRateLayerDescriptor.methods.sampleCount.skipped = true -class.MTLRasterizationRateLayerDescriptor.methods."setSampleCount:".skipped = true # Needs dispatch class.MTLSharedEventListener.methods."initWithDispatchQueue:".skipped = true diff --git a/generated b/generated index 32dd1f588..feeda83b2 160000 --- a/generated +++ b/generated @@ -1 +1 @@ -Subproject commit 32dd1f5883ad3f1a9f843d7f426b33486344f174 +Subproject commit feeda83b2f1bd303b7ad3420d3c5986272fca7e4