1use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "dispatch2")]
6use dispatch2::*;
7use objc2::__framework_prelude::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-io-surface")]
10use objc2_io_surface::*;
11
12use crate::*;
13
14#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct MTLIOCompressionMethod(pub NSInteger);
19impl MTLIOCompressionMethod {
20 #[doc(alias = "MTLIOCompressionMethodZlib")]
21 pub const Zlib: Self = Self(0);
22 #[doc(alias = "MTLIOCompressionMethodLZFSE")]
23 pub const LZFSE: Self = Self(1);
24 #[doc(alias = "MTLIOCompressionMethodLZ4")]
25 pub const LZ4: Self = Self(2);
26 #[doc(alias = "MTLIOCompressionMethodLZMA")]
27 pub const LZMA: Self = Self(3);
28 #[doc(alias = "MTLIOCompressionMethodLZBitmap")]
29 pub const LZBitmap: Self = Self(4);
30}
31
32unsafe impl Encode for MTLIOCompressionMethod {
33 const ENCODING: Encoding = NSInteger::ENCODING;
34}
35
36unsafe impl RefEncode for MTLIOCompressionMethod {
37 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40#[inline]
47pub extern "C-unwind" fn MTLCreateSystemDefaultDevice(
48) -> Option<Retained<ProtocolObject<dyn MTLDevice>>> {
49 extern "C-unwind" {
50 fn MTLCreateSystemDefaultDevice() -> *mut ProtocolObject<dyn MTLDevice>;
51 }
52 let ret = unsafe { MTLCreateSystemDefaultDevice() };
53 unsafe { Retained::from_raw(ret) }
54}
55
56pub type MTLDeviceNotificationName = NSString;
61
62extern "C" {
63 pub static MTLDeviceWasAddedNotification: &'static MTLDeviceNotificationName;
67}
68
69extern "C" {
70 pub static MTLDeviceRemovalRequestedNotification: &'static MTLDeviceNotificationName;
77}
78
79extern "C" {
80 pub static MTLDeviceWasRemovedNotification: &'static MTLDeviceNotificationName;
85}
86
87#[cfg(feature = "block2")]
91pub type MTLDeviceNotificationHandler = *mut block2::DynBlock<
92 dyn Fn(NonNull<ProtocolObject<dyn MTLDevice>>, NonNull<MTLDeviceNotificationName>),
93>;
94
95#[cfg(feature = "block2")]
106#[inline]
107pub unsafe extern "C-unwind" fn MTLCopyAllDevicesWithObserver(
108 observer: NonNull<*mut ProtocolObject<dyn NSObjectProtocol>>,
109 handler: MTLDeviceNotificationHandler,
110) -> Retained<NSArray<ProtocolObject<dyn MTLDevice>>> {
111 extern "C-unwind" {
112 fn MTLCopyAllDevicesWithObserver(
113 observer: NonNull<*mut ProtocolObject<dyn NSObjectProtocol>>,
114 handler: MTLDeviceNotificationHandler,
115 ) -> *mut NSArray<ProtocolObject<dyn MTLDevice>>;
116 }
117 let ret = unsafe { MTLCopyAllDevicesWithObserver(observer, handler) };
118 unsafe { Retained::from_raw(ret) }
119 .expect("function was marked as returning non-null, but actually returned NULL")
120}
121
122extern "C-unwind" {
123 pub fn MTLRemoveDeviceObserver(observer: &ProtocolObject<dyn NSObjectProtocol>);
129}
130
131#[deprecated = "Use MTLGPUFamily instead"]
134#[repr(transparent)]
135#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
136pub struct MTLFeatureSet(pub NSUInteger);
137impl MTLFeatureSet {
138 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily1_v1")]
139 pub const iOS_GPUFamily1_v1: Self = Self(0);
140 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily2_v1")]
141 pub const iOS_GPUFamily2_v1: Self = Self(1);
142 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily1_v2")]
143 pub const iOS_GPUFamily1_v2: Self = Self(2);
144 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily2_v2")]
145 pub const iOS_GPUFamily2_v2: Self = Self(3);
146 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily3_v1")]
147 pub const iOS_GPUFamily3_v1: Self = Self(4);
148 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily1_v3")]
149 pub const iOS_GPUFamily1_v3: Self = Self(5);
150 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily2_v3")]
151 pub const iOS_GPUFamily2_v3: Self = Self(6);
152 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily3_v2")]
153 pub const iOS_GPUFamily3_v2: Self = Self(7);
154 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily1_v4")]
155 pub const iOS_GPUFamily1_v4: Self = Self(8);
156 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily2_v4")]
157 pub const iOS_GPUFamily2_v4: Self = Self(9);
158 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily3_v3")]
159 pub const iOS_GPUFamily3_v3: Self = Self(10);
160 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily4_v1")]
161 pub const iOS_GPUFamily4_v1: Self = Self(11);
162 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily1_v5")]
163 pub const iOS_GPUFamily1_v5: Self = Self(12);
164 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily2_v5")]
165 pub const iOS_GPUFamily2_v5: Self = Self(13);
166 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily3_v4")]
167 pub const iOS_GPUFamily3_v4: Self = Self(14);
168 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily4_v2")]
169 pub const iOS_GPUFamily4_v2: Self = Self(15);
170 #[doc(alias = "MTLFeatureSet_iOS_GPUFamily5_v1")]
171 pub const iOS_GPUFamily5_v1: Self = Self(16);
172 #[doc(alias = "MTLFeatureSet_macOS_GPUFamily1_v1")]
173 pub const macOS_GPUFamily1_v1: Self = Self(10000);
174 #[doc(alias = "MTLFeatureSet_OSX_GPUFamily1_v1")]
175 pub const OSX_GPUFamily1_v1: Self = Self(MTLFeatureSet::macOS_GPUFamily1_v1.0);
176 #[doc(alias = "MTLFeatureSet_macOS_GPUFamily1_v2")]
177 pub const macOS_GPUFamily1_v2: Self = Self(10001);
178 #[doc(alias = "MTLFeatureSet_OSX_GPUFamily1_v2")]
179 pub const OSX_GPUFamily1_v2: Self = Self(MTLFeatureSet::macOS_GPUFamily1_v2.0);
180 #[doc(alias = "MTLFeatureSet_macOS_ReadWriteTextureTier2")]
181 pub const macOS_ReadWriteTextureTier2: Self = Self(10002);
182 #[doc(alias = "MTLFeatureSet_OSX_ReadWriteTextureTier2")]
183 pub const OSX_ReadWriteTextureTier2: Self = Self(MTLFeatureSet::macOS_ReadWriteTextureTier2.0);
184 #[doc(alias = "MTLFeatureSet_macOS_GPUFamily1_v3")]
185 pub const macOS_GPUFamily1_v3: Self = Self(10003);
186 #[doc(alias = "MTLFeatureSet_macOS_GPUFamily1_v4")]
187 pub const macOS_GPUFamily1_v4: Self = Self(10004);
188 #[doc(alias = "MTLFeatureSet_macOS_GPUFamily2_v1")]
189 pub const macOS_GPUFamily2_v1: Self = Self(10005);
190 #[doc(alias = "MTLFeatureSet_tvOS_GPUFamily1_v1")]
191 pub const tvOS_GPUFamily1_v1: Self = Self(30000);
192 #[doc(alias = "MTLFeatureSet_TVOS_GPUFamily1_v1")]
193 pub const TVOS_GPUFamily1_v1: Self = Self(MTLFeatureSet::tvOS_GPUFamily1_v1.0);
194 #[doc(alias = "MTLFeatureSet_tvOS_GPUFamily1_v2")]
195 pub const tvOS_GPUFamily1_v2: Self = Self(30001);
196 #[doc(alias = "MTLFeatureSet_tvOS_GPUFamily1_v3")]
197 pub const tvOS_GPUFamily1_v3: Self = Self(30002);
198 #[doc(alias = "MTLFeatureSet_tvOS_GPUFamily2_v1")]
199 pub const tvOS_GPUFamily2_v1: Self = Self(30003);
200 #[doc(alias = "MTLFeatureSet_tvOS_GPUFamily1_v4")]
201 pub const tvOS_GPUFamily1_v4: Self = Self(30004);
202 #[doc(alias = "MTLFeatureSet_tvOS_GPUFamily2_v2")]
203 pub const tvOS_GPUFamily2_v2: Self = Self(30005);
204}
205
206unsafe impl Encode for MTLFeatureSet {
207 const ENCODING: Encoding = NSUInteger::ENCODING;
208}
209
210unsafe impl RefEncode for MTLFeatureSet {
211 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
212}
213
214#[repr(transparent)]
217#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
218pub struct MTLGPUFamily(pub NSInteger);
219impl MTLGPUFamily {
220 #[doc(alias = "MTLGPUFamilyApple1")]
221 pub const Apple1: Self = Self(1001);
222 #[doc(alias = "MTLGPUFamilyApple2")]
223 pub const Apple2: Self = Self(1002);
224 #[doc(alias = "MTLGPUFamilyApple3")]
225 pub const Apple3: Self = Self(1003);
226 #[doc(alias = "MTLGPUFamilyApple4")]
227 pub const Apple4: Self = Self(1004);
228 #[doc(alias = "MTLGPUFamilyApple5")]
229 pub const Apple5: Self = Self(1005);
230 #[doc(alias = "MTLGPUFamilyApple6")]
231 pub const Apple6: Self = Self(1006);
232 #[doc(alias = "MTLGPUFamilyApple7")]
233 pub const Apple7: Self = Self(1007);
234 #[doc(alias = "MTLGPUFamilyApple8")]
235 pub const Apple8: Self = Self(1008);
236 #[doc(alias = "MTLGPUFamilyApple9")]
237 pub const Apple9: Self = Self(1009);
238 #[doc(alias = "MTLGPUFamilyApple10")]
239 pub const Apple10: Self = Self(1010);
240 #[doc(alias = "MTLGPUFamilyMac1")]
241 #[deprecated]
242 pub const Mac1: Self = Self(2001);
243 #[doc(alias = "MTLGPUFamilyMac2")]
244 pub const Mac2: Self = Self(2002);
245 #[doc(alias = "MTLGPUFamilyCommon1")]
246 pub const Common1: Self = Self(3001);
247 #[doc(alias = "MTLGPUFamilyCommon2")]
248 pub const Common2: Self = Self(3002);
249 #[doc(alias = "MTLGPUFamilyCommon3")]
250 pub const Common3: Self = Self(3003);
251 #[doc(alias = "MTLGPUFamilyMacCatalyst1")]
252 #[deprecated]
253 pub const MacCatalyst1: Self = Self(4001);
254 #[doc(alias = "MTLGPUFamilyMacCatalyst2")]
255 #[deprecated]
256 pub const MacCatalyst2: Self = Self(4002);
257 #[doc(alias = "MTLGPUFamilyMetal3")]
258 pub const Metal3: Self = Self(5001);
259 #[doc(alias = "MTLGPUFamilyMetal4")]
260 pub const Metal4: Self = Self(5002);
261}
262
263unsafe impl Encode for MTLGPUFamily {
264 const ENCODING: Encoding = NSInteger::ENCODING;
265}
266
267unsafe impl RefEncode for MTLGPUFamily {
268 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
269}
270
271#[repr(transparent)]
276#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
277pub struct MTLDeviceLocation(pub NSUInteger);
278impl MTLDeviceLocation {
279 #[doc(alias = "MTLDeviceLocationBuiltIn")]
280 pub const BuiltIn: Self = Self(0);
281 #[doc(alias = "MTLDeviceLocationSlot")]
282 pub const Slot: Self = Self(1);
283 #[doc(alias = "MTLDeviceLocationExternal")]
284 pub const External: Self = Self(2);
285 #[doc(alias = "MTLDeviceLocationUnspecified")]
286 pub const Unspecified: Self = Self(NSUIntegerMax as _);
287}
288
289unsafe impl Encode for MTLDeviceLocation {
290 const ENCODING: Encoding = NSUInteger::ENCODING;
291}
292
293unsafe impl RefEncode for MTLDeviceLocation {
294 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
295}
296
297#[repr(transparent)]
302#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
303pub struct MTLPipelineOption(pub NSUInteger);
304bitflags::bitflags! {
305 impl MTLPipelineOption: NSUInteger {
306 #[doc(alias = "MTLPipelineOptionNone")]
307 const None = 0;
308 #[doc(alias = "MTLPipelineOptionArgumentInfo")]
309#[deprecated]
310 const ArgumentInfo = 1<<0;
311 #[doc(alias = "MTLPipelineOptionBindingInfo")]
312 const BindingInfo = 1<<0;
313 #[doc(alias = "MTLPipelineOptionBufferTypeInfo")]
314 const BufferTypeInfo = 1<<1;
315 #[doc(alias = "MTLPipelineOptionFailOnBinaryArchiveMiss")]
316 const FailOnBinaryArchiveMiss = 1<<2;
317 }
318}
319
320unsafe impl Encode for MTLPipelineOption {
321 const ENCODING: Encoding = NSUInteger::ENCODING;
322}
323
324unsafe impl RefEncode for MTLPipelineOption {
325 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
326}
327
328#[repr(transparent)]
333#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
334pub struct MTLReadWriteTextureTier(pub NSUInteger);
335impl MTLReadWriteTextureTier {
336 #[doc(alias = "MTLReadWriteTextureTierNone")]
337 pub const TierNone: Self = Self(0);
338 #[doc(alias = "MTLReadWriteTextureTier1")]
339 pub const Tier1: Self = Self(1);
340 #[doc(alias = "MTLReadWriteTextureTier2")]
341 pub const Tier2: Self = Self(2);
342}
343
344unsafe impl Encode for MTLReadWriteTextureTier {
345 const ENCODING: Encoding = NSUInteger::ENCODING;
346}
347
348unsafe impl RefEncode for MTLReadWriteTextureTier {
349 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
350}
351
352#[repr(transparent)]
357#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
358pub struct MTLArgumentBuffersTier(pub NSUInteger);
359impl MTLArgumentBuffersTier {
360 #[doc(alias = "MTLArgumentBuffersTier1")]
361 pub const Tier1: Self = Self(0);
362 #[doc(alias = "MTLArgumentBuffersTier2")]
363 pub const Tier2: Self = Self(1);
364}
365
366unsafe impl Encode for MTLArgumentBuffersTier {
367 const ENCODING: Encoding = NSUInteger::ENCODING;
368}
369
370unsafe impl RefEncode for MTLArgumentBuffersTier {
371 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
372}
373
374#[repr(transparent)]
379#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
380pub struct MTLSparseTextureRegionAlignmentMode(pub NSUInteger);
381impl MTLSparseTextureRegionAlignmentMode {
382 #[doc(alias = "MTLSparseTextureRegionAlignmentModeOutward")]
383 pub const Outward: Self = Self(0);
384 #[doc(alias = "MTLSparseTextureRegionAlignmentModeInward")]
385 pub const Inward: Self = Self(1);
386}
387
388unsafe impl Encode for MTLSparseTextureRegionAlignmentMode {
389 const ENCODING: Encoding = NSUInteger::ENCODING;
390}
391
392unsafe impl RefEncode for MTLSparseTextureRegionAlignmentMode {
393 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
394}
395
396#[repr(C)]
400#[derive(Clone, Copy, Debug, PartialEq)]
401pub struct MTLAccelerationStructureSizes {
402 pub accelerationStructureSize: NSUInteger,
404 pub buildScratchBufferSize: NSUInteger,
406 pub refitScratchBufferSize: NSUInteger,
408}
409
410unsafe impl Encode for MTLAccelerationStructureSizes {
411 const ENCODING: Encoding = Encoding::Struct(
412 "?",
413 &[
414 <NSUInteger>::ENCODING,
415 <NSUInteger>::ENCODING,
416 <NSUInteger>::ENCODING,
417 ],
418 );
419}
420
421unsafe impl RefEncode for MTLAccelerationStructureSizes {
422 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
423}
424
425#[repr(transparent)]
445#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
446pub struct MTLCounterSamplingPoint(pub NSUInteger);
447impl MTLCounterSamplingPoint {
448 #[doc(alias = "MTLCounterSamplingPointAtStageBoundary")]
449 pub const AtStageBoundary: Self = Self(0);
450 #[doc(alias = "MTLCounterSamplingPointAtDrawBoundary")]
451 pub const AtDrawBoundary: Self = Self(1);
452 #[doc(alias = "MTLCounterSamplingPointAtDispatchBoundary")]
453 pub const AtDispatchBoundary: Self = Self(2);
454 #[doc(alias = "MTLCounterSamplingPointAtTileDispatchBoundary")]
455 pub const AtTileDispatchBoundary: Self = Self(3);
456 #[doc(alias = "MTLCounterSamplingPointAtBlitBoundary")]
457 pub const AtBlitBoundary: Self = Self(4);
458}
459
460unsafe impl Encode for MTLCounterSamplingPoint {
461 const ENCODING: Encoding = NSUInteger::ENCODING;
462}
463
464unsafe impl RefEncode for MTLCounterSamplingPoint {
465 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
466}
467
468#[repr(C)]
472#[derive(Clone, Copy, Debug, PartialEq)]
473pub struct MTLSizeAndAlign {
474 pub size: NSUInteger,
475 pub align: NSUInteger,
476}
477
478unsafe impl Encode for MTLSizeAndAlign {
479 const ENCODING: Encoding =
480 Encoding::Struct("?", &[<NSUInteger>::ENCODING, <NSUInteger>::ENCODING]);
481}
482
483unsafe impl RefEncode for MTLSizeAndAlign {
484 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
485}
486
487extern_class!(
488 #[unsafe(super(NSObject))]
492 #[derive(Debug, PartialEq, Eq, Hash)]
493 pub struct MTLArgumentDescriptor;
494);
495
496extern_conformance!(
497 unsafe impl NSCopying for MTLArgumentDescriptor {}
498);
499
500unsafe impl CopyingHelper for MTLArgumentDescriptor {
501 type Result = Self;
502}
503
504extern_conformance!(
505 unsafe impl NSObjectProtocol for MTLArgumentDescriptor {}
506);
507
508impl MTLArgumentDescriptor {
509 extern_methods!(
510 #[unsafe(method(argumentDescriptor))]
512 #[unsafe(method_family = none)]
513 pub fn argumentDescriptor() -> Retained<MTLArgumentDescriptor>;
514
515 #[cfg(feature = "MTLDataType")]
516 #[unsafe(method(dataType))]
519 #[unsafe(method_family = none)]
520 pub fn dataType(&self) -> MTLDataType;
521
522 #[cfg(feature = "MTLDataType")]
523 #[unsafe(method(setDataType:))]
525 #[unsafe(method_family = none)]
526 pub fn setDataType(&self, data_type: MTLDataType);
527
528 #[unsafe(method(index))]
530 #[unsafe(method_family = none)]
531 pub fn index(&self) -> NSUInteger;
532
533 #[unsafe(method(setIndex:))]
535 #[unsafe(method_family = none)]
536 pub fn setIndex(&self, index: NSUInteger);
537
538 #[unsafe(method(arrayLength))]
540 #[unsafe(method_family = none)]
541 pub fn arrayLength(&self) -> NSUInteger;
542
543 #[unsafe(method(setArrayLength:))]
545 #[unsafe(method_family = none)]
546 pub fn setArrayLength(&self, array_length: NSUInteger);
547
548 #[cfg(feature = "MTLArgument")]
549 #[unsafe(method(access))]
551 #[unsafe(method_family = none)]
552 pub fn access(&self) -> MTLBindingAccess;
553
554 #[cfg(feature = "MTLArgument")]
555 #[unsafe(method(setAccess:))]
557 #[unsafe(method_family = none)]
558 pub fn setAccess(&self, access: MTLBindingAccess);
559
560 #[cfg(feature = "MTLTexture")]
561 #[unsafe(method(textureType))]
563 #[unsafe(method_family = none)]
564 pub fn textureType(&self) -> MTLTextureType;
565
566 #[cfg(feature = "MTLTexture")]
567 #[unsafe(method(setTextureType:))]
569 #[unsafe(method_family = none)]
570 pub fn setTextureType(&self, texture_type: MTLTextureType);
571
572 #[unsafe(method(constantBlockAlignment))]
577 #[unsafe(method_family = none)]
578 pub fn constantBlockAlignment(&self) -> NSUInteger;
579
580 #[unsafe(method(setConstantBlockAlignment:))]
582 #[unsafe(method_family = none)]
583 pub fn setConstantBlockAlignment(&self, constant_block_alignment: NSUInteger);
584 );
585}
586
587impl MTLArgumentDescriptor {
589 extern_methods!(
590 #[unsafe(method(init))]
591 #[unsafe(method_family = init)]
592 pub fn init(this: Allocated<Self>) -> Retained<Self>;
593
594 #[unsafe(method(new))]
595 #[unsafe(method_family = new)]
596 pub fn new() -> Retained<Self>;
597 );
598}
599
600impl DefaultRetained for MTLArgumentDescriptor {
601 #[inline]
602 fn default_retained() -> Retained<Self> {
603 Self::new()
604 }
605}
606
607extern_class!(
608 #[unsafe(super(NSObject))]
612 #[derive(Debug, PartialEq, Eq, Hash)]
613 pub struct MTLArchitecture;
614);
615
616extern_conformance!(
617 unsafe impl NSCopying for MTLArchitecture {}
618);
619
620unsafe impl CopyingHelper for MTLArchitecture {
621 type Result = Self;
622}
623
624extern_conformance!(
625 unsafe impl NSObjectProtocol for MTLArchitecture {}
626);
627
628impl MTLArchitecture {
629 extern_methods!(
630 #[unsafe(method(name))]
632 #[unsafe(method_family = none)]
633 pub fn name(&self) -> Retained<NSString>;
634 );
635}
636
637impl MTLArchitecture {
639 extern_methods!(
640 #[unsafe(method(init))]
641 #[unsafe(method_family = init)]
642 pub fn init(this: Allocated<Self>) -> Retained<Self>;
643
644 #[unsafe(method(new))]
645 #[unsafe(method_family = new)]
646 pub fn new() -> Retained<Self>;
647 );
648}
649
650impl DefaultRetained for MTLArchitecture {
651 #[inline]
652 fn default_retained() -> Retained<Self> {
653 Self::new()
654 }
655}
656
657pub type MTLTimestamp = u64;
659
660extern_protocol!(
661 pub unsafe trait MTLDevice: NSObjectProtocol + Send + Sync {
665 #[unsafe(method(name))]
667 #[unsafe(method_family = none)]
668 fn name(&self) -> Retained<NSString>;
669
670 #[unsafe(method(registryID))]
675 #[unsafe(method_family = none)]
676 fn registryID(&self) -> u64;
677
678 #[unsafe(method(architecture))]
680 #[unsafe(method_family = none)]
681 fn architecture(&self) -> Retained<MTLArchitecture>;
682
683 #[cfg(feature = "MTLTypes")]
684 #[unsafe(method(maxThreadsPerThreadgroup))]
686 #[unsafe(method_family = none)]
687 fn maxThreadsPerThreadgroup(&self) -> MTLSize;
688
689 #[unsafe(method(isLowPower))]
691 #[unsafe(method_family = none)]
692 fn isLowPower(&self) -> bool;
693
694 #[unsafe(method(isHeadless))]
696 #[unsafe(method_family = none)]
697 fn isHeadless(&self) -> bool;
698
699 #[unsafe(method(isRemovable))]
704 #[unsafe(method_family = none)]
705 fn isRemovable(&self) -> bool;
706
707 #[unsafe(method(hasUnifiedMemory))]
712 #[unsafe(method_family = none)]
713 fn hasUnifiedMemory(&self) -> bool;
714
715 #[unsafe(method(recommendedMaxWorkingSetSize))]
721 #[unsafe(method_family = none)]
722 fn recommendedMaxWorkingSetSize(&self) -> u64;
723
724 #[unsafe(method(location))]
729 #[unsafe(method_family = none)]
730 fn location(&self) -> MTLDeviceLocation;
731
732 #[unsafe(method(locationNumber))]
739 #[unsafe(method_family = none)]
740 fn locationNumber(&self) -> NSUInteger;
741
742 #[unsafe(method(maxTransferRate))]
750 #[unsafe(method_family = none)]
751 fn maxTransferRate(&self) -> u64;
752
753 #[unsafe(method(isDepth24Stencil8PixelFormatSupported))]
755 #[unsafe(method_family = none)]
756 fn isDepth24Stencil8PixelFormatSupported(&self) -> bool;
757
758 #[unsafe(method(readWriteTextureSupport))]
762 #[unsafe(method_family = none)]
763 fn readWriteTextureSupport(&self) -> MTLReadWriteTextureTier;
764
765 #[unsafe(method(argumentBuffersSupport))]
769 #[unsafe(method_family = none)]
770 fn argumentBuffersSupport(&self) -> MTLArgumentBuffersTier;
771
772 #[unsafe(method(areRasterOrderGroupsSupported))]
776 #[unsafe(method_family = none)]
777 fn areRasterOrderGroupsSupported(&self) -> bool;
778
779 #[unsafe(method(supports32BitFloatFiltering))]
783 #[unsafe(method_family = none)]
784 fn supports32BitFloatFiltering(&self) -> bool;
785
786 #[unsafe(method(supports32BitMSAA))]
790 #[unsafe(method_family = none)]
791 fn supports32BitMSAA(&self) -> bool;
792
793 #[unsafe(method(supportsQueryTextureLOD))]
797 #[unsafe(method_family = none)]
798 fn supportsQueryTextureLOD(&self) -> bool;
799
800 #[unsafe(method(supportsBCTextureCompression))]
804 #[unsafe(method_family = none)]
805 fn supportsBCTextureCompression(&self) -> bool;
806
807 #[unsafe(method(supportsPullModelInterpolation))]
811 #[unsafe(method_family = none)]
812 fn supportsPullModelInterpolation(&self) -> bool;
813
814 #[deprecated]
818 #[unsafe(method(areBarycentricCoordsSupported))]
819 #[unsafe(method_family = none)]
820 fn areBarycentricCoordsSupported(&self) -> bool;
821
822 #[unsafe(method(supportsShaderBarycentricCoordinates))]
826 #[unsafe(method_family = none)]
827 fn supportsShaderBarycentricCoordinates(&self) -> bool;
828
829 #[unsafe(method(currentAllocatedSize))]
831 #[unsafe(method_family = none)]
832 fn currentAllocatedSize(&self) -> NSUInteger;
833
834 #[cfg(feature = "MTLLogState")]
835 #[unsafe(method(newLogStateWithDescriptor:error:_))]
837 #[unsafe(method_family = new)]
838 fn newLogStateWithDescriptor_error(
839 &self,
840 descriptor: &MTLLogStateDescriptor,
841 ) -> Result<Retained<ProtocolObject<dyn MTLLogState>>, Retained<NSError>>;
842
843 #[cfg(feature = "MTLCommandQueue")]
844 #[unsafe(method(newCommandQueue))]
848 #[unsafe(method_family = new)]
849 fn newCommandQueue(&self) -> Option<Retained<ProtocolObject<dyn MTLCommandQueue>>>;
850
851 #[cfg(feature = "MTLCommandQueue")]
852 #[unsafe(method(newCommandQueueWithMaxCommandBufferCount:))]
856 #[unsafe(method_family = new)]
857 fn newCommandQueueWithMaxCommandBufferCount(
858 &self,
859 max_command_buffer_count: NSUInteger,
860 ) -> Option<Retained<ProtocolObject<dyn MTLCommandQueue>>>;
861
862 #[cfg(feature = "MTLCommandQueue")]
863 #[unsafe(method(newCommandQueueWithDescriptor:))]
865 #[unsafe(method_family = new)]
866 fn newCommandQueueWithDescriptor(
867 &self,
868 descriptor: &MTLCommandQueueDescriptor,
869 ) -> Option<Retained<ProtocolObject<dyn MTLCommandQueue>>>;
870
871 #[cfg(feature = "MTLTexture")]
872 #[unsafe(method(heapTextureSizeAndAlignWithDescriptor:))]
876 #[unsafe(method_family = none)]
877 fn heapTextureSizeAndAlignWithDescriptor(
878 &self,
879 desc: &MTLTextureDescriptor,
880 ) -> MTLSizeAndAlign;
881
882 #[cfg(feature = "MTLResource")]
883 #[unsafe(method(heapBufferSizeAndAlignWithLength:options:))]
887 #[unsafe(method_family = none)]
888 fn heapBufferSizeAndAlignWithLength_options(
889 &self,
890 length: NSUInteger,
891 options: MTLResourceOptions,
892 ) -> MTLSizeAndAlign;
893
894 #[cfg(all(feature = "MTLAllocation", feature = "MTLHeap"))]
895 #[unsafe(method(newHeapWithDescriptor:))]
897 #[unsafe(method_family = new)]
898 fn newHeapWithDescriptor(
899 &self,
900 descriptor: &MTLHeapDescriptor,
901 ) -> Option<Retained<ProtocolObject<dyn MTLHeap>>>;
902
903 #[cfg(all(
904 feature = "MTLAllocation",
905 feature = "MTLBuffer",
906 feature = "MTLResource"
907 ))]
908 #[unsafe(method(newBufferWithLength:options:))]
910 #[unsafe(method_family = new)]
911 fn newBufferWithLength_options(
912 &self,
913 length: NSUInteger,
914 options: MTLResourceOptions,
915 ) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
916
917 #[cfg(all(
918 feature = "MTLAllocation",
919 feature = "MTLBuffer",
920 feature = "MTLResource"
921 ))]
922 #[unsafe(method(newBufferWithBytes:length:options:))]
928 #[unsafe(method_family = new)]
929 unsafe fn newBufferWithBytes_length_options(
930 &self,
931 pointer: NonNull<c_void>,
932 length: NSUInteger,
933 options: MTLResourceOptions,
934 ) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
935
936 #[cfg(all(
937 feature = "MTLAllocation",
938 feature = "MTLBuffer",
939 feature = "MTLResource",
940 feature = "block2"
941 ))]
942 #[unsafe(method(newBufferWithBytesNoCopy:length:options:deallocator:))]
949 #[unsafe(method_family = new)]
950 unsafe fn newBufferWithBytesNoCopy_length_options_deallocator(
951 &self,
952 pointer: NonNull<c_void>,
953 length: NSUInteger,
954 options: MTLResourceOptions,
955 deallocator: Option<&block2::DynBlock<dyn Fn(NonNull<c_void>, NSUInteger)>>,
956 ) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
957
958 #[cfg(feature = "MTLDepthStencil")]
959 #[unsafe(method(newDepthStencilStateWithDescriptor:))]
961 #[unsafe(method_family = new)]
962 fn newDepthStencilStateWithDescriptor(
963 &self,
964 descriptor: &MTLDepthStencilDescriptor,
965 ) -> Option<Retained<ProtocolObject<dyn MTLDepthStencilState>>>;
966
967 #[cfg(all(
968 feature = "MTLAllocation",
969 feature = "MTLResource",
970 feature = "MTLTexture"
971 ))]
972 #[unsafe(method(newTextureWithDescriptor:))]
974 #[unsafe(method_family = new)]
975 fn newTextureWithDescriptor(
976 &self,
977 descriptor: &MTLTextureDescriptor,
978 ) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>;
979
980 #[cfg(all(
981 feature = "MTLAllocation",
982 feature = "MTLResource",
983 feature = "MTLTexture",
984 feature = "objc2-io-surface"
985 ))]
986 #[unsafe(method(newTextureWithDescriptor:iosurface:plane:))]
996 #[unsafe(method_family = new)]
997 fn newTextureWithDescriptor_iosurface_plane(
998 &self,
999 descriptor: &MTLTextureDescriptor,
1000 iosurface: &IOSurfaceRef,
1001 plane: NSUInteger,
1002 ) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>;
1003
1004 #[cfg(all(
1005 feature = "MTLAllocation",
1006 feature = "MTLResource",
1007 feature = "MTLTexture"
1008 ))]
1009 #[unsafe(method(newSharedTextureWithDescriptor:))]
1018 #[unsafe(method_family = new)]
1019 fn newSharedTextureWithDescriptor(
1020 &self,
1021 descriptor: &MTLTextureDescriptor,
1022 ) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>;
1023
1024 #[cfg(all(
1025 feature = "MTLAllocation",
1026 feature = "MTLResource",
1027 feature = "MTLTexture"
1028 ))]
1029 #[unsafe(method(newSharedTextureWithHandle:))]
1040 #[unsafe(method_family = new)]
1041 fn newSharedTextureWithHandle(
1042 &self,
1043 shared_handle: &MTLSharedTextureHandle,
1044 ) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>;
1045
1046 #[cfg(feature = "MTLSampler")]
1047 #[unsafe(method(newSamplerStateWithDescriptor:))]
1049 #[unsafe(method_family = new)]
1050 fn newSamplerStateWithDescriptor(
1051 &self,
1052 descriptor: &MTLSamplerDescriptor,
1053 ) -> Option<Retained<ProtocolObject<dyn MTLSamplerState>>>;
1054
1055 #[cfg(feature = "MTLLibrary")]
1056 #[unsafe(method(newDefaultLibrary))]
1060 #[unsafe(method_family = new)]
1061 fn newDefaultLibrary(&self) -> Option<Retained<ProtocolObject<dyn MTLLibrary>>>;
1062
1063 #[cfg(feature = "MTLLibrary")]
1064 #[unsafe(method(newDefaultLibraryWithBundle:error:_))]
1065 #[unsafe(method_family = new)]
1066 fn newDefaultLibraryWithBundle_error(
1067 &self,
1068 bundle: &NSBundle,
1069 ) -> Result<Retained<ProtocolObject<dyn MTLLibrary>>, Retained<NSError>>;
1070
1071 #[cfg(feature = "MTLLibrary")]
1072 #[deprecated = "Use -newLibraryWithURL:error: instead"]
1074 #[unsafe(method(newLibraryWithFile:error:_))]
1075 #[unsafe(method_family = new)]
1076 fn newLibraryWithFile_error(
1077 &self,
1078 filepath: &NSString,
1079 ) -> Result<Retained<ProtocolObject<dyn MTLLibrary>>, Retained<NSError>>;
1080
1081 #[cfg(feature = "MTLLibrary")]
1082 #[unsafe(method(newLibraryWithURL:error:_))]
1084 #[unsafe(method_family = new)]
1085 fn newLibraryWithURL_error(
1086 &self,
1087 url: &NSURL,
1088 ) -> Result<Retained<ProtocolObject<dyn MTLLibrary>>, Retained<NSError>>;
1089
1090 #[cfg(all(feature = "MTLLibrary", feature = "dispatch2"))]
1091 #[unsafe(method(newLibraryWithData:error:_))]
1097 #[unsafe(method_family = new)]
1098 fn newLibraryWithData_error(
1099 &self,
1100 data: &DispatchData,
1101 ) -> Result<Retained<ProtocolObject<dyn MTLLibrary>>, Retained<NSError>>;
1102
1103 #[cfg(feature = "MTLLibrary")]
1104 #[unsafe(method(newLibraryWithSource:options:error:_))]
1106 #[unsafe(method_family = new)]
1107 fn newLibraryWithSource_options_error(
1108 &self,
1109 source: &NSString,
1110 options: Option<&MTLCompileOptions>,
1111 ) -> Result<Retained<ProtocolObject<dyn MTLLibrary>>, Retained<NSError>>;
1112
1113 #[cfg(all(feature = "MTLLibrary", feature = "block2"))]
1114 #[unsafe(method(newLibraryWithSource:options:completionHandler:))]
1120 #[unsafe(method_family = none)]
1121 unsafe fn newLibraryWithSource_options_completionHandler(
1122 &self,
1123 source: &NSString,
1124 options: Option<&MTLCompileOptions>,
1125 completion_handler: MTLNewLibraryCompletionHandler,
1126 );
1127
1128 #[cfg(all(feature = "MTLFunctionStitching", feature = "MTLLibrary"))]
1129 #[unsafe(method(newLibraryWithStitchedDescriptor:error:_))]
1131 #[unsafe(method_family = new)]
1132 fn newLibraryWithStitchedDescriptor_error(
1133 &self,
1134 descriptor: &MTLStitchedLibraryDescriptor,
1135 ) -> Result<Retained<ProtocolObject<dyn MTLLibrary>>, Retained<NSError>>;
1136
1137 #[cfg(all(
1138 feature = "MTLFunctionStitching",
1139 feature = "MTLLibrary",
1140 feature = "block2"
1141 ))]
1142 #[unsafe(method(newLibraryWithStitchedDescriptor:completionHandler:))]
1148 #[unsafe(method_family = none)]
1149 unsafe fn newLibraryWithStitchedDescriptor_completionHandler(
1150 &self,
1151 descriptor: &MTLStitchedLibraryDescriptor,
1152 completion_handler: MTLNewLibraryCompletionHandler,
1153 );
1154
1155 #[cfg(all(feature = "MTLAllocation", feature = "MTLRenderPipeline"))]
1156 #[unsafe(method(newRenderPipelineStateWithDescriptor:error:_))]
1158 #[unsafe(method_family = new)]
1159 fn newRenderPipelineStateWithDescriptor_error(
1160 &self,
1161 descriptor: &MTLRenderPipelineDescriptor,
1162 ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>>;
1163
1164 #[cfg(all(
1165 feature = "MTLAllocation",
1166 feature = "MTLLibrary",
1167 feature = "MTLRenderPipeline"
1168 ))]
1169 #[unsafe(method(newRenderPipelineStateWithDescriptor:options:reflection:error:_))]
1171 #[unsafe(method_family = new)]
1172 fn newRenderPipelineStateWithDescriptor_options_reflection_error(
1173 &self,
1174 descriptor: &MTLRenderPipelineDescriptor,
1175 options: MTLPipelineOption,
1176 reflection: Option<&mut Option<Retained<MTLAutoreleasedRenderPipelineReflection>>>,
1177 ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>>;
1178
1179 #[cfg(all(
1180 feature = "MTLAllocation",
1181 feature = "MTLLibrary",
1182 feature = "MTLRenderPipeline",
1183 feature = "block2"
1184 ))]
1185 #[unsafe(method(newRenderPipelineStateWithDescriptor:completionHandler:))]
1191 #[unsafe(method_family = none)]
1192 unsafe fn newRenderPipelineStateWithDescriptor_completionHandler(
1193 &self,
1194 descriptor: &MTLRenderPipelineDescriptor,
1195 completion_handler: MTLNewRenderPipelineStateCompletionHandler,
1196 );
1197
1198 #[cfg(all(
1199 feature = "MTLAllocation",
1200 feature = "MTLLibrary",
1201 feature = "MTLRenderPipeline",
1202 feature = "block2"
1203 ))]
1204 #[unsafe(method(newRenderPipelineStateWithDescriptor:options:completionHandler:))]
1210 #[unsafe(method_family = none)]
1211 unsafe fn newRenderPipelineStateWithDescriptor_options_completionHandler(
1212 &self,
1213 descriptor: &MTLRenderPipelineDescriptor,
1214 options: MTLPipelineOption,
1215 completion_handler: MTLNewRenderPipelineStateWithReflectionCompletionHandler,
1216 );
1217
1218 #[cfg(all(
1219 feature = "MTLAllocation",
1220 feature = "MTLComputePipeline",
1221 feature = "MTLLibrary"
1222 ))]
1223 #[unsafe(method(newComputePipelineStateWithFunction:error:_))]
1225 #[unsafe(method_family = new)]
1226 fn newComputePipelineStateWithFunction_error(
1227 &self,
1228 compute_function: &ProtocolObject<dyn MTLFunction>,
1229 ) -> Result<Retained<ProtocolObject<dyn MTLComputePipelineState>>, Retained<NSError>>;
1230
1231 #[cfg(all(
1232 feature = "MTLAllocation",
1233 feature = "MTLComputePipeline",
1234 feature = "MTLLibrary"
1235 ))]
1236 #[unsafe(method(newComputePipelineStateWithFunction:options:reflection:error:_))]
1243 #[unsafe(method_family = new)]
1244 unsafe fn newComputePipelineStateWithFunction_options_reflection_error(
1245 &self,
1246 compute_function: &ProtocolObject<dyn MTLFunction>,
1247 options: MTLPipelineOption,
1248 reflection: Option<&mut Option<Retained<MTLAutoreleasedComputePipelineReflection>>>,
1249 ) -> Result<Retained<ProtocolObject<dyn MTLComputePipelineState>>, Retained<NSError>>;
1250
1251 #[cfg(all(
1252 feature = "MTLAllocation",
1253 feature = "MTLComputePipeline",
1254 feature = "MTLLibrary",
1255 feature = "block2"
1256 ))]
1257 #[unsafe(method(newComputePipelineStateWithFunction:completionHandler:))]
1265 #[unsafe(method_family = none)]
1266 unsafe fn newComputePipelineStateWithFunction_completionHandler(
1267 &self,
1268 compute_function: &ProtocolObject<dyn MTLFunction>,
1269 completion_handler: MTLNewComputePipelineStateCompletionHandler,
1270 );
1271
1272 #[cfg(all(
1273 feature = "MTLAllocation",
1274 feature = "MTLComputePipeline",
1275 feature = "MTLLibrary",
1276 feature = "block2"
1277 ))]
1278 #[unsafe(method(newComputePipelineStateWithFunction:options:completionHandler:))]
1286 #[unsafe(method_family = none)]
1287 unsafe fn newComputePipelineStateWithFunction_options_completionHandler(
1288 &self,
1289 compute_function: &ProtocolObject<dyn MTLFunction>,
1290 options: MTLPipelineOption,
1291 completion_handler: MTLNewComputePipelineStateWithReflectionCompletionHandler,
1292 );
1293
1294 #[cfg(all(
1295 feature = "MTLAllocation",
1296 feature = "MTLComputePipeline",
1297 feature = "MTLLibrary"
1298 ))]
1299 #[unsafe(method(newComputePipelineStateWithDescriptor:options:reflection:error:_))]
1301 #[unsafe(method_family = new)]
1302 fn newComputePipelineStateWithDescriptor_options_reflection_error(
1303 &self,
1304 descriptor: &MTLComputePipelineDescriptor,
1305 options: MTLPipelineOption,
1306 reflection: Option<&mut Option<Retained<MTLAutoreleasedComputePipelineReflection>>>,
1307 ) -> Result<Retained<ProtocolObject<dyn MTLComputePipelineState>>, Retained<NSError>>;
1308
1309 #[cfg(all(
1310 feature = "MTLAllocation",
1311 feature = "MTLComputePipeline",
1312 feature = "MTLLibrary",
1313 feature = "block2"
1314 ))]
1315 #[unsafe(method(newComputePipelineStateWithDescriptor:options:completionHandler:))]
1321 #[unsafe(method_family = none)]
1322 unsafe fn newComputePipelineStateWithDescriptor_options_completionHandler(
1323 &self,
1324 descriptor: &MTLComputePipelineDescriptor,
1325 options: MTLPipelineOption,
1326 completion_handler: MTLNewComputePipelineStateWithReflectionCompletionHandler,
1327 );
1328
1329 #[cfg(feature = "MTLFence")]
1330 #[unsafe(method(newFence))]
1332 #[unsafe(method_family = new)]
1333 fn newFence(&self) -> Option<Retained<ProtocolObject<dyn MTLFence>>>;
1334
1335 #[deprecated = "Use supportsFamily instead"]
1337 #[unsafe(method(supportsFeatureSet:))]
1338 #[unsafe(method_family = none)]
1339 fn supportsFeatureSet(&self, feature_set: MTLFeatureSet) -> bool;
1340
1341 #[unsafe(method(supportsFamily:))]
1343 #[unsafe(method_family = none)]
1344 fn supportsFamily(&self, gpu_family: MTLGPUFamily) -> bool;
1345
1346 #[unsafe(method(supportsTextureSampleCount:))]
1350 #[unsafe(method_family = none)]
1351 fn supportsTextureSampleCount(&self, sample_count: NSUInteger) -> bool;
1352
1353 #[cfg(feature = "MTLPixelFormat")]
1354 #[unsafe(method(minimumLinearTextureAlignmentForPixelFormat:))]
1356 #[unsafe(method_family = none)]
1357 fn minimumLinearTextureAlignmentForPixelFormat(&self, format: MTLPixelFormat)
1358 -> NSUInteger;
1359
1360 #[cfg(feature = "MTLPixelFormat")]
1361 #[unsafe(method(minimumTextureBufferAlignmentForPixelFormat:))]
1363 #[unsafe(method_family = none)]
1364 fn minimumTextureBufferAlignmentForPixelFormat(&self, format: MTLPixelFormat)
1365 -> NSUInteger;
1366
1367 #[cfg(all(
1368 feature = "MTLAllocation",
1369 feature = "MTLLibrary",
1370 feature = "MTLRenderPipeline"
1371 ))]
1372 #[unsafe(method(newRenderPipelineStateWithTileDescriptor:options:reflection:error:_))]
1374 #[unsafe(method_family = new)]
1375 fn newRenderPipelineStateWithTileDescriptor_options_reflection_error(
1376 &self,
1377 descriptor: &MTLTileRenderPipelineDescriptor,
1378 options: MTLPipelineOption,
1379 reflection: Option<&mut Option<Retained<MTLAutoreleasedRenderPipelineReflection>>>,
1380 ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>>;
1381
1382 #[cfg(all(
1383 feature = "MTLAllocation",
1384 feature = "MTLLibrary",
1385 feature = "MTLRenderPipeline",
1386 feature = "block2"
1387 ))]
1388 #[unsafe(method(newRenderPipelineStateWithTileDescriptor:options:completionHandler:))]
1394 #[unsafe(method_family = none)]
1395 unsafe fn newRenderPipelineStateWithTileDescriptor_options_completionHandler(
1396 &self,
1397 descriptor: &MTLTileRenderPipelineDescriptor,
1398 options: MTLPipelineOption,
1399 completion_handler: MTLNewRenderPipelineStateWithReflectionCompletionHandler,
1400 );
1401
1402 #[cfg(all(
1403 feature = "MTLAllocation",
1404 feature = "MTLLibrary",
1405 feature = "MTLRenderPipeline"
1406 ))]
1407 #[unsafe(method(newRenderPipelineStateWithMeshDescriptor:options:reflection:error:_))]
1409 #[unsafe(method_family = new)]
1410 fn newRenderPipelineStateWithMeshDescriptor_options_reflection_error(
1411 &self,
1412 descriptor: &MTLMeshRenderPipelineDescriptor,
1413 options: MTLPipelineOption,
1414 reflection: Option<&mut Option<Retained<MTLAutoreleasedRenderPipelineReflection>>>,
1415 ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>>;
1416
1417 #[cfg(all(
1418 feature = "MTLAllocation",
1419 feature = "MTLLibrary",
1420 feature = "MTLRenderPipeline",
1421 feature = "block2"
1422 ))]
1423 #[unsafe(method(newRenderPipelineStateWithMeshDescriptor:options:completionHandler:))]
1429 #[unsafe(method_family = none)]
1430 unsafe fn newRenderPipelineStateWithMeshDescriptor_options_completionHandler(
1431 &self,
1432 descriptor: &MTLMeshRenderPipelineDescriptor,
1433 options: MTLPipelineOption,
1434 completion_handler: MTLNewRenderPipelineStateWithReflectionCompletionHandler,
1435 );
1436
1437 #[unsafe(method(maxThreadgroupMemoryLength))]
1439 #[unsafe(method_family = none)]
1440 fn maxThreadgroupMemoryLength(&self) -> NSUInteger;
1441
1442 #[unsafe(method(maxArgumentBufferSamplerCount))]
1446 #[unsafe(method_family = none)]
1447 fn maxArgumentBufferSamplerCount(&self) -> NSUInteger;
1448
1449 #[unsafe(method(areProgrammableSamplePositionsSupported))]
1453 #[unsafe(method_family = none)]
1454 fn areProgrammableSamplePositionsSupported(&self) -> bool;
1455
1456 #[cfg(feature = "MTLTypes")]
1457 #[unsafe(method(getDefaultSamplePositions:count:))]
1468 #[unsafe(method_family = none)]
1469 unsafe fn getDefaultSamplePositions_count(
1470 &self,
1471 positions: NonNull<MTLSamplePosition>,
1472 count: NSUInteger,
1473 );
1474
1475 #[cfg(feature = "MTLArgumentEncoder")]
1476 #[unsafe(method(newArgumentEncoderWithArguments:))]
1478 #[unsafe(method_family = new)]
1479 fn newArgumentEncoderWithArguments(
1480 &self,
1481 arguments: &NSArray<MTLArgumentDescriptor>,
1482 ) -> Option<Retained<ProtocolObject<dyn MTLArgumentEncoder>>>;
1483
1484 #[unsafe(method(supportsRasterizationRateMapWithLayerCount:))]
1494 #[unsafe(method_family = none)]
1495 unsafe fn supportsRasterizationRateMapWithLayerCount(
1496 &self,
1497 layer_count: NSUInteger,
1498 ) -> bool;
1499
1500 #[cfg(feature = "MTLRasterizationRate")]
1501 #[unsafe(method(newRasterizationRateMapWithDescriptor:))]
1507 #[unsafe(method_family = new)]
1508 fn newRasterizationRateMapWithDescriptor(
1509 &self,
1510 descriptor: &MTLRasterizationRateMapDescriptor,
1511 ) -> Option<Retained<ProtocolObject<dyn MTLRasterizationRateMap>>>;
1512
1513 #[cfg(all(
1514 feature = "MTLAllocation",
1515 feature = "MTLIndirectCommandBuffer",
1516 feature = "MTLResource"
1517 ))]
1518 #[unsafe(method(newIndirectCommandBufferWithDescriptor:maxCommandCount:options:))]
1532 #[unsafe(method_family = new)]
1533 unsafe fn newIndirectCommandBufferWithDescriptor_maxCommandCount_options(
1534 &self,
1535 descriptor: &MTLIndirectCommandBufferDescriptor,
1536 max_count: NSUInteger,
1537 options: MTLResourceOptions,
1538 ) -> Option<Retained<ProtocolObject<dyn MTLIndirectCommandBuffer>>>;
1539
1540 #[cfg(feature = "MTLEvent")]
1541 #[unsafe(method(newEvent))]
1543 #[unsafe(method_family = new)]
1544 fn newEvent(&self) -> Option<Retained<ProtocolObject<dyn MTLEvent>>>;
1545
1546 #[cfg(feature = "MTLEvent")]
1547 #[unsafe(method(newSharedEvent))]
1549 #[unsafe(method_family = new)]
1550 fn newSharedEvent(&self) -> Option<Retained<ProtocolObject<dyn MTLSharedEvent>>>;
1551
1552 #[cfg(feature = "MTLEvent")]
1553 #[unsafe(method(newSharedEventWithHandle:))]
1555 #[unsafe(method_family = new)]
1556 fn newSharedEventWithHandle(
1557 &self,
1558 shared_event_handle: &MTLSharedEventHandle,
1559 ) -> Option<Retained<ProtocolObject<dyn MTLSharedEvent>>>;
1560
1561 #[unsafe(method(peerGroupID))]
1564 #[unsafe(method_family = none)]
1565 fn peerGroupID(&self) -> u64;
1566
1567 #[unsafe(method(peerIndex))]
1570 #[unsafe(method_family = none)]
1571 fn peerIndex(&self) -> u32;
1572
1573 #[unsafe(method(peerCount))]
1575 #[unsafe(method_family = none)]
1576 fn peerCount(&self) -> u32;
1577
1578 #[cfg(feature = "MTLIOCommandQueue")]
1579 #[deprecated]
1584 #[unsafe(method(newIOHandleWithURL:error:_))]
1585 #[unsafe(method_family = new)]
1586 fn newIOHandleWithURL_error(
1587 &self,
1588 url: &NSURL,
1589 ) -> Result<Retained<ProtocolObject<dyn MTLIOFileHandle>>, Retained<NSError>>;
1590
1591 #[cfg(feature = "MTLIOCommandQueue")]
1592 #[unsafe(method(newIOCommandQueueWithDescriptor:error:_))]
1596 #[unsafe(method_family = new)]
1597 fn newIOCommandQueueWithDescriptor_error(
1598 &self,
1599 descriptor: &MTLIOCommandQueueDescriptor,
1600 ) -> Result<Retained<ProtocolObject<dyn MTLIOCommandQueue>>, Retained<NSError>>;
1601
1602 #[cfg(feature = "MTLIOCommandQueue")]
1603 #[deprecated]
1609 #[unsafe(method(newIOHandleWithURL:compressionMethod:error:_))]
1610 #[unsafe(method_family = new)]
1611 fn newIOHandleWithURL_compressionMethod_error(
1612 &self,
1613 url: &NSURL,
1614 compression_method: MTLIOCompressionMethod,
1615 ) -> Result<Retained<ProtocolObject<dyn MTLIOFileHandle>>, Retained<NSError>>;
1616
1617 #[cfg(feature = "MTLIOCommandQueue")]
1618 #[unsafe(method(newIOFileHandleWithURL:error:_))]
1623 #[unsafe(method_family = new)]
1624 fn newIOFileHandleWithURL_error(
1625 &self,
1626 url: &NSURL,
1627 ) -> Result<Retained<ProtocolObject<dyn MTLIOFileHandle>>, Retained<NSError>>;
1628
1629 #[cfg(feature = "MTLIOCommandQueue")]
1630 #[unsafe(method(newIOFileHandleWithURL:compressionMethod:error:_))]
1636 #[unsafe(method_family = new)]
1637 fn newIOFileHandleWithURL_compressionMethod_error(
1638 &self,
1639 url: &NSURL,
1640 compression_method: MTLIOCompressionMethod,
1641 ) -> Result<Retained<ProtocolObject<dyn MTLIOFileHandle>>, Retained<NSError>>;
1642
1643 #[cfg(all(
1644 feature = "MTLPixelFormat",
1645 feature = "MTLTexture",
1646 feature = "MTLTypes"
1647 ))]
1648 #[unsafe(method(sparseTileSizeWithTextureType:pixelFormat:sampleCount:))]
1654 #[unsafe(method_family = none)]
1655 unsafe fn sparseTileSizeWithTextureType_pixelFormat_sampleCount(
1656 &self,
1657 texture_type: MTLTextureType,
1658 pixel_format: MTLPixelFormat,
1659 sample_count: NSUInteger,
1660 ) -> MTLSize;
1661
1662 #[unsafe(method(sparseTileSizeInBytes))]
1664 #[unsafe(method_family = none)]
1665 fn sparseTileSizeInBytes(&self) -> NSUInteger;
1666
1667 #[cfg(feature = "MTLTypes")]
1668 #[optional]
1677 #[unsafe(method(convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions:))]
1678 #[unsafe(method_family = none)]
1679 unsafe fn convertSparsePixelRegions_toTileRegions_withTileSize_alignmentMode_numRegions(
1680 &self,
1681 pixel_regions: NonNull<MTLRegion>,
1682 tile_regions: NonNull<MTLRegion>,
1683 tile_size: MTLSize,
1684 mode: MTLSparseTextureRegionAlignmentMode,
1685 num_regions: NSUInteger,
1686 );
1687
1688 #[cfg(feature = "MTLTypes")]
1689 #[optional]
1698 #[unsafe(method(convertSparseTileRegions:toPixelRegions:withTileSize:numRegions:))]
1699 #[unsafe(method_family = none)]
1700 unsafe fn convertSparseTileRegions_toPixelRegions_withTileSize_numRegions(
1701 &self,
1702 tile_regions: NonNull<MTLRegion>,
1703 pixel_regions: NonNull<MTLRegion>,
1704 tile_size: MTLSize,
1705 num_regions: NSUInteger,
1706 );
1707
1708 #[cfg(feature = "MTLResource")]
1709 #[unsafe(method(sparseTileSizeInBytesForSparsePageSize:))]
1711 #[unsafe(method_family = none)]
1712 fn sparseTileSizeInBytesForSparsePageSize(
1713 &self,
1714 sparse_page_size: MTLSparsePageSize,
1715 ) -> NSUInteger;
1716
1717 #[cfg(all(
1718 feature = "MTLPixelFormat",
1719 feature = "MTLResource",
1720 feature = "MTLTexture",
1721 feature = "MTLTypes"
1722 ))]
1723 #[unsafe(method(sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize:))]
1729 #[unsafe(method_family = none)]
1730 unsafe fn sparseTileSizeWithTextureType_pixelFormat_sampleCount_sparsePageSize(
1731 &self,
1732 texture_type: MTLTextureType,
1733 pixel_format: MTLPixelFormat,
1734 sample_count: NSUInteger,
1735 sparse_page_size: MTLSparsePageSize,
1736 ) -> MTLSize;
1737
1738 #[unsafe(method(maxBufferLength))]
1739 #[unsafe(method_family = none)]
1740 fn maxBufferLength(&self) -> NSUInteger;
1741
1742 #[cfg(feature = "MTLCounters")]
1743 #[unsafe(method(counterSets))]
1745 #[unsafe(method_family = none)]
1746 fn counterSets(&self) -> Option<Retained<NSArray<ProtocolObject<dyn MTLCounterSet>>>>;
1747
1748 #[cfg(feature = "MTLCounters")]
1749 #[unsafe(method(newCounterSampleBufferWithDescriptor:error:_))]
1757 #[unsafe(method_family = new)]
1758 fn newCounterSampleBufferWithDescriptor_error(
1759 &self,
1760 descriptor: &MTLCounterSampleBufferDescriptor,
1761 ) -> Result<Retained<ProtocolObject<dyn MTLCounterSampleBuffer>>, Retained<NSError>>;
1762
1763 #[unsafe(method(sampleTimestamps:gpuTimestamp:))]
1774 #[unsafe(method_family = none)]
1775 unsafe fn sampleTimestamps_gpuTimestamp(
1776 &self,
1777 cpu_timestamp: NonNull<MTLTimestamp>,
1778 gpu_timestamp: NonNull<MTLTimestamp>,
1779 );
1780
1781 #[cfg(all(feature = "MTLArgument", feature = "MTLArgumentEncoder"))]
1782 #[unsafe(method(newArgumentEncoderWithBufferBinding:))]
1783 #[unsafe(method_family = new)]
1784 fn newArgumentEncoderWithBufferBinding(
1785 &self,
1786 buffer_binding: &ProtocolObject<dyn MTLBufferBinding>,
1787 ) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>>;
1788
1789 #[unsafe(method(supportsCounterSampling:))]
1795 #[unsafe(method_family = none)]
1796 fn supportsCounterSampling(&self, sampling_point: MTLCounterSamplingPoint) -> bool;
1797
1798 #[unsafe(method(supportsVertexAmplificationCount:))]
1804 #[unsafe(method_family = none)]
1805 fn supportsVertexAmplificationCount(&self, count: NSUInteger) -> bool;
1806
1807 #[unsafe(method(supportsDynamicLibraries))]
1811 #[unsafe(method_family = none)]
1812 fn supportsDynamicLibraries(&self) -> bool;
1813
1814 #[unsafe(method(supportsRenderDynamicLibraries))]
1818 #[unsafe(method_family = none)]
1819 fn supportsRenderDynamicLibraries(&self) -> bool;
1820
1821 #[cfg(all(feature = "MTLDynamicLibrary", feature = "MTLLibrary"))]
1822 #[unsafe(method(newDynamicLibrary:error:_))]
1832 #[unsafe(method_family = new)]
1833 fn newDynamicLibrary_error(
1834 &self,
1835 library: &ProtocolObject<dyn MTLLibrary>,
1836 ) -> Result<Retained<ProtocolObject<dyn MTLDynamicLibrary>>, Retained<NSError>>;
1837
1838 #[cfg(feature = "MTLDynamicLibrary")]
1839 #[unsafe(method(newDynamicLibraryWithURL:error:_))]
1849 #[unsafe(method_family = new)]
1850 fn newDynamicLibraryWithURL_error(
1851 &self,
1852 url: &NSURL,
1853 ) -> Result<Retained<ProtocolObject<dyn MTLDynamicLibrary>>, Retained<NSError>>;
1854
1855 #[cfg(feature = "MTLBinaryArchive")]
1856 #[unsafe(method(newBinaryArchiveWithDescriptor:error:_))]
1866 #[unsafe(method_family = new)]
1867 fn newBinaryArchiveWithDescriptor_error(
1868 &self,
1869 descriptor: &MTLBinaryArchiveDescriptor,
1870 ) -> Result<Retained<ProtocolObject<dyn MTLBinaryArchive>>, Retained<NSError>>;
1871
1872 #[unsafe(method(supportsRaytracing))]
1876 #[unsafe(method_family = none)]
1877 fn supportsRaytracing(&self) -> bool;
1878
1879 #[cfg(feature = "MTLAccelerationStructure")]
1880 #[unsafe(method(accelerationStructureSizesWithDescriptor:))]
1881 #[unsafe(method_family = none)]
1882 fn accelerationStructureSizesWithDescriptor(
1883 &self,
1884 descriptor: &MTLAccelerationStructureDescriptor,
1885 ) -> MTLAccelerationStructureSizes;
1886
1887 #[cfg(all(
1888 feature = "MTLAccelerationStructure",
1889 feature = "MTLAllocation",
1890 feature = "MTLResource"
1891 ))]
1892 #[unsafe(method(newAccelerationStructureWithSize:))]
1893 #[unsafe(method_family = new)]
1894 fn newAccelerationStructureWithSize(
1895 &self,
1896 size: NSUInteger,
1897 ) -> Option<Retained<ProtocolObject<dyn MTLAccelerationStructure>>>;
1898
1899 #[cfg(all(
1900 feature = "MTLAccelerationStructure",
1901 feature = "MTLAllocation",
1902 feature = "MTLResource"
1903 ))]
1904 #[unsafe(method(newAccelerationStructureWithDescriptor:))]
1905 #[unsafe(method_family = new)]
1906 fn newAccelerationStructureWithDescriptor(
1907 &self,
1908 descriptor: &MTLAccelerationStructureDescriptor,
1909 ) -> Option<Retained<ProtocolObject<dyn MTLAccelerationStructure>>>;
1910
1911 #[unsafe(method(heapAccelerationStructureSizeAndAlignWithSize:))]
1919 #[unsafe(method_family = none)]
1920 unsafe fn heapAccelerationStructureSizeAndAlignWithSize(
1921 &self,
1922 size: NSUInteger,
1923 ) -> MTLSizeAndAlign;
1924
1925 #[cfg(feature = "MTLAccelerationStructure")]
1926 #[unsafe(method(heapAccelerationStructureSizeAndAlignWithDescriptor:))]
1930 #[unsafe(method_family = none)]
1931 fn heapAccelerationStructureSizeAndAlignWithDescriptor(
1932 &self,
1933 descriptor: &MTLAccelerationStructureDescriptor,
1934 ) -> MTLSizeAndAlign;
1935
1936 #[unsafe(method(supportsFunctionPointers))]
1940 #[unsafe(method_family = none)]
1941 fn supportsFunctionPointers(&self) -> bool;
1942
1943 #[unsafe(method(supportsFunctionPointersFromRender))]
1947 #[unsafe(method_family = none)]
1948 fn supportsFunctionPointersFromRender(&self) -> bool;
1949
1950 #[unsafe(method(supportsRaytracingFromRender))]
1954 #[unsafe(method_family = none)]
1955 fn supportsRaytracingFromRender(&self) -> bool;
1956
1957 #[unsafe(method(supportsPrimitiveMotionBlur))]
1961 #[unsafe(method_family = none)]
1962 fn supportsPrimitiveMotionBlur(&self) -> bool;
1963
1964 #[unsafe(method(shouldMaximizeConcurrentCompilation))]
1968 #[unsafe(method_family = none)]
1969 fn shouldMaximizeConcurrentCompilation(&self) -> bool;
1970
1971 #[unsafe(method(setShouldMaximizeConcurrentCompilation:))]
1973 #[unsafe(method_family = none)]
1974 fn setShouldMaximizeConcurrentCompilation(
1975 &self,
1976 should_maximize_concurrent_compilation: bool,
1977 );
1978
1979 #[unsafe(method(maximumConcurrentCompilationTaskCount))]
1983 #[unsafe(method_family = none)]
1984 fn maximumConcurrentCompilationTaskCount(&self) -> NSUInteger;
1985
1986 #[cfg(feature = "MTLResidencySet")]
1987 #[unsafe(method(newResidencySetWithDescriptor:error:_))]
1989 #[unsafe(method_family = new)]
1990 fn newResidencySetWithDescriptor_error(
1991 &self,
1992 desc: &MTLResidencySetDescriptor,
1993 ) -> Result<Retained<ProtocolObject<dyn MTLResidencySet>>, Retained<NSError>>;
1994
1995 #[cfg(feature = "MTLTensor")]
1996 #[unsafe(method(tensorSizeAndAlignWithDescriptor:))]
2002 #[unsafe(method_family = none)]
2003 fn tensorSizeAndAlignWithDescriptor(
2004 &self,
2005 descriptor: &MTLTensorDescriptor,
2006 ) -> MTLSizeAndAlign;
2007
2008 #[cfg(all(
2009 feature = "MTLAllocation",
2010 feature = "MTLResource",
2011 feature = "MTLTensor"
2012 ))]
2013 #[unsafe(method(newTensorWithDescriptor:error:_))]
2020 #[unsafe(method_family = new)]
2021 fn newTensorWithDescriptor_error(
2022 &self,
2023 descriptor: &MTLTensorDescriptor,
2024 ) -> Result<Retained<ProtocolObject<dyn MTLTensor>>, Retained<NSError>>;
2025
2026 #[cfg(all(feature = "MTLFunctionHandle", feature = "MTLLibrary"))]
2027 #[unsafe(method(functionHandleWithFunction:))]
2034 #[unsafe(method_family = none)]
2035 unsafe fn functionHandleWithFunction(
2036 &self,
2037 function: &ProtocolObject<dyn MTLFunction>,
2038 ) -> Option<Retained<ProtocolObject<dyn MTLFunctionHandle>>>;
2039
2040 #[cfg(feature = "MTL4CommandAllocator")]
2041 #[unsafe(method(newCommandAllocator))]
2045 #[unsafe(method_family = new)]
2046 fn newCommandAllocator(&self)
2047 -> Option<Retained<ProtocolObject<dyn MTL4CommandAllocator>>>;
2048
2049 #[cfg(feature = "MTL4CommandAllocator")]
2050 #[unsafe(method(newCommandAllocatorWithDescriptor:error:_))]
2060 #[unsafe(method_family = new)]
2061 fn newCommandAllocatorWithDescriptor_error(
2062 &self,
2063 descriptor: &MTL4CommandAllocatorDescriptor,
2064 ) -> Result<Retained<ProtocolObject<dyn MTL4CommandAllocator>>, Retained<NSError>>;
2065
2066 #[cfg(feature = "MTL4CommandQueue")]
2067 #[unsafe(method(newMTL4CommandQueue))]
2071 #[unsafe(method_family = new)]
2072 fn newMTL4CommandQueue(&self) -> Option<Retained<ProtocolObject<dyn MTL4CommandQueue>>>;
2073
2074 #[cfg(feature = "MTL4CommandQueue")]
2075 #[unsafe(method(newMTL4CommandQueueWithDescriptor:error:_))]
2085 #[unsafe(method_family = new)]
2086 fn newMTL4CommandQueueWithDescriptor_error(
2087 &self,
2088 descriptor: &MTL4CommandQueueDescriptor,
2089 ) -> Result<Retained<ProtocolObject<dyn MTL4CommandQueue>>, Retained<NSError>>;
2090
2091 #[cfg(feature = "MTL4CommandBuffer")]
2092 #[unsafe(method(newCommandBuffer))]
2096 #[unsafe(method_family = new)]
2097 fn newCommandBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTL4CommandBuffer>>>;
2098
2099 #[cfg(feature = "MTL4ArgumentTable")]
2100 #[unsafe(method(newArgumentTableWithDescriptor:error:_))]
2110 #[unsafe(method_family = new)]
2111 fn newArgumentTableWithDescriptor_error(
2112 &self,
2113 descriptor: &MTL4ArgumentTableDescriptor,
2114 ) -> Result<Retained<ProtocolObject<dyn MTL4ArgumentTable>>, Retained<NSError>>;
2115
2116 #[cfg(all(feature = "MTLResourceViewPool", feature = "MTLTextureViewPool"))]
2117 #[unsafe(method(newTextureViewPoolWithDescriptor:error:_))]
2127 #[unsafe(method_family = new)]
2128 fn newTextureViewPoolWithDescriptor_error(
2129 &self,
2130 descriptor: &MTLResourceViewPoolDescriptor,
2131 ) -> Result<Retained<ProtocolObject<dyn MTLTextureViewPool>>, Retained<NSError>>;
2132
2133 #[cfg(feature = "MTL4Compiler")]
2134 #[unsafe(method(newCompilerWithDescriptor:error:_))]
2144 #[unsafe(method_family = new)]
2145 fn newCompilerWithDescriptor_error(
2146 &self,
2147 descriptor: &MTL4CompilerDescriptor,
2148 ) -> Result<Retained<ProtocolObject<dyn MTL4Compiler>>, Retained<NSError>>;
2149
2150 #[cfg(feature = "MTL4Archive")]
2151 #[unsafe(method(newArchiveWithURL:error:_))]
2160 #[unsafe(method_family = new)]
2161 fn newArchiveWithURL_error(
2162 &self,
2163 url: &NSURL,
2164 ) -> Result<Retained<ProtocolObject<dyn MTL4Archive>>, Retained<NSError>>;
2165
2166 #[cfg(feature = "MTL4PipelineDataSetSerializer")]
2167 #[unsafe(method(newPipelineDataSetSerializerWithDescriptor:))]
2174 #[unsafe(method_family = new)]
2175 fn newPipelineDataSetSerializerWithDescriptor(
2176 &self,
2177 descriptor: &MTL4PipelineDataSetSerializerDescriptor,
2178 ) -> Retained<ProtocolObject<dyn MTL4PipelineDataSetSerializer>>;
2179
2180 #[cfg(all(
2181 feature = "MTLAllocation",
2182 feature = "MTLBuffer",
2183 feature = "MTLResource"
2184 ))]
2185 #[unsafe(method(newBufferWithLength:options:placementSparsePageSize:))]
2201 #[unsafe(method_family = new)]
2202 unsafe fn newBufferWithLength_options_placementSparsePageSize(
2203 &self,
2204 length: NSUInteger,
2205 options: MTLResourceOptions,
2206 placement_sparse_page_size: MTLSparsePageSize,
2207 ) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
2208
2209 #[cfg(feature = "MTL4Counters")]
2210 #[unsafe(method(newCounterHeapWithDescriptor:error:_))]
2219 #[unsafe(method_family = new)]
2220 fn newCounterHeapWithDescriptor_error(
2221 &self,
2222 descriptor: &MTL4CounterHeapDescriptor,
2223 ) -> Result<Retained<ProtocolObject<dyn MTL4CounterHeap>>, Retained<NSError>>;
2224
2225 #[cfg(feature = "MTL4Counters")]
2226 #[unsafe(method(sizeOfCounterHeapEntry:))]
2241 #[unsafe(method_family = none)]
2242 fn sizeOfCounterHeapEntry(&self, r#type: MTL4CounterHeapType) -> NSUInteger;
2243
2244 #[unsafe(method(queryTimestampFrequency))]
2248 #[unsafe(method_family = none)]
2249 fn queryTimestampFrequency(&self) -> u64;
2250
2251 #[cfg(all(feature = "MTL4BinaryFunction", feature = "MTLFunctionHandle"))]
2252 #[unsafe(method(functionHandleWithBinaryFunction:))]
2259 #[unsafe(method_family = none)]
2260 fn functionHandleWithBinaryFunction(
2261 &self,
2262 function: &ProtocolObject<dyn MTL4BinaryFunction>,
2263 ) -> Option<Retained<ProtocolObject<dyn MTLFunctionHandle>>>;
2264 }
2265);