objc2_metal/generated/
MTL4RenderPipeline.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 MTL4LogicalToPhysicalColorAttachmentMappingState(pub NSInteger);
17impl MTL4LogicalToPhysicalColorAttachmentMappingState {
18 #[doc(alias = "MTL4LogicalToPhysicalColorAttachmentMappingStateIdentity")]
22 pub const Identity: Self = Self(0);
23 #[doc(alias = "MTL4LogicalToPhysicalColorAttachmentMappingStateInherited")]
28 pub const Inherited: Self = Self(1);
29}
30
31unsafe impl Encode for MTL4LogicalToPhysicalColorAttachmentMappingState {
32 const ENCODING: Encoding = NSInteger::ENCODING;
33}
34
35unsafe impl RefEncode for MTL4LogicalToPhysicalColorAttachmentMappingState {
36 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39extern_class!(
40 #[unsafe(super(NSObject))]
42 #[derive(Debug, PartialEq, Eq, Hash)]
43 pub struct MTL4RenderPipelineColorAttachmentDescriptor;
44);
45
46extern_conformance!(
47 unsafe impl NSCopying for MTL4RenderPipelineColorAttachmentDescriptor {}
48);
49
50unsafe impl CopyingHelper for MTL4RenderPipelineColorAttachmentDescriptor {
51 type Result = Self;
52}
53
54extern_conformance!(
55 unsafe impl NSObjectProtocol for MTL4RenderPipelineColorAttachmentDescriptor {}
56);
57
58impl MTL4RenderPipelineColorAttachmentDescriptor {
59 extern_methods!(
60 #[cfg(feature = "MTLPixelFormat")]
61 #[unsafe(method(pixelFormat))]
65 #[unsafe(method_family = none)]
66 pub fn pixelFormat(&self) -> MTLPixelFormat;
67
68 #[cfg(feature = "MTLPixelFormat")]
69 #[unsafe(method(setPixelFormat:))]
71 #[unsafe(method_family = none)]
72 pub fn setPixelFormat(&self, pixel_format: MTLPixelFormat);
73
74 #[cfg(feature = "MTL4PipelineState")]
75 #[unsafe(method(blendingState))]
79 #[unsafe(method_family = none)]
80 pub fn blendingState(&self) -> MTL4BlendState;
81
82 #[cfg(feature = "MTL4PipelineState")]
83 #[unsafe(method(setBlendingState:))]
85 #[unsafe(method_family = none)]
86 pub fn setBlendingState(&self, blending_state: MTL4BlendState);
87
88 #[cfg(feature = "MTLRenderPipeline")]
89 #[unsafe(method(sourceRGBBlendFactor))]
93 #[unsafe(method_family = none)]
94 pub fn sourceRGBBlendFactor(&self) -> MTLBlendFactor;
95
96 #[cfg(feature = "MTLRenderPipeline")]
97 #[unsafe(method(setSourceRGBBlendFactor:))]
99 #[unsafe(method_family = none)]
100 pub fn setSourceRGBBlendFactor(&self, source_rgb_blend_factor: MTLBlendFactor);
101
102 #[cfg(feature = "MTLRenderPipeline")]
103 #[unsafe(method(destinationRGBBlendFactor))]
107 #[unsafe(method_family = none)]
108 pub fn destinationRGBBlendFactor(&self) -> MTLBlendFactor;
109
110 #[cfg(feature = "MTLRenderPipeline")]
111 #[unsafe(method(setDestinationRGBBlendFactor:))]
113 #[unsafe(method_family = none)]
114 pub fn setDestinationRGBBlendFactor(&self, destination_rgb_blend_factor: MTLBlendFactor);
115
116 #[cfg(feature = "MTLRenderPipeline")]
117 #[unsafe(method(rgbBlendOperation))]
121 #[unsafe(method_family = none)]
122 pub fn rgbBlendOperation(&self) -> MTLBlendOperation;
123
124 #[cfg(feature = "MTLRenderPipeline")]
125 #[unsafe(method(setRgbBlendOperation:))]
127 #[unsafe(method_family = none)]
128 pub fn setRgbBlendOperation(&self, rgb_blend_operation: MTLBlendOperation);
129
130 #[cfg(feature = "MTLRenderPipeline")]
131 #[unsafe(method(sourceAlphaBlendFactor))]
135 #[unsafe(method_family = none)]
136 pub fn sourceAlphaBlendFactor(&self) -> MTLBlendFactor;
137
138 #[cfg(feature = "MTLRenderPipeline")]
139 #[unsafe(method(setSourceAlphaBlendFactor:))]
141 #[unsafe(method_family = none)]
142 pub fn setSourceAlphaBlendFactor(&self, source_alpha_blend_factor: MTLBlendFactor);
143
144 #[cfg(feature = "MTLRenderPipeline")]
145 #[unsafe(method(destinationAlphaBlendFactor))]
149 #[unsafe(method_family = none)]
150 pub fn destinationAlphaBlendFactor(&self) -> MTLBlendFactor;
151
152 #[cfg(feature = "MTLRenderPipeline")]
153 #[unsafe(method(setDestinationAlphaBlendFactor:))]
155 #[unsafe(method_family = none)]
156 pub fn setDestinationAlphaBlendFactor(
157 &self,
158 destination_alpha_blend_factor: MTLBlendFactor,
159 );
160
161 #[cfg(feature = "MTLRenderPipeline")]
162 #[unsafe(method(alphaBlendOperation))]
166 #[unsafe(method_family = none)]
167 pub fn alphaBlendOperation(&self) -> MTLBlendOperation;
168
169 #[cfg(feature = "MTLRenderPipeline")]
170 #[unsafe(method(setAlphaBlendOperation:))]
172 #[unsafe(method_family = none)]
173 pub fn setAlphaBlendOperation(&self, alpha_blend_operation: MTLBlendOperation);
174
175 #[cfg(feature = "MTLRenderPipeline")]
176 #[unsafe(method(writeMask))]
180 #[unsafe(method_family = none)]
181 pub fn writeMask(&self) -> MTLColorWriteMask;
182
183 #[cfg(feature = "MTLRenderPipeline")]
184 #[unsafe(method(setWriteMask:))]
186 #[unsafe(method_family = none)]
187 pub fn setWriteMask(&self, write_mask: MTLColorWriteMask);
188
189 #[unsafe(method(reset))]
191 #[unsafe(method_family = none)]
192 pub fn reset(&self);
193 );
194}
195
196impl MTL4RenderPipelineColorAttachmentDescriptor {
198 extern_methods!(
199 #[unsafe(method(init))]
200 #[unsafe(method_family = init)]
201 pub fn init(this: Allocated<Self>) -> Retained<Self>;
202
203 #[unsafe(method(new))]
204 #[unsafe(method_family = new)]
205 pub fn new() -> Retained<Self>;
206 );
207}
208
209impl DefaultRetained for MTL4RenderPipelineColorAttachmentDescriptor {
210 #[inline]
211 fn default_retained() -> Retained<Self> {
212 Self::new()
213 }
214}
215
216extern_class!(
217 #[unsafe(super(NSObject))]
221 #[derive(Debug, PartialEq, Eq, Hash)]
222 pub struct MTL4RenderPipelineColorAttachmentDescriptorArray;
223);
224
225extern_conformance!(
226 unsafe impl NSCopying for MTL4RenderPipelineColorAttachmentDescriptorArray {}
227);
228
229unsafe impl CopyingHelper for MTL4RenderPipelineColorAttachmentDescriptorArray {
230 type Result = Self;
231}
232
233extern_conformance!(
234 unsafe impl NSObjectProtocol for MTL4RenderPipelineColorAttachmentDescriptorArray {}
235);
236
237impl MTL4RenderPipelineColorAttachmentDescriptorArray {
238 extern_methods!(
239 #[unsafe(method(objectAtIndexedSubscript:))]
247 #[unsafe(method_family = none)]
248 pub unsafe fn objectAtIndexedSubscript(
249 &self,
250 attachment_index: NSUInteger,
251 ) -> Retained<MTL4RenderPipelineColorAttachmentDescriptor>;
252
253 #[unsafe(method(setObject:atIndexedSubscript:))]
268 #[unsafe(method_family = none)]
269 pub unsafe fn setObject_atIndexedSubscript(
270 &self,
271 attachment: Option<&MTL4RenderPipelineColorAttachmentDescriptor>,
272 attachment_index: NSUInteger,
273 );
274
275 #[unsafe(method(reset))]
277 #[unsafe(method_family = none)]
278 pub fn reset(&self);
279 );
280}
281
282impl MTL4RenderPipelineColorAttachmentDescriptorArray {
284 extern_methods!(
285 #[unsafe(method(init))]
286 #[unsafe(method_family = init)]
287 pub fn init(this: Allocated<Self>) -> Retained<Self>;
288
289 #[unsafe(method(new))]
290 #[unsafe(method_family = new)]
291 pub fn new() -> Retained<Self>;
292 );
293}
294
295impl DefaultRetained for MTL4RenderPipelineColorAttachmentDescriptorArray {
296 #[inline]
297 fn default_retained() -> Retained<Self> {
298 Self::new()
299 }
300}
301
302extern_class!(
303 #[unsafe(super(NSObject))]
307 #[derive(Debug, PartialEq, Eq, Hash)]
308 pub struct MTL4RenderPipelineBinaryFunctionsDescriptor;
309);
310
311extern_conformance!(
312 unsafe impl NSCopying for MTL4RenderPipelineBinaryFunctionsDescriptor {}
313);
314
315unsafe impl CopyingHelper for MTL4RenderPipelineBinaryFunctionsDescriptor {
316 type Result = Self;
317}
318
319extern_conformance!(
320 unsafe impl NSObjectProtocol for MTL4RenderPipelineBinaryFunctionsDescriptor {}
321);
322
323impl MTL4RenderPipelineBinaryFunctionsDescriptor {
324 extern_methods!(
325 #[cfg(feature = "MTL4BinaryFunction")]
326 #[unsafe(method(vertexAdditionalBinaryFunctions))]
328 #[unsafe(method_family = none)]
329 pub fn vertexAdditionalBinaryFunctions(
330 &self,
331 ) -> Option<Retained<NSArray<ProtocolObject<dyn MTL4BinaryFunction>>>>;
332
333 #[cfg(feature = "MTL4BinaryFunction")]
334 #[unsafe(method(setVertexAdditionalBinaryFunctions:))]
338 #[unsafe(method_family = none)]
339 pub fn setVertexAdditionalBinaryFunctions(
340 &self,
341 vertex_additional_binary_functions: Option<
342 &NSArray<ProtocolObject<dyn MTL4BinaryFunction>>,
343 >,
344 );
345
346 #[cfg(feature = "MTL4BinaryFunction")]
347 #[unsafe(method(fragmentAdditionalBinaryFunctions))]
349 #[unsafe(method_family = none)]
350 pub fn fragmentAdditionalBinaryFunctions(
351 &self,
352 ) -> Option<Retained<NSArray<ProtocolObject<dyn MTL4BinaryFunction>>>>;
353
354 #[cfg(feature = "MTL4BinaryFunction")]
355 #[unsafe(method(setFragmentAdditionalBinaryFunctions:))]
359 #[unsafe(method_family = none)]
360 pub fn setFragmentAdditionalBinaryFunctions(
361 &self,
362 fragment_additional_binary_functions: Option<
363 &NSArray<ProtocolObject<dyn MTL4BinaryFunction>>,
364 >,
365 );
366
367 #[cfg(feature = "MTL4BinaryFunction")]
368 #[unsafe(method(tileAdditionalBinaryFunctions))]
370 #[unsafe(method_family = none)]
371 pub fn tileAdditionalBinaryFunctions(
372 &self,
373 ) -> Option<Retained<NSArray<ProtocolObject<dyn MTL4BinaryFunction>>>>;
374
375 #[cfg(feature = "MTL4BinaryFunction")]
376 #[unsafe(method(setTileAdditionalBinaryFunctions:))]
380 #[unsafe(method_family = none)]
381 pub fn setTileAdditionalBinaryFunctions(
382 &self,
383 tile_additional_binary_functions: Option<
384 &NSArray<ProtocolObject<dyn MTL4BinaryFunction>>,
385 >,
386 );
387
388 #[cfg(feature = "MTL4BinaryFunction")]
389 #[unsafe(method(objectAdditionalBinaryFunctions))]
391 #[unsafe(method_family = none)]
392 pub fn objectAdditionalBinaryFunctions(
393 &self,
394 ) -> Option<Retained<NSArray<ProtocolObject<dyn MTL4BinaryFunction>>>>;
395
396 #[cfg(feature = "MTL4BinaryFunction")]
397 #[unsafe(method(setObjectAdditionalBinaryFunctions:))]
401 #[unsafe(method_family = none)]
402 pub fn setObjectAdditionalBinaryFunctions(
403 &self,
404 object_additional_binary_functions: Option<
405 &NSArray<ProtocolObject<dyn MTL4BinaryFunction>>,
406 >,
407 );
408
409 #[cfg(feature = "MTL4BinaryFunction")]
410 #[unsafe(method(meshAdditionalBinaryFunctions))]
412 #[unsafe(method_family = none)]
413 pub fn meshAdditionalBinaryFunctions(
414 &self,
415 ) -> Option<Retained<NSArray<ProtocolObject<dyn MTL4BinaryFunction>>>>;
416
417 #[cfg(feature = "MTL4BinaryFunction")]
418 #[unsafe(method(setMeshAdditionalBinaryFunctions:))]
422 #[unsafe(method_family = none)]
423 pub fn setMeshAdditionalBinaryFunctions(
424 &self,
425 mesh_additional_binary_functions: Option<
426 &NSArray<ProtocolObject<dyn MTL4BinaryFunction>>,
427 >,
428 );
429
430 #[unsafe(method(reset))]
432 #[unsafe(method_family = none)]
433 pub fn reset(&self);
434 );
435}
436
437impl MTL4RenderPipelineBinaryFunctionsDescriptor {
439 extern_methods!(
440 #[unsafe(method(init))]
441 #[unsafe(method_family = init)]
442 pub fn init(this: Allocated<Self>) -> Retained<Self>;
443
444 #[unsafe(method(new))]
445 #[unsafe(method_family = new)]
446 pub fn new() -> Retained<Self>;
447 );
448}
449
450impl DefaultRetained for MTL4RenderPipelineBinaryFunctionsDescriptor {
451 #[inline]
452 fn default_retained() -> Retained<Self> {
453 Self::new()
454 }
455}
456
457extern_class!(
458 #[unsafe(super(MTL4PipelineDescriptor, NSObject))]
465 #[derive(Debug, PartialEq, Eq, Hash)]
466 #[cfg(feature = "MTL4PipelineState")]
467 pub struct MTL4RenderPipelineDescriptor;
468);
469
470#[cfg(feature = "MTL4PipelineState")]
471extern_conformance!(
472 unsafe impl NSCopying for MTL4RenderPipelineDescriptor {}
473);
474
475#[cfg(feature = "MTL4PipelineState")]
476unsafe impl CopyingHelper for MTL4RenderPipelineDescriptor {
477 type Result = Self;
478}
479
480#[cfg(feature = "MTL4PipelineState")]
481extern_conformance!(
482 unsafe impl NSObjectProtocol for MTL4RenderPipelineDescriptor {}
483);
484
485#[cfg(feature = "MTL4PipelineState")]
486impl MTL4RenderPipelineDescriptor {
487 extern_methods!(
488 #[cfg(feature = "MTL4FunctionDescriptor")]
489 #[unsafe(method(vertexFunctionDescriptor))]
491 #[unsafe(method_family = none)]
492 pub fn vertexFunctionDescriptor(&self) -> Option<Retained<MTL4FunctionDescriptor>>;
493
494 #[cfg(feature = "MTL4FunctionDescriptor")]
495 #[unsafe(method(setVertexFunctionDescriptor:))]
499 #[unsafe(method_family = none)]
500 pub fn setVertexFunctionDescriptor(
501 &self,
502 vertex_function_descriptor: Option<&MTL4FunctionDescriptor>,
503 );
504
505 #[cfg(feature = "MTL4FunctionDescriptor")]
506 #[unsafe(method(fragmentFunctionDescriptor))]
511 #[unsafe(method_family = none)]
512 pub fn fragmentFunctionDescriptor(&self) -> Option<Retained<MTL4FunctionDescriptor>>;
513
514 #[cfg(feature = "MTL4FunctionDescriptor")]
515 #[unsafe(method(setFragmentFunctionDescriptor:))]
519 #[unsafe(method_family = none)]
520 pub fn setFragmentFunctionDescriptor(
521 &self,
522 fragment_function_descriptor: Option<&MTL4FunctionDescriptor>,
523 );
524
525 #[cfg(feature = "MTLVertexDescriptor")]
526 #[unsafe(method(vertexDescriptor))]
531 #[unsafe(method_family = none)]
532 pub fn vertexDescriptor(&self) -> Option<Retained<MTLVertexDescriptor>>;
533
534 #[cfg(feature = "MTLVertexDescriptor")]
535 #[unsafe(method(setVertexDescriptor:))]
539 #[unsafe(method_family = none)]
540 pub fn setVertexDescriptor(&self, vertex_descriptor: Option<&MTLVertexDescriptor>);
541
542 #[unsafe(method(rasterSampleCount))]
544 #[unsafe(method_family = none)]
545 pub fn rasterSampleCount(&self) -> NSUInteger;
546
547 #[unsafe(method(setRasterSampleCount:))]
553 #[unsafe(method_family = none)]
554 pub unsafe fn setRasterSampleCount(&self, raster_sample_count: NSUInteger);
555
556 #[unsafe(method(alphaToCoverageState))]
558 #[unsafe(method_family = none)]
559 pub fn alphaToCoverageState(&self) -> MTL4AlphaToCoverageState;
560
561 #[unsafe(method(setAlphaToCoverageState:))]
563 #[unsafe(method_family = none)]
564 pub fn setAlphaToCoverageState(&self, alpha_to_coverage_state: MTL4AlphaToCoverageState);
565
566 #[unsafe(method(alphaToOneState))]
568 #[unsafe(method_family = none)]
569 pub fn alphaToOneState(&self) -> MTL4AlphaToOneState;
570
571 #[unsafe(method(setAlphaToOneState:))]
573 #[unsafe(method_family = none)]
574 pub fn setAlphaToOneState(&self, alpha_to_one_state: MTL4AlphaToOneState);
575
576 #[unsafe(method(isRasterizationEnabled))]
586 #[unsafe(method_family = none)]
587 pub fn isRasterizationEnabled(&self) -> bool;
588
589 #[unsafe(method(setRasterizationEnabled:))]
591 #[unsafe(method_family = none)]
592 pub fn setRasterizationEnabled(&self, rasterization_enabled: bool);
593
594 #[unsafe(method(maxVertexAmplificationCount))]
599 #[unsafe(method_family = none)]
600 pub fn maxVertexAmplificationCount(&self) -> NSUInteger;
601
602 #[unsafe(method(setMaxVertexAmplificationCount:))]
608 #[unsafe(method_family = none)]
609 pub unsafe fn setMaxVertexAmplificationCount(
610 &self,
611 max_vertex_amplification_count: NSUInteger,
612 );
613
614 #[unsafe(method(colorAttachments))]
616 #[unsafe(method_family = none)]
617 pub fn colorAttachments(
618 &self,
619 ) -> Retained<MTL4RenderPipelineColorAttachmentDescriptorArray>;
620
621 #[cfg(feature = "MTLRenderPipeline")]
622 #[unsafe(method(inputPrimitiveTopology))]
624 #[unsafe(method_family = none)]
625 pub fn inputPrimitiveTopology(&self) -> MTLPrimitiveTopologyClass;
626
627 #[cfg(feature = "MTLRenderPipeline")]
628 #[unsafe(method(setInputPrimitiveTopology:))]
630 #[unsafe(method_family = none)]
631 pub fn setInputPrimitiveTopology(
632 &self,
633 input_primitive_topology: MTLPrimitiveTopologyClass,
634 );
635
636 #[cfg(feature = "MTL4LinkingDescriptor")]
637 #[unsafe(method(vertexStaticLinkingDescriptor))]
641 #[unsafe(method_family = none)]
642 pub fn vertexStaticLinkingDescriptor(&self) -> Retained<MTL4StaticLinkingDescriptor>;
643
644 #[cfg(feature = "MTL4LinkingDescriptor")]
645 #[unsafe(method(setVertexStaticLinkingDescriptor:))]
649 #[unsafe(method_family = none)]
650 pub fn setVertexStaticLinkingDescriptor(
651 &self,
652 vertex_static_linking_descriptor: Option<&MTL4StaticLinkingDescriptor>,
653 );
654
655 #[cfg(feature = "MTL4LinkingDescriptor")]
656 #[unsafe(method(fragmentStaticLinkingDescriptor))]
660 #[unsafe(method_family = none)]
661 pub fn fragmentStaticLinkingDescriptor(&self) -> Retained<MTL4StaticLinkingDescriptor>;
662
663 #[cfg(feature = "MTL4LinkingDescriptor")]
664 #[unsafe(method(setFragmentStaticLinkingDescriptor:))]
668 #[unsafe(method_family = none)]
669 pub fn setFragmentStaticLinkingDescriptor(
670 &self,
671 fragment_static_linking_descriptor: Option<&MTL4StaticLinkingDescriptor>,
672 );
673
674 #[unsafe(method(supportVertexBinaryLinking))]
677 #[unsafe(method_family = none)]
678 pub fn supportVertexBinaryLinking(&self) -> bool;
679
680 #[unsafe(method(setSupportVertexBinaryLinking:))]
682 #[unsafe(method_family = none)]
683 pub fn setSupportVertexBinaryLinking(&self, support_vertex_binary_linking: bool);
684
685 #[unsafe(method(supportFragmentBinaryLinking))]
688 #[unsafe(method_family = none)]
689 pub fn supportFragmentBinaryLinking(&self) -> bool;
690
691 #[unsafe(method(setSupportFragmentBinaryLinking:))]
693 #[unsafe(method_family = none)]
694 pub fn setSupportFragmentBinaryLinking(&self, support_fragment_binary_linking: bool);
695
696 #[unsafe(method(colorAttachmentMappingState))]
701 #[unsafe(method_family = none)]
702 pub fn colorAttachmentMappingState(
703 &self,
704 ) -> MTL4LogicalToPhysicalColorAttachmentMappingState;
705
706 #[unsafe(method(setColorAttachmentMappingState:))]
708 #[unsafe(method_family = none)]
709 pub fn setColorAttachmentMappingState(
710 &self,
711 color_attachment_mapping_state: MTL4LogicalToPhysicalColorAttachmentMappingState,
712 );
713
714 #[unsafe(method(supportIndirectCommandBuffers))]
716 #[unsafe(method_family = none)]
717 pub fn supportIndirectCommandBuffers(&self) -> MTL4IndirectCommandBufferSupportState;
718
719 #[unsafe(method(setSupportIndirectCommandBuffers:))]
721 #[unsafe(method_family = none)]
722 pub fn setSupportIndirectCommandBuffers(
723 &self,
724 support_indirect_command_buffers: MTL4IndirectCommandBufferSupportState,
725 );
726
727 #[unsafe(method(reset))]
729 #[unsafe(method_family = none)]
730 pub fn reset(&self);
731 );
732}
733
734#[cfg(feature = "MTL4PipelineState")]
736impl MTL4RenderPipelineDescriptor {
737 extern_methods!(
738 #[unsafe(method(init))]
739 #[unsafe(method_family = init)]
740 pub fn init(this: Allocated<Self>) -> Retained<Self>;
741
742 #[unsafe(method(new))]
743 #[unsafe(method_family = new)]
744 pub fn new() -> Retained<Self>;
745 );
746}
747
748#[cfg(feature = "MTL4PipelineState")]
749impl DefaultRetained for MTL4RenderPipelineDescriptor {
750 #[inline]
751 fn default_retained() -> Retained<Self> {
752 Self::new()
753 }
754}