objc2_metal/generated/
MTL4LinkingDescriptor.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 to drive a static linking process.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4staticlinkingdescriptor?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct MTL4StaticLinkingDescriptor;
17);
18
19extern_conformance!(
20    unsafe impl NSCopying for MTL4StaticLinkingDescriptor {}
21);
22
23unsafe impl CopyingHelper for MTL4StaticLinkingDescriptor {
24    type Result = Self;
25}
26
27extern_conformance!(
28    unsafe impl NSObjectProtocol for MTL4StaticLinkingDescriptor {}
29);
30
31impl MTL4StaticLinkingDescriptor {
32    extern_methods!(
33        #[cfg(feature = "MTL4FunctionDescriptor")]
34        /// Provides an array of functions to link at the Metal IR level.
35        #[unsafe(method(functionDescriptors))]
36        #[unsafe(method_family = none)]
37        pub fn functionDescriptors(&self) -> Option<Retained<NSArray<MTL4FunctionDescriptor>>>;
38
39        #[cfg(feature = "MTL4FunctionDescriptor")]
40        /// Setter for [`functionDescriptors`][Self::functionDescriptors].
41        ///
42        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
43        #[unsafe(method(setFunctionDescriptors:))]
44        #[unsafe(method_family = none)]
45        pub fn setFunctionDescriptors(
46            &self,
47            function_descriptors: Option<&NSArray<MTL4FunctionDescriptor>>,
48        );
49
50        #[cfg(feature = "MTL4FunctionDescriptor")]
51        /// Provides an array of private functions to link at the Metal IR level.
52        ///
53        /// You specify private functions to link separately from ``functionDescriptors`` because pipelines don't export private functions as ``MTLFunctionHandle`` instances.
54        /// - Note: You can link private functions even when your ``MTLDevice`` doesn't support function pointers.
55        #[unsafe(method(privateFunctionDescriptors))]
56        #[unsafe(method_family = none)]
57        pub fn privateFunctionDescriptors(
58            &self,
59        ) -> Option<Retained<NSArray<MTL4FunctionDescriptor>>>;
60
61        #[cfg(feature = "MTL4FunctionDescriptor")]
62        /// Setter for [`privateFunctionDescriptors`][Self::privateFunctionDescriptors].
63        ///
64        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
65        #[unsafe(method(setPrivateFunctionDescriptors:))]
66        #[unsafe(method_family = none)]
67        pub fn setPrivateFunctionDescriptors(
68            &self,
69            private_function_descriptors: Option<&NSArray<MTL4FunctionDescriptor>>,
70        );
71
72        #[cfg(feature = "MTL4FunctionDescriptor")]
73        /// Assigns groups of functions to match call-site attributes in shader code.
74        ///
75        /// Function groups help the compiler reduce the number of candidate functions it needs to evaluate for shader function calls, potentially increasing runtime performance.
76        #[unsafe(method(groups))]
77        #[unsafe(method_family = none)]
78        pub fn groups(
79            &self,
80        ) -> Option<Retained<NSDictionary<NSString, NSArray<MTL4FunctionDescriptor>>>>;
81
82        #[cfg(feature = "MTL4FunctionDescriptor")]
83        /// Setter for [`groups`][Self::groups].
84        ///
85        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
86        #[unsafe(method(setGroups:))]
87        #[unsafe(method_family = none)]
88        pub fn setGroups(
89            &self,
90            groups: Option<&NSDictionary<NSString, NSArray<MTL4FunctionDescriptor>>>,
91        );
92    );
93}
94
95/// Methods declared on superclass `NSObject`.
96impl MTL4StaticLinkingDescriptor {
97    extern_methods!(
98        #[unsafe(method(init))]
99        #[unsafe(method_family = init)]
100        pub fn init(this: Allocated<Self>) -> Retained<Self>;
101
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub fn new() -> Retained<Self>;
105    );
106}
107
108impl DefaultRetained for MTL4StaticLinkingDescriptor {
109    #[inline]
110    fn default_retained() -> Retained<Self> {
111        Self::new()
112    }
113}
114
115extern_class!(
116    /// Groups together properties to drive the dynamic linking process of a pipeline stage.
117    ///
118    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4pipelinestagedynamiclinkingdescriptor?language=objc)
119    #[unsafe(super(NSObject))]
120    #[derive(Debug, PartialEq, Eq, Hash)]
121    pub struct MTL4PipelineStageDynamicLinkingDescriptor;
122);
123
124extern_conformance!(
125    unsafe impl NSCopying for MTL4PipelineStageDynamicLinkingDescriptor {}
126);
127
128unsafe impl CopyingHelper for MTL4PipelineStageDynamicLinkingDescriptor {
129    type Result = Self;
130}
131
132extern_conformance!(
133    unsafe impl NSObjectProtocol for MTL4PipelineStageDynamicLinkingDescriptor {}
134);
135
136impl MTL4PipelineStageDynamicLinkingDescriptor {
137    extern_methods!(
138        /// Limits the maximum depth of the call stack for indirect function calls in the pipeline stage function.
139        #[unsafe(method(maxCallStackDepth))]
140        #[unsafe(method_family = none)]
141        pub fn maxCallStackDepth(&self) -> NSUInteger;
142
143        /// Setter for [`maxCallStackDepth`][Self::maxCallStackDepth].
144        #[unsafe(method(setMaxCallStackDepth:))]
145        #[unsafe(method_family = none)]
146        pub fn setMaxCallStackDepth(&self, max_call_stack_depth: NSUInteger);
147
148        #[cfg(feature = "MTL4BinaryFunction")]
149        /// Provides the array of binary functions to link.
150        ///
151        /// Binary functions are shader functions that you compile from Metal IR to machine code ahead of time
152        /// using instances of ``MTL4Compiler``.
153        #[unsafe(method(binaryLinkedFunctions))]
154        #[unsafe(method_family = none)]
155        pub fn binaryLinkedFunctions(
156            &self,
157        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTL4BinaryFunction>>>>;
158
159        #[cfg(feature = "MTL4BinaryFunction")]
160        /// Setter for [`binaryLinkedFunctions`][Self::binaryLinkedFunctions].
161        ///
162        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
163        #[unsafe(method(setBinaryLinkedFunctions:))]
164        #[unsafe(method_family = none)]
165        pub fn setBinaryLinkedFunctions(
166            &self,
167            binary_linked_functions: Option<&NSArray<ProtocolObject<dyn MTL4BinaryFunction>>>,
168        );
169
170        #[cfg(feature = "MTLDynamicLibrary")]
171        /// Provides an array of dynamic libraries the compiler loads when it builds the pipeline.
172        #[unsafe(method(preloadedLibraries))]
173        #[unsafe(method_family = none)]
174        pub fn preloadedLibraries(
175            &self,
176        ) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>;
177
178        #[cfg(feature = "MTLDynamicLibrary")]
179        /// Setter for [`preloadedLibraries`][Self::preloadedLibraries].
180        ///
181        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
182        #[unsafe(method(setPreloadedLibraries:))]
183        #[unsafe(method_family = none)]
184        pub fn setPreloadedLibraries(
185            &self,
186            preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>,
187        );
188    );
189}
190
191/// Methods declared on superclass `NSObject`.
192impl MTL4PipelineStageDynamicLinkingDescriptor {
193    extern_methods!(
194        #[unsafe(method(init))]
195        #[unsafe(method_family = init)]
196        pub fn init(this: Allocated<Self>) -> Retained<Self>;
197
198        #[unsafe(method(new))]
199        #[unsafe(method_family = new)]
200        pub fn new() -> Retained<Self>;
201    );
202}
203
204impl DefaultRetained for MTL4PipelineStageDynamicLinkingDescriptor {
205    #[inline]
206    fn default_retained() -> Retained<Self> {
207        Self::new()
208    }
209}
210
211extern_class!(
212    /// Groups together properties that provide linking properties for render pipelines.
213    ///
214    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4renderpipelinedynamiclinkingdescriptor?language=objc)
215    #[unsafe(super(NSObject))]
216    #[derive(Debug, PartialEq, Eq, Hash)]
217    pub struct MTL4RenderPipelineDynamicLinkingDescriptor;
218);
219
220extern_conformance!(
221    unsafe impl NSCopying for MTL4RenderPipelineDynamicLinkingDescriptor {}
222);
223
224unsafe impl CopyingHelper for MTL4RenderPipelineDynamicLinkingDescriptor {
225    type Result = Self;
226}
227
228extern_conformance!(
229    unsafe impl NSObjectProtocol for MTL4RenderPipelineDynamicLinkingDescriptor {}
230);
231
232impl MTL4RenderPipelineDynamicLinkingDescriptor {
233    extern_methods!(
234        /// Controls properties for linking the vertex stage of the render pipeline.
235        #[unsafe(method(vertexLinkingDescriptor))]
236        #[unsafe(method_family = none)]
237        pub fn vertexLinkingDescriptor(
238            &self,
239        ) -> Retained<MTL4PipelineStageDynamicLinkingDescriptor>;
240
241        /// Controls properties for linking the fragment stage of the render pipeline.
242        #[unsafe(method(fragmentLinkingDescriptor))]
243        #[unsafe(method_family = none)]
244        pub fn fragmentLinkingDescriptor(
245            &self,
246        ) -> Retained<MTL4PipelineStageDynamicLinkingDescriptor>;
247
248        /// Controls properties for linking the tile stage of the render pipeline.
249        #[unsafe(method(tileLinkingDescriptor))]
250        #[unsafe(method_family = none)]
251        pub fn tileLinkingDescriptor(&self) -> Retained<MTL4PipelineStageDynamicLinkingDescriptor>;
252
253        /// Controls properties for link the object stage of the render pipeline.
254        #[unsafe(method(objectLinkingDescriptor))]
255        #[unsafe(method_family = none)]
256        pub fn objectLinkingDescriptor(
257            &self,
258        ) -> Retained<MTL4PipelineStageDynamicLinkingDescriptor>;
259
260        /// Controls properties for linking the mesh stage of the render pipeline.
261        #[unsafe(method(meshLinkingDescriptor))]
262        #[unsafe(method_family = none)]
263        pub fn meshLinkingDescriptor(&self) -> Retained<MTL4PipelineStageDynamicLinkingDescriptor>;
264    );
265}
266
267/// Methods declared on superclass `NSObject`.
268impl MTL4RenderPipelineDynamicLinkingDescriptor {
269    extern_methods!(
270        #[unsafe(method(init))]
271        #[unsafe(method_family = init)]
272        pub fn init(this: Allocated<Self>) -> Retained<Self>;
273
274        #[unsafe(method(new))]
275        #[unsafe(method_family = new)]
276        pub fn new() -> Retained<Self>;
277    );
278}
279
280impl DefaultRetained for MTL4RenderPipelineDynamicLinkingDescriptor {
281    #[inline]
282    fn default_retained() -> Retained<Self> {
283        Self::new()
284    }
285}