objc2_metal/generated/
MTLFunctionStitching.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct MTLStitchedLibraryOptions(pub NSUInteger);
17bitflags::bitflags! {
18 impl MTLStitchedLibraryOptions: NSUInteger {
19 #[doc(alias = "MTLStitchedLibraryOptionNone")]
20 const None = 0;
21#[doc(alias = "MTLStitchedLibraryOptionFailOnBinaryArchiveMiss")]
25 const FailOnBinaryArchiveMiss = 1<<0;
26#[doc(alias = "MTLStitchedLibraryOptionStoreLibraryInMetalPipelinesScript")]
31 const StoreLibraryInMetalPipelinesScript = 1<<1;
32 }
33}
34
35unsafe impl Encode for MTLStitchedLibraryOptions {
36 const ENCODING: Encoding = NSUInteger::ENCODING;
37}
38
39unsafe impl RefEncode for MTLStitchedLibraryOptions {
40 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
41}
42
43extern_protocol!(
44 pub unsafe trait MTLFunctionStitchingAttribute: NSObjectProtocol {}
48);
49
50extern_class!(
51 #[unsafe(super(NSObject))]
55 #[derive(Debug, PartialEq, Eq, Hash)]
56 pub struct MTLFunctionStitchingAttributeAlwaysInline;
57);
58
59extern_conformance!(
60 unsafe impl MTLFunctionStitchingAttribute for MTLFunctionStitchingAttributeAlwaysInline {}
61);
62
63extern_conformance!(
64 unsafe impl NSObjectProtocol for MTLFunctionStitchingAttributeAlwaysInline {}
65);
66
67impl MTLFunctionStitchingAttributeAlwaysInline {
68 extern_methods!();
69}
70
71impl MTLFunctionStitchingAttributeAlwaysInline {
73 extern_methods!(
74 #[unsafe(method(init))]
75 #[unsafe(method_family = init)]
76 pub fn init(this: Allocated<Self>) -> Retained<Self>;
77
78 #[unsafe(method(new))]
79 #[unsafe(method_family = new)]
80 pub fn new() -> Retained<Self>;
81 );
82}
83
84impl DefaultRetained for MTLFunctionStitchingAttributeAlwaysInline {
85 #[inline]
86 fn default_retained() -> Retained<Self> {
87 Self::new()
88 }
89}
90
91extern_protocol!(
92 pub unsafe trait MTLFunctionStitchingNode: NSObjectProtocol + NSCopying {}
96);
97
98extern_class!(
99 #[unsafe(super(NSObject))]
103 #[derive(Debug, PartialEq, Eq, Hash)]
104 pub struct MTLFunctionStitchingInputNode;
105);
106
107extern_conformance!(
108 unsafe impl MTLFunctionStitchingNode for MTLFunctionStitchingInputNode {}
109);
110
111extern_conformance!(
112 unsafe impl NSCopying for MTLFunctionStitchingInputNode {}
113);
114
115unsafe impl CopyingHelper for MTLFunctionStitchingInputNode {
116 type Result = Self;
117}
118
119extern_conformance!(
120 unsafe impl NSObjectProtocol for MTLFunctionStitchingInputNode {}
121);
122
123impl MTLFunctionStitchingInputNode {
124 extern_methods!(
125 #[unsafe(method(argumentIndex))]
126 #[unsafe(method_family = none)]
127 pub fn argumentIndex(&self) -> NSUInteger;
128
129 #[unsafe(method(setArgumentIndex:))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn setArgumentIndex(&self, argument_index: NSUInteger);
137
138 #[unsafe(method(initWithArgumentIndex:))]
142 #[unsafe(method_family = init)]
143 pub unsafe fn initWithArgumentIndex(
144 this: Allocated<Self>,
145 argument: NSUInteger,
146 ) -> Retained<Self>;
147 );
148}
149
150impl MTLFunctionStitchingInputNode {
152 extern_methods!(
153 #[unsafe(method(init))]
154 #[unsafe(method_family = init)]
155 pub fn init(this: Allocated<Self>) -> Retained<Self>;
156
157 #[unsafe(method(new))]
158 #[unsafe(method_family = new)]
159 pub fn new() -> Retained<Self>;
160 );
161}
162
163impl DefaultRetained for MTLFunctionStitchingInputNode {
164 #[inline]
165 fn default_retained() -> Retained<Self> {
166 Self::new()
167 }
168}
169
170extern_class!(
171 #[unsafe(super(NSObject))]
175 #[derive(Debug, PartialEq, Eq, Hash)]
176 pub struct MTLFunctionStitchingFunctionNode;
177);
178
179extern_conformance!(
180 unsafe impl MTLFunctionStitchingNode for MTLFunctionStitchingFunctionNode {}
181);
182
183extern_conformance!(
184 unsafe impl NSCopying for MTLFunctionStitchingFunctionNode {}
185);
186
187unsafe impl CopyingHelper for MTLFunctionStitchingFunctionNode {
188 type Result = Self;
189}
190
191extern_conformance!(
192 unsafe impl NSObjectProtocol for MTLFunctionStitchingFunctionNode {}
193);
194
195impl MTLFunctionStitchingFunctionNode {
196 extern_methods!(
197 #[unsafe(method(name))]
198 #[unsafe(method_family = none)]
199 pub fn name(&self) -> Retained<NSString>;
200
201 #[unsafe(method(setName:))]
205 #[unsafe(method_family = none)]
206 pub fn setName(&self, name: &NSString);
207
208 #[unsafe(method(arguments))]
209 #[unsafe(method_family = none)]
210 pub fn arguments(&self) -> Retained<NSArray<ProtocolObject<dyn MTLFunctionStitchingNode>>>;
211
212 #[unsafe(method(setArguments:))]
216 #[unsafe(method_family = none)]
217 pub fn setArguments(
218 &self,
219 arguments: &NSArray<ProtocolObject<dyn MTLFunctionStitchingNode>>,
220 );
221
222 #[unsafe(method(controlDependencies))]
223 #[unsafe(method_family = none)]
224 pub fn controlDependencies(&self) -> Retained<NSArray<MTLFunctionStitchingFunctionNode>>;
225
226 #[unsafe(method(setControlDependencies:))]
230 #[unsafe(method_family = none)]
231 pub fn setControlDependencies(
232 &self,
233 control_dependencies: &NSArray<MTLFunctionStitchingFunctionNode>,
234 );
235
236 #[unsafe(method(initWithName:arguments:controlDependencies:))]
237 #[unsafe(method_family = init)]
238 pub fn initWithName_arguments_controlDependencies(
239 this: Allocated<Self>,
240 name: &NSString,
241 arguments: &NSArray<ProtocolObject<dyn MTLFunctionStitchingNode>>,
242 control_dependencies: &NSArray<MTLFunctionStitchingFunctionNode>,
243 ) -> Retained<Self>;
244 );
245}
246
247impl MTLFunctionStitchingFunctionNode {
249 extern_methods!(
250 #[unsafe(method(init))]
251 #[unsafe(method_family = init)]
252 pub fn init(this: Allocated<Self>) -> Retained<Self>;
253
254 #[unsafe(method(new))]
255 #[unsafe(method_family = new)]
256 pub fn new() -> Retained<Self>;
257 );
258}
259
260impl DefaultRetained for MTLFunctionStitchingFunctionNode {
261 #[inline]
262 fn default_retained() -> Retained<Self> {
263 Self::new()
264 }
265}
266
267extern_class!(
268 #[unsafe(super(NSObject))]
274 #[derive(Debug, PartialEq, Eq, Hash)]
275 pub struct MTLFunctionStitchingGraph;
276);
277
278extern_conformance!(
279 unsafe impl NSCopying for MTLFunctionStitchingGraph {}
280);
281
282unsafe impl CopyingHelper for MTLFunctionStitchingGraph {
283 type Result = Self;
284}
285
286extern_conformance!(
287 unsafe impl NSObjectProtocol for MTLFunctionStitchingGraph {}
288);
289
290impl MTLFunctionStitchingGraph {
291 extern_methods!(
292 #[unsafe(method(functionName))]
293 #[unsafe(method_family = none)]
294 pub fn functionName(&self) -> Retained<NSString>;
295
296 #[unsafe(method(setFunctionName:))]
300 #[unsafe(method_family = none)]
301 pub fn setFunctionName(&self, function_name: &NSString);
302
303 #[unsafe(method(nodes))]
304 #[unsafe(method_family = none)]
305 pub fn nodes(&self) -> Retained<NSArray<MTLFunctionStitchingFunctionNode>>;
306
307 #[unsafe(method(setNodes:))]
311 #[unsafe(method_family = none)]
312 pub fn setNodes(&self, nodes: &NSArray<MTLFunctionStitchingFunctionNode>);
313
314 #[unsafe(method(outputNode))]
315 #[unsafe(method_family = none)]
316 pub fn outputNode(&self) -> Option<Retained<MTLFunctionStitchingFunctionNode>>;
317
318 #[unsafe(method(setOutputNode:))]
320 #[unsafe(method_family = none)]
321 pub fn setOutputNode(&self, output_node: Option<&MTLFunctionStitchingFunctionNode>);
322
323 #[unsafe(method(attributes))]
324 #[unsafe(method_family = none)]
325 pub fn attributes(
326 &self,
327 ) -> Retained<NSArray<ProtocolObject<dyn MTLFunctionStitchingAttribute>>>;
328
329 #[unsafe(method(setAttributes:))]
333 #[unsafe(method_family = none)]
334 pub fn setAttributes(
335 &self,
336 attributes: &NSArray<ProtocolObject<dyn MTLFunctionStitchingAttribute>>,
337 );
338
339 #[unsafe(method(initWithFunctionName:nodes:outputNode:attributes:))]
340 #[unsafe(method_family = init)]
341 pub fn initWithFunctionName_nodes_outputNode_attributes(
342 this: Allocated<Self>,
343 function_name: &NSString,
344 nodes: &NSArray<MTLFunctionStitchingFunctionNode>,
345 output_node: Option<&MTLFunctionStitchingFunctionNode>,
346 attributes: &NSArray<ProtocolObject<dyn MTLFunctionStitchingAttribute>>,
347 ) -> Retained<Self>;
348 );
349}
350
351impl MTLFunctionStitchingGraph {
353 extern_methods!(
354 #[unsafe(method(init))]
355 #[unsafe(method_family = init)]
356 pub fn init(this: Allocated<Self>) -> Retained<Self>;
357
358 #[unsafe(method(new))]
359 #[unsafe(method_family = new)]
360 pub fn new() -> Retained<Self>;
361 );
362}
363
364impl DefaultRetained for MTLFunctionStitchingGraph {
365 #[inline]
366 fn default_retained() -> Retained<Self> {
367 Self::new()
368 }
369}
370
371extern_class!(
372 #[unsafe(super(NSObject))]
376 #[derive(Debug, PartialEq, Eq, Hash)]
377 pub struct MTLStitchedLibraryDescriptor;
378);
379
380extern_conformance!(
381 unsafe impl NSCopying for MTLStitchedLibraryDescriptor {}
382);
383
384unsafe impl CopyingHelper for MTLStitchedLibraryDescriptor {
385 type Result = Self;
386}
387
388extern_conformance!(
389 unsafe impl NSObjectProtocol for MTLStitchedLibraryDescriptor {}
390);
391
392impl MTLStitchedLibraryDescriptor {
393 extern_methods!(
394 #[unsafe(method(functionGraphs))]
395 #[unsafe(method_family = none)]
396 pub fn functionGraphs(&self) -> Retained<NSArray<MTLFunctionStitchingGraph>>;
397
398 #[unsafe(method(setFunctionGraphs:))]
402 #[unsafe(method_family = none)]
403 pub fn setFunctionGraphs(&self, function_graphs: &NSArray<MTLFunctionStitchingGraph>);
404
405 #[cfg(feature = "MTLLibrary")]
406 #[unsafe(method(functions))]
407 #[unsafe(method_family = none)]
408 pub fn functions(&self) -> Retained<NSArray<ProtocolObject<dyn MTLFunction>>>;
409
410 #[cfg(feature = "MTLLibrary")]
411 #[unsafe(method(setFunctions:))]
420 #[unsafe(method_family = none)]
421 pub unsafe fn setFunctions(&self, functions: &NSArray<ProtocolObject<dyn MTLFunction>>);
422
423 #[cfg(feature = "MTLBinaryArchive")]
424 #[unsafe(method(binaryArchives))]
428 #[unsafe(method_family = none)]
429 pub fn binaryArchives(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinaryArchive>>>;
430
431 #[cfg(feature = "MTLBinaryArchive")]
432 #[unsafe(method(setBinaryArchives:))]
436 #[unsafe(method_family = none)]
437 pub fn setBinaryArchives(
438 &self,
439 binary_archives: &NSArray<ProtocolObject<dyn MTLBinaryArchive>>,
440 );
441
442 #[unsafe(method(options))]
444 #[unsafe(method_family = none)]
445 pub fn options(&self) -> MTLStitchedLibraryOptions;
446
447 #[unsafe(method(setOptions:))]
449 #[unsafe(method_family = none)]
450 pub fn setOptions(&self, options: MTLStitchedLibraryOptions);
451 );
452}
453
454impl MTLStitchedLibraryDescriptor {
456 extern_methods!(
457 #[unsafe(method(init))]
458 #[unsafe(method_family = init)]
459 pub fn init(this: Allocated<Self>) -> Retained<Self>;
460
461 #[unsafe(method(new))]
462 #[unsafe(method_family = new)]
463 pub fn new() -> Retained<Self>;
464 );
465}
466
467impl DefaultRetained for MTLStitchedLibraryDescriptor {
468 #[inline]
469 fn default_retained() -> Retained<Self> {
470 Self::new()
471 }
472}