objc2_metal/rasterization_rate.rs
1use crate::{MTLRasterizationRateLayerDescriptor, MTLRasterizationRateMapDescriptor};
2use objc2::extern_methods;
3
4impl MTLRasterizationRateLayerDescriptor {
5 extern_methods!(
6 /// The number of quality samples that this descriptor uses to
7 /// describe its current function, for the horizontal and vertical
8 /// axis. The depth component of the returned `MTLSize` is always 0.
9 #[cfg(feature = "MTLTypes")]
10 #[unsafe(method(sampleCount))]
11 pub fn sampleCount(&self) -> crate::MTLSize;
12 );
13}
14
15impl MTLRasterizationRateMapDescriptor {
16 extern_methods!(
17 #[cfg(feature = "MTLTypes")]
18 /// Convenience descriptor creation function for an arbitrary amount of layers stored in a C-array.
19 ///
20 /// Parameter `screenSize`: The dimensions, in screen space pixels, of the region where variable rasterization is applied. The depth component of MTLSize is ignored.
21 ///
22 /// Parameter `layerCount`: The number of layers in the descriptor.
23 ///
24 /// Parameter `layers`: An array of pointers to layer descriptors. The array must contain layerCount non-null pointers to MTLRasterizationRateLayerDescriptor instances.
25 ///
26 /// Returns: A descriptor containing all the specified layers. Add or remove layers using setObject:atIndexedSubscript:.
27 ///
28 /// The function copies the array of pointers internally, the caller need not keep the array alive after creating the descriptor.
29 #[unsafe(method(rasterizationRateMapDescriptorWithScreenSize:layerCount:layers:))]
30 pub unsafe fn rasterizationRateMapDescriptorWithScreenSize_layerCount_layers(
31 screen_size: crate::MTLSize,
32 layer_count: objc2_foundation::NSUInteger,
33 layers: core::ptr::NonNull<core::ptr::NonNull<MTLRasterizationRateLayerDescriptor>>,
34 ) -> objc2::rc::Retained<MTLRasterizationRateMapDescriptor>;
35 );
36}