objc2_metal/generated/
MTL4TileRenderPipeline.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// Groups together properties you use to create a tile render pipeline state object.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4tilerenderpipelinedescriptor?language=objc)
14    #[unsafe(super(MTL4PipelineDescriptor, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "MTL4PipelineState")]
17    pub struct MTL4TileRenderPipelineDescriptor;
18);
19
20#[cfg(feature = "MTL4PipelineState")]
21extern_conformance!(
22    unsafe impl NSCopying for MTL4TileRenderPipelineDescriptor {}
23);
24
25#[cfg(feature = "MTL4PipelineState")]
26unsafe impl CopyingHelper for MTL4TileRenderPipelineDescriptor {
27    type Result = Self;
28}
29
30#[cfg(feature = "MTL4PipelineState")]
31extern_conformance!(
32    unsafe impl NSObjectProtocol for MTL4TileRenderPipelineDescriptor {}
33);
34
35#[cfg(feature = "MTL4PipelineState")]
36impl MTL4TileRenderPipelineDescriptor {
37    extern_methods!(
38        #[cfg(feature = "MTL4FunctionDescriptor")]
39        /// Configures the tile function that the render pipeline executes for each tile in the tile shader stage.
40        #[unsafe(method(tileFunctionDescriptor))]
41        #[unsafe(method_family = none)]
42        pub fn tileFunctionDescriptor(&self) -> Option<Retained<MTL4FunctionDescriptor>>;
43
44        #[cfg(feature = "MTL4FunctionDescriptor")]
45        /// Setter for [`tileFunctionDescriptor`][Self::tileFunctionDescriptor].
46        ///
47        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
48        #[unsafe(method(setTileFunctionDescriptor:))]
49        #[unsafe(method_family = none)]
50        pub fn setTileFunctionDescriptor(
51            &self,
52            tile_function_descriptor: Option<&MTL4FunctionDescriptor>,
53        );
54
55        /// Configures the number of samples per pixel used for multisampling.
56        #[unsafe(method(rasterSampleCount))]
57        #[unsafe(method_family = none)]
58        pub fn rasterSampleCount(&self) -> NSUInteger;
59
60        /// Setter for [`rasterSampleCount`][Self::rasterSampleCount].
61        ///
62        /// # Safety
63        ///
64        /// This might not be bounds-checked.
65        #[unsafe(method(setRasterSampleCount:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn setRasterSampleCount(&self, raster_sample_count: NSUInteger);
68
69        #[cfg(feature = "MTLRenderPipeline")]
70        /// Access an array of descriptors that configure the properties of each color attachment in the tile render
71        /// pipeline.
72        #[unsafe(method(colorAttachments))]
73        #[unsafe(method_family = none)]
74        pub fn colorAttachments(
75            &self,
76        ) -> Retained<MTLTileRenderPipelineColorAttachmentDescriptorArray>;
77
78        /// Indicating whether the size of the threadgroup matches the size of a tile in the render pipeline.
79        #[unsafe(method(threadgroupSizeMatchesTileSize))]
80        #[unsafe(method_family = none)]
81        pub fn threadgroupSizeMatchesTileSize(&self) -> bool;
82
83        /// Setter for [`threadgroupSizeMatchesTileSize`][Self::threadgroupSizeMatchesTileSize].
84        #[unsafe(method(setThreadgroupSizeMatchesTileSize:))]
85        #[unsafe(method_family = none)]
86        pub fn setThreadgroupSizeMatchesTileSize(&self, threadgroup_size_matches_tile_size: bool);
87
88        /// Sets the maximum number of threads that the GPU can execute simultaneously within a single threadgroup in
89        /// the tile render pipeline.
90        #[unsafe(method(maxTotalThreadsPerThreadgroup))]
91        #[unsafe(method_family = none)]
92        pub fn maxTotalThreadsPerThreadgroup(&self) -> NSUInteger;
93
94        /// Setter for [`maxTotalThreadsPerThreadgroup`][Self::maxTotalThreadsPerThreadgroup].
95        #[unsafe(method(setMaxTotalThreadsPerThreadgroup:))]
96        #[unsafe(method_family = none)]
97        pub fn setMaxTotalThreadsPerThreadgroup(
98            &self,
99            max_total_threads_per_threadgroup: NSUInteger,
100        );
101
102        #[cfg(feature = "MTLTypes")]
103        /// Sets the required number of threads per threadgroup for tile dispatches.
104        ///
105        /// This value is typically optional, except in the cases where the tile function that ``tileFunctionDescriptor``
106        /// references uses `CooperativeTensors`. In this case, you need to provide a non-zero value to this property.
107        ///
108        /// Additionally, when you set this value, the `threadsPerTile` argument of any tile dispatch needs to match it.
109        ///
110        /// Setting this value to a size of 0 in every dimension disables this property.
111        #[unsafe(method(requiredThreadsPerThreadgroup))]
112        #[unsafe(method_family = none)]
113        pub fn requiredThreadsPerThreadgroup(&self) -> MTLSize;
114
115        #[cfg(feature = "MTLTypes")]
116        /// Setter for [`requiredThreadsPerThreadgroup`][Self::requiredThreadsPerThreadgroup].
117        #[unsafe(method(setRequiredThreadsPerThreadgroup:))]
118        #[unsafe(method_family = none)]
119        pub fn setRequiredThreadsPerThreadgroup(&self, required_threads_per_threadgroup: MTLSize);
120
121        #[cfg(feature = "MTL4LinkingDescriptor")]
122        /// Configures an object that contains information about functions to link to the tile render pipeline
123        /// when Metal builds it.
124        #[unsafe(method(staticLinkingDescriptor))]
125        #[unsafe(method_family = none)]
126        pub fn staticLinkingDescriptor(&self) -> Retained<MTL4StaticLinkingDescriptor>;
127
128        #[cfg(feature = "MTL4LinkingDescriptor")]
129        /// Setter for [`staticLinkingDescriptor`][Self::staticLinkingDescriptor].
130        ///
131        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
132        #[unsafe(method(setStaticLinkingDescriptor:))]
133        #[unsafe(method_family = none)]
134        pub fn setStaticLinkingDescriptor(
135            &self,
136            static_linking_descriptor: Option<&MTL4StaticLinkingDescriptor>,
137        );
138
139        /// Indicates whether the pipeline supports linking binary functions.
140        #[unsafe(method(supportBinaryLinking))]
141        #[unsafe(method_family = none)]
142        pub fn supportBinaryLinking(&self) -> bool;
143
144        /// Setter for [`supportBinaryLinking`][Self::supportBinaryLinking].
145        #[unsafe(method(setSupportBinaryLinking:))]
146        #[unsafe(method_family = none)]
147        pub fn setSupportBinaryLinking(&self, support_binary_linking: bool);
148
149        /// Resets the descriptor to the default state.
150        #[unsafe(method(reset))]
151        #[unsafe(method_family = none)]
152        pub fn reset(&self);
153    );
154}
155
156/// Methods declared on superclass `NSObject`.
157#[cfg(feature = "MTL4PipelineState")]
158impl MTL4TileRenderPipelineDescriptor {
159    extern_methods!(
160        #[unsafe(method(init))]
161        #[unsafe(method_family = init)]
162        pub fn init(this: Allocated<Self>) -> Retained<Self>;
163
164        #[unsafe(method(new))]
165        #[unsafe(method_family = new)]
166        pub fn new() -> Retained<Self>;
167    );
168}
169
170#[cfg(feature = "MTL4PipelineState")]
171impl DefaultRetained for MTL4TileRenderPipelineDescriptor {
172    #[inline]
173    fn default_retained() -> Retained<Self> {
174        Self::new()
175    }
176}