1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(C)]
12#[derive(Clone, Copy, Debug, PartialEq)]
13pub struct MTLClearColor {
14 pub red: c_double,
15 pub green: c_double,
16 pub blue: c_double,
17 pub alpha: c_double,
18}
19
20unsafe impl Encode for MTLClearColor {
21 const ENCODING: Encoding = Encoding::Struct(
22 "?",
23 &[
24 <c_double>::ENCODING,
25 <c_double>::ENCODING,
26 <c_double>::ENCODING,
27 <c_double>::ENCODING,
28 ],
29 );
30}
31
32unsafe impl RefEncode for MTLClearColor {
33 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36impl MTLClearColor {
37 }
39
40#[repr(transparent)]
43#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
44pub struct MTLLoadAction(pub NSUInteger);
45impl MTLLoadAction {
46 #[doc(alias = "MTLLoadActionDontCare")]
47 pub const DontCare: Self = Self(0);
48 #[doc(alias = "MTLLoadActionLoad")]
49 pub const Load: Self = Self(1);
50 #[doc(alias = "MTLLoadActionClear")]
51 pub const Clear: Self = Self(2);
52}
53
54unsafe impl Encode for MTLLoadAction {
55 const ENCODING: Encoding = NSUInteger::ENCODING;
56}
57
58unsafe impl RefEncode for MTLLoadAction {
59 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
60}
61
62#[repr(transparent)]
65#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
66pub struct MTLStoreAction(pub NSUInteger);
67impl MTLStoreAction {
68 #[doc(alias = "MTLStoreActionDontCare")]
69 pub const DontCare: Self = Self(0);
70 #[doc(alias = "MTLStoreActionStore")]
71 pub const Store: Self = Self(1);
72 #[doc(alias = "MTLStoreActionMultisampleResolve")]
73 pub const MultisampleResolve: Self = Self(2);
74 #[doc(alias = "MTLStoreActionStoreAndMultisampleResolve")]
75 pub const StoreAndMultisampleResolve: Self = Self(3);
76 #[doc(alias = "MTLStoreActionUnknown")]
77 pub const Unknown: Self = Self(4);
78 #[doc(alias = "MTLStoreActionCustomSampleDepthStore")]
79 pub const CustomSampleDepthStore: Self = Self(5);
80}
81
82unsafe impl Encode for MTLStoreAction {
83 const ENCODING: Encoding = NSUInteger::ENCODING;
84}
85
86unsafe impl RefEncode for MTLStoreAction {
87 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
88}
89
90#[repr(transparent)]
93#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
94pub struct MTLStoreActionOptions(pub NSUInteger);
95bitflags::bitflags! {
96 impl MTLStoreActionOptions: NSUInteger {
97 #[doc(alias = "MTLStoreActionOptionNone")]
98 const None = 0;
99 #[doc(alias = "MTLStoreActionOptionCustomSamplePositions")]
100 const CustomSamplePositions = 1<<0;
101 }
102}
103
104unsafe impl Encode for MTLStoreActionOptions {
105 const ENCODING: Encoding = NSUInteger::ENCODING;
106}
107
108unsafe impl RefEncode for MTLStoreActionOptions {
109 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
110}
111
112#[repr(transparent)]
121#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
122pub struct MTLVisibilityResultType(pub NSInteger);
123impl MTLVisibilityResultType {
124 #[doc(alias = "MTLVisibilityResultTypeReset")]
126 pub const Reset: Self = Self(0);
127 #[doc(alias = "MTLVisibilityResultTypeAccumulate")]
129 pub const Accumulate: Self = Self(1);
130}
131
132unsafe impl Encode for MTLVisibilityResultType {
133 const ENCODING: Encoding = NSInteger::ENCODING;
134}
135
136unsafe impl RefEncode for MTLVisibilityResultType {
137 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
138}
139
140extern_class!(
141 #[unsafe(super(NSObject))]
143 #[derive(Debug, PartialEq, Eq, Hash)]
144 pub struct MTLRenderPassAttachmentDescriptor;
145);
146
147extern_conformance!(
148 unsafe impl NSCopying for MTLRenderPassAttachmentDescriptor {}
149);
150
151unsafe impl CopyingHelper for MTLRenderPassAttachmentDescriptor {
152 type Result = Self;
153}
154
155extern_conformance!(
156 unsafe impl NSObjectProtocol for MTLRenderPassAttachmentDescriptor {}
157);
158
159impl MTLRenderPassAttachmentDescriptor {
160 extern_methods!(
161 #[cfg(all(
162 feature = "MTLAllocation",
163 feature = "MTLResource",
164 feature = "MTLTexture"
165 ))]
166 #[unsafe(method(texture))]
168 #[unsafe(method_family = none)]
169 pub fn texture(&self) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>;
170
171 #[cfg(all(
172 feature = "MTLAllocation",
173 feature = "MTLResource",
174 feature = "MTLTexture"
175 ))]
176 #[unsafe(method(setTexture:))]
178 #[unsafe(method_family = none)]
179 pub fn setTexture(&self, texture: Option<&ProtocolObject<dyn MTLTexture>>);
180
181 #[unsafe(method(level))]
183 #[unsafe(method_family = none)]
184 pub fn level(&self) -> NSUInteger;
185
186 #[unsafe(method(setLevel:))]
188 #[unsafe(method_family = none)]
189 pub fn setLevel(&self, level: NSUInteger);
190
191 #[unsafe(method(slice))]
193 #[unsafe(method_family = none)]
194 pub fn slice(&self) -> NSUInteger;
195
196 #[unsafe(method(setSlice:))]
198 #[unsafe(method_family = none)]
199 pub fn setSlice(&self, slice: NSUInteger);
200
201 #[unsafe(method(depthPlane))]
203 #[unsafe(method_family = none)]
204 pub fn depthPlane(&self) -> NSUInteger;
205
206 #[unsafe(method(setDepthPlane:))]
208 #[unsafe(method_family = none)]
209 pub fn setDepthPlane(&self, depth_plane: NSUInteger);
210
211 #[cfg(all(
212 feature = "MTLAllocation",
213 feature = "MTLResource",
214 feature = "MTLTexture"
215 ))]
216 #[unsafe(method(resolveTexture))]
219 #[unsafe(method_family = none)]
220 pub fn resolveTexture(&self) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>;
221
222 #[cfg(all(
223 feature = "MTLAllocation",
224 feature = "MTLResource",
225 feature = "MTLTexture"
226 ))]
227 #[unsafe(method(setResolveTexture:))]
229 #[unsafe(method_family = none)]
230 pub fn setResolveTexture(&self, resolve_texture: Option<&ProtocolObject<dyn MTLTexture>>);
231
232 #[unsafe(method(resolveLevel))]
234 #[unsafe(method_family = none)]
235 pub fn resolveLevel(&self) -> NSUInteger;
236
237 #[unsafe(method(setResolveLevel:))]
239 #[unsafe(method_family = none)]
240 pub fn setResolveLevel(&self, resolve_level: NSUInteger);
241
242 #[unsafe(method(resolveSlice))]
244 #[unsafe(method_family = none)]
245 pub fn resolveSlice(&self) -> NSUInteger;
246
247 #[unsafe(method(setResolveSlice:))]
249 #[unsafe(method_family = none)]
250 pub fn setResolveSlice(&self, resolve_slice: NSUInteger);
251
252 #[unsafe(method(resolveDepthPlane))]
254 #[unsafe(method_family = none)]
255 pub fn resolveDepthPlane(&self) -> NSUInteger;
256
257 #[unsafe(method(setResolveDepthPlane:))]
259 #[unsafe(method_family = none)]
260 pub fn setResolveDepthPlane(&self, resolve_depth_plane: NSUInteger);
261
262 #[unsafe(method(loadAction))]
265 #[unsafe(method_family = none)]
266 pub fn loadAction(&self) -> MTLLoadAction;
267
268 #[unsafe(method(setLoadAction:))]
270 #[unsafe(method_family = none)]
271 pub fn setLoadAction(&self, load_action: MTLLoadAction);
272
273 #[unsafe(method(storeAction))]
276 #[unsafe(method_family = none)]
277 pub fn storeAction(&self) -> MTLStoreAction;
278
279 #[unsafe(method(setStoreAction:))]
281 #[unsafe(method_family = none)]
282 pub fn setStoreAction(&self, store_action: MTLStoreAction);
283
284 #[unsafe(method(storeActionOptions))]
287 #[unsafe(method_family = none)]
288 pub fn storeActionOptions(&self) -> MTLStoreActionOptions;
289
290 #[unsafe(method(setStoreActionOptions:))]
292 #[unsafe(method_family = none)]
293 pub fn setStoreActionOptions(&self, store_action_options: MTLStoreActionOptions);
294 );
295}
296
297impl MTLRenderPassAttachmentDescriptor {
299 extern_methods!(
300 #[unsafe(method(init))]
301 #[unsafe(method_family = init)]
302 pub fn init(this: Allocated<Self>) -> Retained<Self>;
303
304 #[unsafe(method(new))]
305 #[unsafe(method_family = new)]
306 pub fn new() -> Retained<Self>;
307 );
308}
309
310impl DefaultRetained for MTLRenderPassAttachmentDescriptor {
311 #[inline]
312 fn default_retained() -> Retained<Self> {
313 Self::new()
314 }
315}
316
317extern_class!(
318 #[unsafe(super(MTLRenderPassAttachmentDescriptor, NSObject))]
320 #[derive(Debug, PartialEq, Eq, Hash)]
321 pub struct MTLRenderPassColorAttachmentDescriptor;
322);
323
324extern_conformance!(
325 unsafe impl NSCopying for MTLRenderPassColorAttachmentDescriptor {}
326);
327
328unsafe impl CopyingHelper for MTLRenderPassColorAttachmentDescriptor {
329 type Result = Self;
330}
331
332extern_conformance!(
333 unsafe impl NSObjectProtocol for MTLRenderPassColorAttachmentDescriptor {}
334);
335
336impl MTLRenderPassColorAttachmentDescriptor {
337 extern_methods!(
338 #[unsafe(method(clearColor))]
340 #[unsafe(method_family = none)]
341 pub fn clearColor(&self) -> MTLClearColor;
342
343 #[unsafe(method(setClearColor:))]
345 #[unsafe(method_family = none)]
346 pub fn setClearColor(&self, clear_color: MTLClearColor);
347 );
348}
349
350impl MTLRenderPassColorAttachmentDescriptor {
352 extern_methods!(
353 #[unsafe(method(init))]
354 #[unsafe(method_family = init)]
355 pub fn init(this: Allocated<Self>) -> Retained<Self>;
356
357 #[unsafe(method(new))]
358 #[unsafe(method_family = new)]
359 pub fn new() -> Retained<Self>;
360 );
361}
362
363impl DefaultRetained for MTLRenderPassColorAttachmentDescriptor {
364 #[inline]
365 fn default_retained() -> Retained<Self> {
366 Self::new()
367 }
368}
369
370#[repr(transparent)]
375#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
376pub struct MTLMultisampleDepthResolveFilter(pub NSUInteger);
377impl MTLMultisampleDepthResolveFilter {
378 #[doc(alias = "MTLMultisampleDepthResolveFilterSample0")]
379 pub const Sample0: Self = Self(0);
380 #[doc(alias = "MTLMultisampleDepthResolveFilterMin")]
381 pub const Min: Self = Self(1);
382 #[doc(alias = "MTLMultisampleDepthResolveFilterMax")]
383 pub const Max: Self = Self(2);
384}
385
386unsafe impl Encode for MTLMultisampleDepthResolveFilter {
387 const ENCODING: Encoding = NSUInteger::ENCODING;
388}
389
390unsafe impl RefEncode for MTLMultisampleDepthResolveFilter {
391 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
392}
393
394extern_class!(
395 #[unsafe(super(MTLRenderPassAttachmentDescriptor, NSObject))]
397 #[derive(Debug, PartialEq, Eq, Hash)]
398 pub struct MTLRenderPassDepthAttachmentDescriptor;
399);
400
401extern_conformance!(
402 unsafe impl NSCopying for MTLRenderPassDepthAttachmentDescriptor {}
403);
404
405unsafe impl CopyingHelper for MTLRenderPassDepthAttachmentDescriptor {
406 type Result = Self;
407}
408
409extern_conformance!(
410 unsafe impl NSObjectProtocol for MTLRenderPassDepthAttachmentDescriptor {}
411);
412
413impl MTLRenderPassDepthAttachmentDescriptor {
414 extern_methods!(
415 #[unsafe(method(clearDepth))]
417 #[unsafe(method_family = none)]
418 pub fn clearDepth(&self) -> c_double;
419
420 #[unsafe(method(setClearDepth:))]
422 #[unsafe(method_family = none)]
423 pub fn setClearDepth(&self, clear_depth: c_double);
424
425 #[unsafe(method(depthResolveFilter))]
427 #[unsafe(method_family = none)]
428 pub fn depthResolveFilter(&self) -> MTLMultisampleDepthResolveFilter;
429
430 #[unsafe(method(setDepthResolveFilter:))]
432 #[unsafe(method_family = none)]
433 pub fn setDepthResolveFilter(&self, depth_resolve_filter: MTLMultisampleDepthResolveFilter);
434 );
435}
436
437impl MTLRenderPassDepthAttachmentDescriptor {
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 MTLRenderPassDepthAttachmentDescriptor {
451 #[inline]
452 fn default_retained() -> Retained<Self> {
453 Self::new()
454 }
455}
456
457#[repr(transparent)]
462#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
463pub struct MTLMultisampleStencilResolveFilter(pub NSUInteger);
464impl MTLMultisampleStencilResolveFilter {
465 #[doc(alias = "MTLMultisampleStencilResolveFilterSample0")]
467 pub const Sample0: Self = Self(0);
468 #[doc(alias = "MTLMultisampleStencilResolveFilterDepthResolvedSample")]
470 pub const DepthResolvedSample: Self = Self(1);
471}
472
473unsafe impl Encode for MTLMultisampleStencilResolveFilter {
474 const ENCODING: Encoding = NSUInteger::ENCODING;
475}
476
477unsafe impl RefEncode for MTLMultisampleStencilResolveFilter {
478 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
479}
480
481extern_class!(
482 #[unsafe(super(MTLRenderPassAttachmentDescriptor, NSObject))]
484 #[derive(Debug, PartialEq, Eq, Hash)]
485 pub struct MTLRenderPassStencilAttachmentDescriptor;
486);
487
488extern_conformance!(
489 unsafe impl NSCopying for MTLRenderPassStencilAttachmentDescriptor {}
490);
491
492unsafe impl CopyingHelper for MTLRenderPassStencilAttachmentDescriptor {
493 type Result = Self;
494}
495
496extern_conformance!(
497 unsafe impl NSObjectProtocol for MTLRenderPassStencilAttachmentDescriptor {}
498);
499
500impl MTLRenderPassStencilAttachmentDescriptor {
501 extern_methods!(
502 #[unsafe(method(clearStencil))]
504 #[unsafe(method_family = none)]
505 pub fn clearStencil(&self) -> u32;
506
507 #[unsafe(method(setClearStencil:))]
509 #[unsafe(method_family = none)]
510 pub fn setClearStencil(&self, clear_stencil: u32);
511
512 #[unsafe(method(stencilResolveFilter))]
514 #[unsafe(method_family = none)]
515 pub fn stencilResolveFilter(&self) -> MTLMultisampleStencilResolveFilter;
516
517 #[unsafe(method(setStencilResolveFilter:))]
519 #[unsafe(method_family = none)]
520 pub fn setStencilResolveFilter(
521 &self,
522 stencil_resolve_filter: MTLMultisampleStencilResolveFilter,
523 );
524 );
525}
526
527impl MTLRenderPassStencilAttachmentDescriptor {
529 extern_methods!(
530 #[unsafe(method(init))]
531 #[unsafe(method_family = init)]
532 pub fn init(this: Allocated<Self>) -> Retained<Self>;
533
534 #[unsafe(method(new))]
535 #[unsafe(method_family = new)]
536 pub fn new() -> Retained<Self>;
537 );
538}
539
540impl DefaultRetained for MTLRenderPassStencilAttachmentDescriptor {
541 #[inline]
542 fn default_retained() -> Retained<Self> {
543 Self::new()
544 }
545}
546
547extern_class!(
548 #[unsafe(super(NSObject))]
550 #[derive(Debug, PartialEq, Eq, Hash)]
551 pub struct MTLRenderPassColorAttachmentDescriptorArray;
552);
553
554extern_conformance!(
555 unsafe impl NSObjectProtocol for MTLRenderPassColorAttachmentDescriptorArray {}
556);
557
558impl MTLRenderPassColorAttachmentDescriptorArray {
559 extern_methods!(
560 #[unsafe(method(objectAtIndexedSubscript:))]
564 #[unsafe(method_family = none)]
565 pub unsafe fn objectAtIndexedSubscript(
566 &self,
567 attachment_index: NSUInteger,
568 ) -> Retained<MTLRenderPassColorAttachmentDescriptor>;
569
570 #[unsafe(method(setObject:atIndexedSubscript:))]
574 #[unsafe(method_family = none)]
575 pub unsafe fn setObject_atIndexedSubscript(
576 &self,
577 attachment: Option<&MTLRenderPassColorAttachmentDescriptor>,
578 attachment_index: NSUInteger,
579 );
580 );
581}
582
583impl MTLRenderPassColorAttachmentDescriptorArray {
585 extern_methods!(
586 #[unsafe(method(init))]
587 #[unsafe(method_family = init)]
588 pub fn init(this: Allocated<Self>) -> Retained<Self>;
589
590 #[unsafe(method(new))]
591 #[unsafe(method_family = new)]
592 pub fn new() -> Retained<Self>;
593 );
594}
595
596impl DefaultRetained for MTLRenderPassColorAttachmentDescriptorArray {
597 #[inline]
598 fn default_retained() -> Retained<Self> {
599 Self::new()
600 }
601}
602
603extern_class!(
604 #[unsafe(super(NSObject))]
606 #[derive(Debug, PartialEq, Eq, Hash)]
607 pub struct MTLRenderPassSampleBufferAttachmentDescriptor;
608);
609
610extern_conformance!(
611 unsafe impl NSCopying for MTLRenderPassSampleBufferAttachmentDescriptor {}
612);
613
614unsafe impl CopyingHelper for MTLRenderPassSampleBufferAttachmentDescriptor {
615 type Result = Self;
616}
617
618extern_conformance!(
619 unsafe impl NSObjectProtocol for MTLRenderPassSampleBufferAttachmentDescriptor {}
620);
621
622impl MTLRenderPassSampleBufferAttachmentDescriptor {
623 extern_methods!(
624 #[cfg(feature = "MTLCounters")]
625 #[unsafe(method(sampleBuffer))]
631 #[unsafe(method_family = none)]
632 pub fn sampleBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLCounterSampleBuffer>>>;
633
634 #[cfg(feature = "MTLCounters")]
635 #[unsafe(method(setSampleBuffer:))]
637 #[unsafe(method_family = none)]
638 pub fn setSampleBuffer(
639 &self,
640 sample_buffer: Option<&ProtocolObject<dyn MTLCounterSampleBuffer>>,
641 );
642
643 #[unsafe(method(startOfVertexSampleIndex))]
650 #[unsafe(method_family = none)]
651 pub fn startOfVertexSampleIndex(&self) -> NSUInteger;
652
653 #[unsafe(method(setStartOfVertexSampleIndex:))]
659 #[unsafe(method_family = none)]
660 pub unsafe fn setStartOfVertexSampleIndex(&self, start_of_vertex_sample_index: NSUInteger);
661
662 #[unsafe(method(endOfVertexSampleIndex))]
669 #[unsafe(method_family = none)]
670 pub fn endOfVertexSampleIndex(&self) -> NSUInteger;
671
672 #[unsafe(method(setEndOfVertexSampleIndex:))]
678 #[unsafe(method_family = none)]
679 pub unsafe fn setEndOfVertexSampleIndex(&self, end_of_vertex_sample_index: NSUInteger);
680
681 #[unsafe(method(startOfFragmentSampleIndex))]
688 #[unsafe(method_family = none)]
689 pub fn startOfFragmentSampleIndex(&self) -> NSUInteger;
690
691 #[unsafe(method(setStartOfFragmentSampleIndex:))]
697 #[unsafe(method_family = none)]
698 pub unsafe fn setStartOfFragmentSampleIndex(
699 &self,
700 start_of_fragment_sample_index: NSUInteger,
701 );
702
703 #[unsafe(method(endOfFragmentSampleIndex))]
710 #[unsafe(method_family = none)]
711 pub fn endOfFragmentSampleIndex(&self) -> NSUInteger;
712
713 #[unsafe(method(setEndOfFragmentSampleIndex:))]
719 #[unsafe(method_family = none)]
720 pub unsafe fn setEndOfFragmentSampleIndex(&self, end_of_fragment_sample_index: NSUInteger);
721 );
722}
723
724impl MTLRenderPassSampleBufferAttachmentDescriptor {
726 extern_methods!(
727 #[unsafe(method(init))]
728 #[unsafe(method_family = init)]
729 pub fn init(this: Allocated<Self>) -> Retained<Self>;
730
731 #[unsafe(method(new))]
732 #[unsafe(method_family = new)]
733 pub fn new() -> Retained<Self>;
734 );
735}
736
737impl DefaultRetained for MTLRenderPassSampleBufferAttachmentDescriptor {
738 #[inline]
739 fn default_retained() -> Retained<Self> {
740 Self::new()
741 }
742}
743
744extern_class!(
745 #[unsafe(super(NSObject))]
747 #[derive(Debug, PartialEq, Eq, Hash)]
748 pub struct MTLRenderPassSampleBufferAttachmentDescriptorArray;
749);
750
751extern_conformance!(
752 unsafe impl NSObjectProtocol for MTLRenderPassSampleBufferAttachmentDescriptorArray {}
753);
754
755impl MTLRenderPassSampleBufferAttachmentDescriptorArray {
756 extern_methods!(
757 #[unsafe(method(objectAtIndexedSubscript:))]
761 #[unsafe(method_family = none)]
762 pub unsafe fn objectAtIndexedSubscript(
763 &self,
764 attachment_index: NSUInteger,
765 ) -> Retained<MTLRenderPassSampleBufferAttachmentDescriptor>;
766
767 #[unsafe(method(setObject:atIndexedSubscript:))]
771 #[unsafe(method_family = none)]
772 pub unsafe fn setObject_atIndexedSubscript(
773 &self,
774 attachment: Option<&MTLRenderPassSampleBufferAttachmentDescriptor>,
775 attachment_index: NSUInteger,
776 );
777 );
778}
779
780impl MTLRenderPassSampleBufferAttachmentDescriptorArray {
782 extern_methods!(
783 #[unsafe(method(init))]
784 #[unsafe(method_family = init)]
785 pub fn init(this: Allocated<Self>) -> Retained<Self>;
786
787 #[unsafe(method(new))]
788 #[unsafe(method_family = new)]
789 pub fn new() -> Retained<Self>;
790 );
791}
792
793impl DefaultRetained for MTLRenderPassSampleBufferAttachmentDescriptorArray {
794 #[inline]
795 fn default_retained() -> Retained<Self> {
796 Self::new()
797 }
798}
799
800extern_class!(
801 #[unsafe(super(NSObject))]
805 #[derive(Debug, PartialEq, Eq, Hash)]
806 pub struct MTLRenderPassDescriptor;
807);
808
809extern_conformance!(
810 unsafe impl NSCopying for MTLRenderPassDescriptor {}
811);
812
813unsafe impl CopyingHelper for MTLRenderPassDescriptor {
814 type Result = Self;
815}
816
817extern_conformance!(
818 unsafe impl NSObjectProtocol for MTLRenderPassDescriptor {}
819);
820
821impl MTLRenderPassDescriptor {
822 extern_methods!(
823 #[unsafe(method(renderPassDescriptor))]
825 #[unsafe(method_family = none)]
826 pub fn renderPassDescriptor() -> Retained<MTLRenderPassDescriptor>;
827
828 #[unsafe(method(colorAttachments))]
829 #[unsafe(method_family = none)]
830 pub fn colorAttachments(&self) -> Retained<MTLRenderPassColorAttachmentDescriptorArray>;
831
832 #[unsafe(method(depthAttachment))]
833 #[unsafe(method_family = none)]
834 pub fn depthAttachment(&self) -> Retained<MTLRenderPassDepthAttachmentDescriptor>;
835
836 #[unsafe(method(setDepthAttachment:))]
840 #[unsafe(method_family = none)]
841 pub fn setDepthAttachment(
842 &self,
843 depth_attachment: Option<&MTLRenderPassDepthAttachmentDescriptor>,
844 );
845
846 #[unsafe(method(stencilAttachment))]
847 #[unsafe(method_family = none)]
848 pub fn stencilAttachment(&self) -> Retained<MTLRenderPassStencilAttachmentDescriptor>;
849
850 #[unsafe(method(setStencilAttachment:))]
854 #[unsafe(method_family = none)]
855 pub fn setStencilAttachment(
856 &self,
857 stencil_attachment: Option<&MTLRenderPassStencilAttachmentDescriptor>,
858 );
859
860 #[cfg(all(
861 feature = "MTLAllocation",
862 feature = "MTLBuffer",
863 feature = "MTLResource"
864 ))]
865 #[unsafe(method(visibilityResultBuffer))]
867 #[unsafe(method_family = none)]
868 pub fn visibilityResultBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
869
870 #[cfg(all(
871 feature = "MTLAllocation",
872 feature = "MTLBuffer",
873 feature = "MTLResource"
874 ))]
875 #[unsafe(method(setVisibilityResultBuffer:))]
877 #[unsafe(method_family = none)]
878 pub fn setVisibilityResultBuffer(
879 &self,
880 visibility_result_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
881 );
882
883 #[unsafe(method(renderTargetArrayLength))]
885 #[unsafe(method_family = none)]
886 pub fn renderTargetArrayLength(&self) -> NSUInteger;
887
888 #[unsafe(method(setRenderTargetArrayLength:))]
890 #[unsafe(method_family = none)]
891 pub fn setRenderTargetArrayLength(&self, render_target_array_length: NSUInteger);
892
893 #[unsafe(method(imageblockSampleLength))]
895 #[unsafe(method_family = none)]
896 pub fn imageblockSampleLength(&self) -> NSUInteger;
897
898 #[unsafe(method(setImageblockSampleLength:))]
900 #[unsafe(method_family = none)]
901 pub fn setImageblockSampleLength(&self, imageblock_sample_length: NSUInteger);
902
903 #[unsafe(method(threadgroupMemoryLength))]
905 #[unsafe(method_family = none)]
906 pub fn threadgroupMemoryLength(&self) -> NSUInteger;
907
908 #[unsafe(method(setThreadgroupMemoryLength:))]
910 #[unsafe(method_family = none)]
911 pub fn setThreadgroupMemoryLength(&self, threadgroup_memory_length: NSUInteger);
912
913 #[unsafe(method(tileWidth))]
917 #[unsafe(method_family = none)]
918 pub fn tileWidth(&self) -> NSUInteger;
919
920 #[unsafe(method(setTileWidth:))]
922 #[unsafe(method_family = none)]
923 pub fn setTileWidth(&self, tile_width: NSUInteger);
924
925 #[unsafe(method(tileHeight))]
929 #[unsafe(method_family = none)]
930 pub fn tileHeight(&self) -> NSUInteger;
931
932 #[unsafe(method(setTileHeight:))]
934 #[unsafe(method_family = none)]
935 pub fn setTileHeight(&self, tile_height: NSUInteger);
936
937 #[unsafe(method(defaultRasterSampleCount))]
939 #[unsafe(method_family = none)]
940 pub fn defaultRasterSampleCount(&self) -> NSUInteger;
941
942 #[unsafe(method(setDefaultRasterSampleCount:))]
944 #[unsafe(method_family = none)]
945 pub fn setDefaultRasterSampleCount(&self, default_raster_sample_count: NSUInteger);
946
947 #[unsafe(method(renderTargetWidth))]
951 #[unsafe(method_family = none)]
952 pub fn renderTargetWidth(&self) -> NSUInteger;
953
954 #[unsafe(method(setRenderTargetWidth:))]
956 #[unsafe(method_family = none)]
957 pub fn setRenderTargetWidth(&self, render_target_width: NSUInteger);
958
959 #[unsafe(method(renderTargetHeight))]
963 #[unsafe(method_family = none)]
964 pub fn renderTargetHeight(&self) -> NSUInteger;
965
966 #[unsafe(method(setRenderTargetHeight:))]
968 #[unsafe(method_family = none)]
969 pub fn setRenderTargetHeight(&self, render_target_height: NSUInteger);
970
971 #[cfg(feature = "MTLTypes")]
972 #[unsafe(method(setSamplePositions:count:))]
983 #[unsafe(method_family = none)]
984 pub unsafe fn setSamplePositions_count(
985 &self,
986 positions: *const MTLSamplePosition,
987 count: NSUInteger,
988 );
989
990 #[cfg(feature = "MTLTypes")]
991 #[unsafe(method(getSamplePositions:count:))]
1004 #[unsafe(method_family = none)]
1005 pub unsafe fn getSamplePositions_count(
1006 &self,
1007 positions: *mut MTLSamplePosition,
1008 count: NSUInteger,
1009 ) -> NSUInteger;
1010
1011 #[cfg(feature = "MTLRasterizationRate")]
1012 #[unsafe(method(rasterizationRateMap))]
1016 #[unsafe(method_family = none)]
1017 pub fn rasterizationRateMap(
1018 &self,
1019 ) -> Option<Retained<ProtocolObject<dyn MTLRasterizationRateMap>>>;
1020
1021 #[cfg(feature = "MTLRasterizationRate")]
1022 #[unsafe(method(setRasterizationRateMap:))]
1024 #[unsafe(method_family = none)]
1025 pub fn setRasterizationRateMap(
1026 &self,
1027 rasterization_rate_map: Option<&ProtocolObject<dyn MTLRasterizationRateMap>>,
1028 );
1029
1030 #[unsafe(method(sampleBufferAttachments))]
1032 #[unsafe(method_family = none)]
1033 pub fn sampleBufferAttachments(
1034 &self,
1035 ) -> Retained<MTLRenderPassSampleBufferAttachmentDescriptorArray>;
1036
1037 #[unsafe(method(visibilityResultType))]
1039 #[unsafe(method_family = none)]
1040 pub fn visibilityResultType(&self) -> MTLVisibilityResultType;
1041
1042 #[unsafe(method(setVisibilityResultType:))]
1044 #[unsafe(method_family = none)]
1045 pub fn setVisibilityResultType(&self, visibility_result_type: MTLVisibilityResultType);
1046
1047 #[unsafe(method(supportColorAttachmentMapping))]
1049 #[unsafe(method_family = none)]
1050 pub fn supportColorAttachmentMapping(&self) -> bool;
1051
1052 #[unsafe(method(setSupportColorAttachmentMapping:))]
1054 #[unsafe(method_family = none)]
1055 pub fn setSupportColorAttachmentMapping(&self, support_color_attachment_mapping: bool);
1056 );
1057}
1058
1059impl MTLRenderPassDescriptor {
1061 extern_methods!(
1062 #[unsafe(method(init))]
1063 #[unsafe(method_family = init)]
1064 pub fn init(this: Allocated<Self>) -> Retained<Self>;
1065
1066 #[unsafe(method(new))]
1067 #[unsafe(method_family = new)]
1068 pub fn new() -> Retained<Self>;
1069 );
1070}
1071
1072impl DefaultRetained for MTLRenderPassDescriptor {
1073 #[inline]
1074 fn default_retained() -> Retained<Self> {
1075 Self::new()
1076 }
1077}
1078
1079impl MTLClearColor {
1080 }