Skip to content

Commit

Permalink
Add missing MTLRasterizationRateLayerDescriptor methods
Browse files Browse the repository at this point in the history
`sampleCount` was skipped because it was defined twice, so let's define
it manually instead. `setSampleCount:` was accidentally skipped too.
  • Loading branch information
madsmtm committed Jan 12, 2025
1 parent 161404a commit 4b06c5d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/objc2/src/topics/about_generated/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions framework-crates/objc2-metal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 13 additions & 0 deletions framework-crates/objc2-metal/src/rasterization_rate.rs
Original file line number Diff line number Diff line change
@@ -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;
}
);
1 change: 0 additions & 1 deletion framework-crates/objc2-metal/translation-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion generated

0 comments on commit 4b06c5d

Please sign in to comment.