Skip to main content

apple_metal/
exhaustive.rs

1#![allow(
2    clippy::module_name_repetitions,
3    clippy::too_many_lines,
4    clippy::type_complexity
5)]
6
7use crate::{
8    ffi,
9    util::{c_string, take_optional_string},
10    ComputePipelineState, DynamicLibrary, MetalDevice, MetalLibrary, RenderPipelineState,
11};
12use core::ffi::{c_char, c_void};
13use core::ptr;
14use std::path::Path;
15
16macro_rules! opaque_symbol_handle {
17    ($(#[$meta:meta])* pub struct $name:ident;) => {
18        $(#[$meta])*
19/// Mirrors the `Metal` framework counterpart for this type.
20        pub struct $name {
21            ptr: *mut c_void,
22        }
23
24        // SAFETY: Metal ObjC objects use atomic reference counting and are safe
25        // to move across threads.  All `&self` methods on these types are either
26        // read-only or call ObjC methods documented as thread-safe by Apple.
27        unsafe impl Send for $name {}
28        unsafe impl Sync for $name {}
29
30        impl Drop for $name {
31            fn drop(&mut self) {
32                if !self.ptr.is_null() {
33                    unsafe { ffi::am_object_release(self.ptr) };
34                    self.ptr = ptr::null_mut();
35                }
36            }
37        }
38
39        impl $name {
40/// Mirrors the `Metal` framework constant `fn`.
41            #[must_use]
42            pub const fn as_ptr(&self) -> *mut c_void {
43                self.ptr
44            }
45
46            /// Wrap a raw, +1-retained opaque handle returned by the Swift bridge.
47            ///
48            /// # Safety
49            ///
50            /// `ptr` must be a valid, non-null, +1-retained Objective-C object pointer
51            /// whose ownership is being transferred to this value.  Passing a
52            /// pointer that is already owned by another instance causes a
53            /// double-release.
54            #[must_use]
55            pub unsafe fn from_raw(ptr: *mut c_void) -> Self {
56                Self { ptr }
57            }
58
59            #[allow(dead_code)]
60            fn wrap(ptr: *mut c_void) -> Option<Self> {
61                if ptr.is_null() {
62                    None
63                } else {
64                    Some(Self { ptr })
65                }
66            }
67
68/// Calls the `Metal` framework counterpart for `label`.
69            #[must_use]
70            pub fn label(&self) -> Option<String> {
71                unsafe { take_optional_string(ffi::am_object_copy_label(self.ptr)) }
72            }
73        }
74    };
75}
76
77macro_rules! opaque_symbol_class {
78    ($(#[$meta:meta])* pub struct $name:ident => $objc:literal;) => {
79        opaque_symbol_handle!(
80            $(#[$meta])*
81/// Mirrors the `Metal` framework counterpart for this type.
82            pub struct $name;
83        );
84
85        impl $name {
86/// Calls the `Metal` framework counterpart for `new`.
87            #[must_use]
88            pub fn new() -> Option<Self> {
89                Self::wrap(unsafe {
90                    ffi::am_new_class_instance(concat!($objc, "\0").as_ptr().cast())
91                })
92            }
93        }
94    };
95}
96
97macro_rules! raw_value_type {
98    ($(#[$meta:meta])* pub struct $name:ident($ty:ty);) => {
99        $(#[$meta])*
100/// Mirrors the `Metal` framework counterpart for this type.
101        #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
102        #[repr(transparent)]
103        pub struct $name(pub $ty);
104
105        impl $name {
106/// Mirrors the `Metal` framework constant `fn`.
107            #[must_use]
108            pub const fn from_raw(raw: $ty) -> Self {
109                Self(raw)
110            }
111
112/// Mirrors the `Metal` framework constant `fn`.
113            #[must_use]
114            pub const fn as_raw(self) -> $ty {
115                self.0
116            }
117        }
118    };
119}
120
121macro_rules! metal_string_constant {
122    ($(#[$meta:meta])* pub fn $name:ident => $symbol:literal;) => {
123        $(#[$meta])*
124/// Calls the `Metal` framework counterpart for this method.
125        #[must_use]
126        pub fn $name() -> Option<String> {
127            unsafe {
128                take_optional_string(
129                    ffi::am_copy_metal_string_constant(concat!($symbol, "\0").as_ptr().cast()),
130                )
131            }
132        }
133    };
134}
135
136/// Consume a heap-allocated array of retained device pointers produced by
137/// `am_copy_all_devices`, wrapping each into a [`MetalDevice`] and freeing
138/// the array allocation.
139///
140/// # Safety
141///
142/// * `ptr` must be either null or a valid pointer to `count` consecutive
143///   `*mut c_void` values, each holding a +1-retained `id<MTLDevice>`.
144/// * The array itself must have been allocated with `malloc` (it is freed
145///   with `libc::free` here).
146/// * `count` must equal the number of elements allocated at `ptr`.
147unsafe fn take_device_array(ptr: *mut *mut c_void, count: usize) -> Vec<MetalDevice> {
148    if ptr.is_null() || count == 0 {
149        return Vec::new();
150    }
151
152    let slice = core::slice::from_raw_parts(ptr, count);
153    let values = slice
154        .iter()
155        .copied()
156        .map(|device| unsafe { MetalDevice::from_retained_ptr(device) })
157        .collect();
158    libc::free(ptr.cast());
159    values
160}
161
162/// Mirrors the `Metal` framework counterpart for `MetalCommonCounter`.
163pub type MetalCommonCounter = String;
164/// Mirrors the `Metal` framework counterpart for `MetalCommonCounterSet`.
165pub type MetalCommonCounterSet = String;
166/// Mirrors the `Metal` framework counterpart for `MetalDeviceNotificationName`.
167pub type MetalDeviceNotificationName = String;
168/// Mirrors the `Metal` framework counterpart for `MetalAutoreleasedArgument`.
169pub type MetalAutoreleasedArgument = MetalArgument;
170/// Mirrors the `Metal` framework counterpart for `MetalArgumentType`.
171pub type MetalArgumentType = MetalBindingType;
172/// Mirrors the `Metal` framework counterpart for `MetalAutoreleasedComputePipelineReflection`.
173pub type MetalAutoreleasedComputePipelineReflection = MetalComputePipelineReflection;
174/// Mirrors the `Metal` framework counterpart for `MetalAutoreleasedRenderPipelineReflection`.
175pub type MetalAutoreleasedRenderPipelineReflection = MetalRenderPipelineReflection;
176/// Mirrors the `Metal` framework counterpart for `MetalNewLibraryCompletionHandler`.
177pub type MetalNewLibraryCompletionHandler =
178    Box<dyn FnMut(Result<MetalLibrary, String>) + Send + 'static>;
179/// Mirrors the `Metal` framework counterpart for `MetalNewDynamicLibraryCompletionHandler`.
180pub type MetalNewDynamicLibraryCompletionHandler =
181    Box<dyn FnMut(Result<DynamicLibrary, String>) + Send + 'static>;
182/// Mirrors the `Metal` framework counterpart for `MetalNewComputePipelineStateCompletionHandler`.
183pub type MetalNewComputePipelineStateCompletionHandler =
184    Box<dyn FnMut(Result<ComputePipelineState, String>) + Send + 'static>;
185/// Mirrors the `Metal` framework counterpart for `MetalNewComputePipelineStateWithReflectionCompletionHandler`.
186pub type MetalNewComputePipelineStateWithReflectionCompletionHandler = Box<
187    dyn FnMut(Result<(ComputePipelineState, MetalComputePipelineReflection), String>)
188        + Send
189        + 'static,
190>;
191/// Mirrors the `Metal` framework counterpart for `MetalNewRenderPipelineStateCompletionHandler`.
192pub type MetalNewRenderPipelineStateCompletionHandler =
193    Box<dyn FnMut(Result<RenderPipelineState, String>) + Send + 'static>;
194/// Mirrors the `Metal` framework counterpart for `MetalNewRenderPipelineStateWithReflectionCompletionHandler`.
195pub type MetalNewRenderPipelineStateWithReflectionCompletionHandler = Box<
196    dyn FnMut(Result<(RenderPipelineState, MetalRenderPipelineReflection), String>)
197        + Send
198        + 'static,
199>;
200/// Mirrors the `Metal` framework counterpart for `MetalTimestamp`.
201pub type MetalTimestamp = u64;
202
203/// Mirrors the `Metal` framework counterpart for `MetalCoordinate2D`.
204///
205/// # Examples
206///
207/// ```
208/// use apple_metal::MetalCoordinate2D;
209///
210/// let texel = MetalCoordinate2D::new(0.25, 0.75);
211/// assert_eq!(texel.x, 0.25);
212/// assert_eq!(texel.y, 0.75);
213/// ```
214#[derive(Debug, Clone, Copy, Default, PartialEq)]
215pub struct MetalCoordinate2D {
216    /// Mirrors the `Metal` framework property for `x`.
217    pub x: f32,
218    /// Mirrors the `Metal` framework property for `y`.
219    pub y: f32,
220}
221
222impl MetalCoordinate2D {
223    /// Mirrors the `Metal` framework constant `fn`.
224    #[must_use]
225    pub const fn new(x: f32, y: f32) -> Self {
226        Self { x, y }
227    }
228}
229
230/// Mirrors the `Metal` framework counterpart for `MetalSize`.
231///
232/// # Examples
233///
234/// ```
235/// use apple_metal::MetalSize;
236///
237/// let threads = MetalSize::new(8, 4, 1);
238/// assert_eq!(threads.width * threads.height, 32);
239/// assert_eq!(threads.depth, 1);
240/// ```
241#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
242pub struct MetalSize {
243    /// Mirrors the `Metal` framework property for `width`.
244    pub width: usize,
245    /// Mirrors the `Metal` framework property for `height`.
246    pub height: usize,
247    /// Mirrors the `Metal` framework property for `depth`.
248    pub depth: usize,
249}
250
251impl MetalSize {
252    /// Mirrors the `Metal` framework constant `fn`.
253    #[must_use]
254    pub const fn new(width: usize, height: usize, depth: usize) -> Self {
255        Self {
256            width,
257            height,
258            depth,
259        }
260    }
261}
262
263raw_value_type!(
264    /// Mirrors the `Metal` framework counterpart for `MetalGpuAddress`.
265    ///
266    /// # Examples
267    ///
268    /// ```
269    /// use apple_metal::MetalGpuAddress;
270    ///
271    /// let address = MetalGpuAddress::from_raw(0x1_0000);
272    /// assert_eq!(address.as_raw(), 0x1_0000);
273    /// ```
274    pub struct MetalGpuAddress(u64);
275);
276
277/// Mirrors the `Metal` framework counterpart for `MetalOrigin`.
278///
279/// # Examples
280///
281/// ```
282/// use apple_metal::MetalOrigin;
283///
284/// let origin = MetalOrigin::new(4, 2, 1);
285/// assert_eq!((origin.x, origin.y, origin.z), (4, 2, 1));
286/// ```
287#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
288pub struct MetalOrigin {
289    /// Mirrors the `Metal` framework property for `x`.
290    pub x: usize,
291    /// Mirrors the `Metal` framework property for `y`.
292    pub y: usize,
293    /// Mirrors the `Metal` framework property for `z`.
294    pub z: usize,
295}
296
297impl MetalOrigin {
298    /// Mirrors the `Metal` framework constant `fn`.
299    #[must_use]
300    pub const fn new(x: usize, y: usize, z: usize) -> Self {
301        Self { x, y, z }
302    }
303}
304
305/// Mirrors the `Metal` framework counterpart for `MetalRegion`.
306///
307/// # Examples
308///
309/// ```
310/// use apple_metal::MetalRegion;
311///
312/// let region = MetalRegion::new_2d(4, 8, 16, 32);
313/// assert_eq!(region.origin.x, 4);
314/// assert_eq!(region.size.height, 32);
315/// ```
316#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
317pub struct MetalRegion {
318    /// Mirrors the `Metal` framework property for `origin`.
319    pub origin: MetalOrigin,
320    /// Mirrors the `Metal` framework property for `size`.
321    pub size: MetalSize,
322}
323
324impl MetalRegion {
325    /// Mirrors the `Metal` framework constant `fn`.
326    #[must_use]
327    pub const fn new(origin: MetalOrigin, size: MetalSize) -> Self {
328        Self { origin, size }
329    }
330
331    /// Mirrors the `Metal` framework constant `fn`.
332    #[must_use]
333    pub const fn new_1d(x: usize, width: usize) -> Self {
334        Self {
335            origin: MetalOrigin::new(x, 0, 0),
336            size: MetalSize::new(width, 1, 1),
337        }
338    }
339
340    /// Mirrors the `Metal` framework constant `fn`.
341    #[must_use]
342    pub const fn new_2d(x: usize, y: usize, width: usize, height: usize) -> Self {
343        Self {
344            origin: MetalOrigin::new(x, y, 0),
345            size: MetalSize::new(width, height, 1),
346        }
347    }
348
349    /// Mirrors the `Metal` framework constant `fn`.
350    #[must_use]
351    pub const fn new_3d(
352        x: usize,
353        y: usize,
354        z: usize,
355        width: usize,
356        height: usize,
357        depth: usize,
358    ) -> Self {
359        Self {
360            origin: MetalOrigin::new(x, y, z),
361            size: MetalSize::new(width, height, depth),
362        }
363    }
364}
365
366/// Mirrors the `Metal` framework counterpart for `MetalResourceId`.
367///
368/// # Examples
369///
370/// ```
371/// use apple_metal::MetalResourceId;
372///
373/// let resource_id = MetalResourceId::new(42);
374/// assert_eq!(resource_id.value, 42);
375/// ```
376#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
377#[repr(transparent)]
378pub struct MetalResourceId {
379    /// Mirrors the `Metal` framework property for `value`.
380    pub value: u64,
381}
382
383impl MetalResourceId {
384    /// Mirrors the `Metal` framework constant `fn`.
385    #[must_use]
386    pub const fn new(value: u64) -> Self {
387        Self { value }
388    }
389}
390
391/// Mirrors the `Metal` framework counterpart for `MetalPackedFloat3`.
392///
393/// # Examples
394///
395/// ```
396/// use apple_metal::MetalPackedFloat3;
397///
398/// let normal = MetalPackedFloat3::new(0.0, 0.0, 1.0);
399/// assert_eq!(normal.z, 1.0);
400/// ```
401#[derive(Debug, Clone, Copy, Default, PartialEq)]
402pub struct MetalPackedFloat3 {
403    /// Mirrors the `Metal` framework property for `x`.
404    pub x: f32,
405    /// Mirrors the `Metal` framework property for `y`.
406    pub y: f32,
407    /// Mirrors the `Metal` framework property for `z`.
408    pub z: f32,
409}
410
411impl MetalPackedFloat3 {
412    /// Mirrors the `Metal` framework constant `fn`.
413    #[must_use]
414    pub const fn new(x: f32, y: f32, z: f32) -> Self {
415        Self { x, y, z }
416    }
417}
418
419/// Mirrors the `Metal` framework counterpart for `MetalPackedFloatQuaternion`.
420///
421/// # Examples
422///
423/// ```
424/// use apple_metal::MetalPackedFloatQuaternion;
425///
426/// let rotation = MetalPackedFloatQuaternion::default();
427/// assert_eq!(rotation, MetalPackedFloatQuaternion::new(0.0, 0.0, 0.0, 1.0));
428/// ```
429#[derive(Debug, Clone, Copy, PartialEq)]
430pub struct MetalPackedFloatQuaternion {
431    /// Mirrors the `Metal` framework property for `x`.
432    pub x: f32,
433    /// Mirrors the `Metal` framework property for `y`.
434    pub y: f32,
435    /// Mirrors the `Metal` framework property for `z`.
436    pub z: f32,
437    /// Mirrors the `Metal` framework property for `w`.
438    pub w: f32,
439}
440
441impl Default for MetalPackedFloatQuaternion {
442    fn default() -> Self {
443        Self {
444            x: 0.0,
445            y: 0.0,
446            z: 0.0,
447            w: 1.0,
448        }
449    }
450}
451
452impl MetalPackedFloatQuaternion {
453    /// Mirrors the `Metal` framework constant `fn`.
454    #[must_use]
455    pub const fn new(x: f32, y: f32, z: f32, w: f32) -> Self {
456        Self { x, y, z, w }
457    }
458}
459
460/// Mirrors the `Metal` framework counterpart for `MetalPackedFloat4x3`.
461///
462/// # Examples
463///
464/// ```
465/// use apple_metal::{MetalPackedFloat3, MetalPackedFloat4x3};
466///
467/// let basis = MetalPackedFloat4x3::new(
468///     MetalPackedFloat3::new(1.0, 0.0, 0.0),
469///     MetalPackedFloat3::new(0.0, 1.0, 0.0),
470///     MetalPackedFloat3::new(0.0, 0.0, 1.0),
471///     MetalPackedFloat3::new(4.0, 5.0, 6.0),
472/// );
473/// assert_eq!(basis.columns[3].y, 5.0);
474/// ```
475#[derive(Debug, Clone, Copy, Default, PartialEq)]
476pub struct MetalPackedFloat4x3 {
477    /// Mirrors the `Metal` framework property for `columns`.
478    pub columns: [MetalPackedFloat3; 4],
479}
480
481impl MetalPackedFloat4x3 {
482    /// Mirrors the `Metal` framework constant `fn`.
483    #[must_use]
484    pub const fn new(
485        column0: MetalPackedFloat3,
486        column1: MetalPackedFloat3,
487        column2: MetalPackedFloat3,
488        column3: MetalPackedFloat3,
489    ) -> Self {
490        Self {
491            columns: [column0, column1, column2, column3],
492        }
493    }
494}
495
496raw_value_type!(
497    /// Mirrors the `Metal` framework counterpart for `MetalSparseTextureMappingMode`.
498    pub struct MetalSparseTextureMappingMode(usize);
499);
500
501opaque_symbol_handle!(
502    /// Mirrors the `Metal` framework counterpart for `MetalDeviceObserver`.
503    pub struct MetalDeviceObserver;
504);
505
506/// Mirrors the `Metal` framework counterpart for `MetalDeviceObserverCallback`.
507pub type MetalDeviceObserverCallback = unsafe extern "C" fn(
508    device: *mut c_void,
509    notification_name: *const c_char,
510    user_data: *mut c_void,
511);
512
513impl MetalDeviceObserver {
514    /// Calls the `Metal` framework counterpart for `remove`.
515    pub fn remove(&self) {
516        unsafe { ffi::am_remove_device_observer(self.as_ptr()) };
517    }
518}
519
520/// Calls the `Metal` framework counterpart for `copy_all_devices`.
521#[must_use]
522pub fn copy_all_devices() -> Vec<MetalDevice> {
523    let mut count = 0;
524    let ptr = unsafe { ffi::am_copy_all_devices(&mut count) };
525    unsafe { take_device_array(ptr, count) }
526}
527
528/// Enumerate all Metal devices while registering a hot-plug/removal observer.
529///
530/// # Safety
531///
532/// * `callback`, if `Some`, must be a valid function pointer that remains
533///   valid for the lifetime of the returned `MetalDeviceObserver`.
534/// * `user_data` is forwarded to `callback` without inspection; the caller
535///   is responsible for ensuring it remains valid and for any required
536///   synchronization.
537pub unsafe fn copy_all_devices_with_observer(
538    callback: Option<MetalDeviceObserverCallback>,
539    user_data: *mut c_void,
540) -> (Vec<MetalDevice>, Option<MetalDeviceObserver>) {
541    let mut count = 0;
542    let mut observer = ptr::null_mut();
543    let ptr =
544        ffi::am_copy_all_devices_with_observer(&mut count, &mut observer, callback, user_data);
545    (
546        take_device_array(ptr, count),
547        MetalDeviceObserver::wrap(observer),
548    )
549}
550
551/// Calls the `Metal` framework counterpart for `remove_device_observer`.
552pub fn remove_device_observer(observer: &MetalDeviceObserver) {
553    observer.remove();
554}
555
556/// Mirrors the `Metal` framework counterpart for `MetalIoCompressionContext`.
557pub struct MetalIoCompressionContext {
558    ptr: *mut c_void,
559}
560
561impl Drop for MetalIoCompressionContext {
562    fn drop(&mut self) {
563        if !self.ptr.is_null() {
564            unsafe { ffi::am_io_flush_and_destroy_compression_context(self.ptr) };
565            self.ptr = ptr::null_mut();
566        }
567    }
568}
569
570impl MetalIoCompressionContext {
571    /// Mirrors the `Metal` framework constant `fn`.
572    #[must_use]
573    pub const fn as_ptr(&self) -> *mut c_void {
574        self.ptr
575    }
576
577    /// Wrap a raw `MTLIOCompressionContext` pointer returned by the Swift bridge.
578    ///
579    /// # Safety
580    ///
581    /// `ptr` must be a valid, non-null `MTLIOCompressionContext *` whose
582    /// ownership is transferred to this value.  The context will be flushed
583    /// and destroyed when this value is dropped or `flush_and_destroy` is
584    /// called.  Do not use `ptr` after calling this function.
585    #[must_use]
586    pub unsafe fn from_raw(ptr: *mut c_void) -> Self {
587        Self { ptr }
588    }
589
590    /// Calls the `Metal` framework counterpart for `append_data`.
591    pub fn append_data(&self, data: &[u8]) {
592        unsafe {
593            ffi::am_io_compression_context_append_data(self.ptr, data.as_ptr(), data.len());
594        }
595    }
596
597    /// Calls the `Metal` framework counterpart for `flush_and_destroy`.
598    #[must_use]
599    pub fn flush_and_destroy(mut self) -> MetalIoCompressionStatus {
600        let status = unsafe { ffi::am_io_flush_and_destroy_compression_context(self.ptr) };
601        self.ptr = ptr::null_mut();
602        MetalIoCompressionStatus::from_raw(status)
603    }
604}
605
606/// Calls the `Metal` framework counterpart for `io_compression_context_default_chunk_size`.
607#[must_use]
608pub fn io_compression_context_default_chunk_size() -> usize {
609    unsafe { ffi::am_io_compression_context_default_chunk_size() }
610}
611
612/// Calls the `Metal` framework counterpart for `create_io_compression_context`.
613#[must_use]
614pub fn create_io_compression_context(
615    path: &Path,
616    method: MetalIoCompressionMethod,
617    chunk_size: Option<usize>,
618) -> Option<MetalIoCompressionContext> {
619    let path = c_string(path.to_string_lossy().as_ref()).ok()?;
620    let chunk_size = chunk_size.unwrap_or_else(io_compression_context_default_chunk_size);
621    let ptr = unsafe {
622        ffi::am_io_create_compression_context(path.as_ptr(), method.as_raw(), chunk_size)
623    };
624    if ptr.is_null() {
625        None
626    } else {
627        Some(unsafe { MetalIoCompressionContext::from_raw(ptr) })
628    }
629}
630
631metal_string_constant!(pub fn metal4_command_queue_error_domain => "MTL4CommandQueueErrorDomain";);
632metal_string_constant!(pub fn metal_binary_archive_domain => "MTLBinaryArchiveDomain";);
633metal_string_constant!(pub fn metal_capture_error_domain => "MTLCaptureErrorDomain";);
634metal_string_constant!(pub fn metal_command_buffer_encoder_info_error_key => "MTLCommandBufferEncoderInfoErrorKey";);
635metal_string_constant!(pub fn metal_command_buffer_error_domain => "MTLCommandBufferErrorDomain";);
636metal_string_constant!(pub fn metal_common_counter_clipper_invocations => "MTLCommonCounterClipperInvocations";);
637metal_string_constant!(pub fn metal_common_counter_clipper_primitives_out => "MTLCommonCounterClipperPrimitivesOut";);
638metal_string_constant!(pub fn metal_common_counter_compute_kernel_invocations => "MTLCommonCounterComputeKernelInvocations";);
639metal_string_constant!(pub fn metal_common_counter_fragment_cycles => "MTLCommonCounterFragmentCycles";);
640metal_string_constant!(pub fn metal_common_counter_fragment_invocations => "MTLCommonCounterFragmentInvocations";);
641metal_string_constant!(pub fn metal_common_counter_fragments_passed => "MTLCommonCounterFragmentsPassed";);
642metal_string_constant!(pub fn metal_common_counter_post_tessellation_vertex_cycles => "MTLCommonCounterPostTessellationVertexCycles";);
643metal_string_constant!(pub fn metal_common_counter_post_tessellation_vertex_invocations => "MTLCommonCounterPostTessellationVertexInvocations";);
644metal_string_constant!(pub fn metal_common_counter_render_target_write_cycles => "MTLCommonCounterRenderTargetWriteCycles";);
645metal_string_constant!(pub fn metal_common_counter_set_stage_utilization => "MTLCommonCounterSetStageUtilization";);
646metal_string_constant!(pub fn metal_common_counter_set_statistic => "MTLCommonCounterSetStatistic";);
647metal_string_constant!(pub fn metal_common_counter_set_timestamp => "MTLCommonCounterSetTimestamp";);
648metal_string_constant!(pub fn metal_common_counter_tessellation_cycles => "MTLCommonCounterTessellationCycles";);
649metal_string_constant!(pub fn metal_common_counter_tessellation_input_patches => "MTLCommonCounterTessellationInputPatches";);
650metal_string_constant!(pub fn metal_common_counter_timestamp => "MTLCommonCounterTimestamp";);
651metal_string_constant!(pub fn metal_common_counter_total_cycles => "MTLCommonCounterTotalCycles";);
652metal_string_constant!(pub fn metal_common_counter_vertex_cycles => "MTLCommonCounterVertexCycles";);
653metal_string_constant!(pub fn metal_common_counter_vertex_invocations => "MTLCommonCounterVertexInvocations";);
654metal_string_constant!(pub fn metal_counter_error_domain => "MTLCounterErrorDomain";);
655metal_string_constant!(pub fn metal_device_removal_requested_notification => "MTLDeviceRemovalRequestedNotification";);
656metal_string_constant!(pub fn metal_device_was_added_notification => "MTLDeviceWasAddedNotification";);
657metal_string_constant!(pub fn metal_device_was_removed_notification => "MTLDeviceWasRemovedNotification";);
658metal_string_constant!(pub fn metal_dynamic_library_domain => "MTLDynamicLibraryDomain";);
659metal_string_constant!(pub fn metal_io_error_domain => "MTLIOErrorDomain";);
660metal_string_constant!(pub fn metal_library_error_domain => "MTLLibraryErrorDomain";);
661metal_string_constant!(pub fn metal_log_state_error_domain => "MTLLogStateErrorDomain";);
662metal_string_constant!(pub fn metal_tensor_domain => "MTLTensorDomain";);
663
664raw_value_type!(
665    /// Mirrors the `Metal` framework counterpart for `Metal4AlphaToCoverageState`.
666    pub struct Metal4AlphaToCoverageState(usize);
667);
668raw_value_type!(
669    /// Mirrors the `Metal` framework counterpart for `Metal4AlphaToOneState`.
670    pub struct Metal4AlphaToOneState(usize);
671);
672raw_value_type!(
673    /// Mirrors the `Metal` framework counterpart for `Metal4BinaryFunctionOptions`.
674    pub struct Metal4BinaryFunctionOptions(usize);
675);
676raw_value_type!(
677    /// Mirrors the `Metal` framework counterpart for `Metal4BlendState`.
678    pub struct Metal4BlendState(usize);
679);
680raw_value_type!(
681    /// Mirrors the `Metal` framework counterpart for `Metal4CommandQueueError`.
682    pub struct Metal4CommandQueueError(usize);
683);
684raw_value_type!(
685    /// Mirrors the `Metal` framework counterpart for `Metal4CompilerTaskStatus`.
686    pub struct Metal4CompilerTaskStatus(usize);
687);
688raw_value_type!(
689    /// Mirrors the `Metal` framework counterpart for `Metal4CounterHeapType`.
690    pub struct Metal4CounterHeapType(usize);
691);
692raw_value_type!(
693    /// Mirrors the `Metal` framework counterpart for `Metal4IndirectCommandBufferSupportState`.
694    pub struct Metal4IndirectCommandBufferSupportState(usize);
695);
696raw_value_type!(
697    /// Mirrors the `Metal` framework counterpart for `Metal4LogicalToPhysicalColorAttachmentMappingState`.
698    pub struct Metal4LogicalToPhysicalColorAttachmentMappingState(usize);
699);
700raw_value_type!(
701    /// Mirrors the `Metal` framework counterpart for `Metal4PipelineDataSetSerializerConfiguration`.
702    pub struct Metal4PipelineDataSetSerializerConfiguration(usize);
703);
704raw_value_type!(
705    /// Mirrors the `Metal` framework counterpart for `Metal4RenderEncoderOptions`.
706    pub struct Metal4RenderEncoderOptions(usize);
707);
708raw_value_type!(
709    /// Mirrors the `Metal` framework counterpart for `Metal4ShaderReflection`.
710    pub struct Metal4ShaderReflection(usize);
711);
712raw_value_type!(
713    /// Mirrors the `Metal` framework counterpart for `Metal4TimestampGranularity`.
714    pub struct Metal4TimestampGranularity(usize);
715);
716raw_value_type!(
717    /// Mirrors the `Metal` framework counterpart for `Metal4VisibilityOptions`.
718    pub struct Metal4VisibilityOptions(usize);
719);
720raw_value_type!(
721    /// Mirrors the `Metal` framework counterpart for `MetalAccelerationStructureInstanceDescriptorType`.
722    pub struct MetalAccelerationStructureInstanceDescriptorType(usize);
723);
724raw_value_type!(
725    /// Mirrors the `Metal` framework counterpart for `MetalAccelerationStructureInstanceOptions`.
726    pub struct MetalAccelerationStructureInstanceOptions(usize);
727);
728raw_value_type!(
729    /// Mirrors the `Metal` framework counterpart for `MetalAccelerationStructureRefitOptions`.
730    pub struct MetalAccelerationStructureRefitOptions(usize);
731);
732raw_value_type!(
733    /// Mirrors the `Metal` framework counterpart for `MetalAccelerationStructureUsage`.
734    pub struct MetalAccelerationStructureUsage(usize);
735);
736raw_value_type!(
737    /// Mirrors the `Metal` framework counterpart for `MetalArgumentAccess`.
738    pub struct MetalArgumentAccess(usize);
739);
740raw_value_type!(
741    /// Mirrors the `Metal` framework counterpart for `MetalAttributeFormat`.
742    pub struct MetalAttributeFormat(usize);
743);
744raw_value_type!(
745    /// Mirrors the `Metal` framework counterpart for `MetalBarrierScope`.
746    pub struct MetalBarrierScope(usize);
747);
748raw_value_type!(
749    /// Mirrors the `Metal` framework counterpart for `MetalBinaryArchiveError`.
750    pub struct MetalBinaryArchiveError(usize);
751);
752raw_value_type!(
753    /// Mirrors the `Metal` framework counterpart for `MetalBindingType`.
754    pub struct MetalBindingType(usize);
755);
756raw_value_type!(
757    /// Mirrors the `Metal` framework counterpart for `MetalBlitOption`.
758    pub struct MetalBlitOption(usize);
759);
760raw_value_type!(
761    /// Mirrors the `Metal` framework counterpart for `MetalBufferSparseTier`.
762    pub struct MetalBufferSparseTier(usize);
763);
764raw_value_type!(
765    /// Mirrors the `Metal` framework counterpart for `MetalCaptureError`.
766    pub struct MetalCaptureError(usize);
767);
768raw_value_type!(
769    /// Mirrors the `Metal` framework counterpart for `MetalCommandBufferError`.
770    pub struct MetalCommandBufferError(usize);
771);
772raw_value_type!(
773    /// Mirrors the `Metal` framework counterpart for `MetalCommandBufferErrorOption`.
774    pub struct MetalCommandBufferErrorOption(usize);
775);
776raw_value_type!(
777    /// Mirrors the `Metal` framework counterpart for `MetalCommandEncoderErrorState`.
778    pub struct MetalCommandEncoderErrorState(usize);
779);
780raw_value_type!(
781    /// Mirrors the `Metal` framework counterpart for `MetalCompileSymbolVisibility`.
782    pub struct MetalCompileSymbolVisibility(usize);
783);
784raw_value_type!(
785    /// Mirrors the `Metal` framework counterpart for `MetalCounterSampleBufferError`.
786    pub struct MetalCounterSampleBufferError(usize);
787);
788raw_value_type!(
789    /// Mirrors the `Metal` framework counterpart for `MetalCullMode`.
790    pub struct MetalCullMode(usize);
791);
792raw_value_type!(
793    /// Mirrors the `Metal` framework counterpart for `MetalCurveBasis`.
794    pub struct MetalCurveBasis(usize);
795);
796raw_value_type!(
797    /// Mirrors the `Metal` framework counterpart for `MetalCurveEndCaps`.
798    pub struct MetalCurveEndCaps(usize);
799);
800raw_value_type!(
801    /// Mirrors the `Metal` framework counterpart for `MetalCurveType`.
802    pub struct MetalCurveType(usize);
803);
804raw_value_type!(
805    /// Mirrors the `Metal` framework counterpart for `MetalDataType`.
806    pub struct MetalDataType(usize);
807);
808raw_value_type!(
809    /// Mirrors the `Metal` framework counterpart for `MetalDepthClipMode`.
810    pub struct MetalDepthClipMode(usize);
811);
812raw_value_type!(
813    /// Mirrors the `Metal` framework counterpart for `MetalDeviceLocation`.
814    pub struct MetalDeviceLocation(usize);
815);
816raw_value_type!(
817    /// Mirrors the `Metal` framework counterpart for `MetalDispatchType`.
818    pub struct MetalDispatchType(usize);
819);
820raw_value_type!(
821    /// Mirrors the `Metal` framework counterpart for `MetalDynamicLibraryError`.
822    pub struct MetalDynamicLibraryError(usize);
823);
824raw_value_type!(
825    /// Mirrors the `Metal` framework counterpart for `MetalFeatureSet`.
826    pub struct MetalFeatureSet(usize);
827);
828raw_value_type!(
829    /// Mirrors the `Metal` framework counterpart for `MetalFunctionLogType`.
830    pub struct MetalFunctionLogType(usize);
831);
832raw_value_type!(
833    /// Mirrors the `Metal` framework counterpart for `MetalFunctionOptions`.
834    pub struct MetalFunctionOptions(usize);
835);
836raw_value_type!(
837    /// Mirrors the `Metal` framework counterpart for `MetalFunctionType`.
838    pub struct MetalFunctionType(usize);
839);
840raw_value_type!(
841    /// Mirrors the `Metal` framework counterpart for `MetalHeapType`.
842    pub struct MetalHeapType(usize);
843);
844raw_value_type!(
845    /// Mirrors the `Metal` framework counterpart for `MetalIndexType`.
846    pub struct MetalIndexType(usize);
847);
848raw_value_type!(
849    /// Mirrors the `Metal` framework counterpart for `MetalIoCommandQueueType`.
850    pub struct MetalIoCommandQueueType(usize);
851);
852raw_value_type!(
853    /// Mirrors the `Metal` framework counterpart for `MetalIoCompressionMethod`.
854    pub struct MetalIoCompressionMethod(usize);
855);
856raw_value_type!(
857    /// Mirrors the `Metal` framework counterpart for `MetalIoCompressionStatus`.
858    pub struct MetalIoCompressionStatus(usize);
859);
860raw_value_type!(
861    /// Mirrors the `Metal` framework counterpart for `MetalIoPriority`.
862    pub struct MetalIoPriority(usize);
863);
864raw_value_type!(
865    /// Mirrors the `Metal` framework counterpart for `MetalIoStatus`.
866    pub struct MetalIoStatus(usize);
867);
868raw_value_type!(
869    /// Mirrors the `Metal` framework counterpart for `MetalLanguageVersion`.
870    pub struct MetalLanguageVersion(usize);
871);
872raw_value_type!(
873    /// Mirrors the `Metal` framework counterpart for `MetalLibraryError`.
874    pub struct MetalLibraryError(usize);
875);
876raw_value_type!(
877    /// Mirrors the `Metal` framework counterpart for `MetalLibraryOptimizationLevel`.
878    pub struct MetalLibraryOptimizationLevel(usize);
879);
880raw_value_type!(
881    /// Mirrors the `Metal` framework counterpart for `MetalLibraryType`.
882    pub struct MetalLibraryType(usize);
883);
884raw_value_type!(
885    /// Mirrors the `Metal` framework counterpart for `MetalLogStateError`.
886    pub struct MetalLogStateError(usize);
887);
888raw_value_type!(
889    /// Mirrors the `Metal` framework counterpart for `MetalMathFloatingPointFunctions`.
890    pub struct MetalMathFloatingPointFunctions(usize);
891);
892raw_value_type!(
893    /// Mirrors the `Metal` framework counterpart for `MetalMathMode`.
894    pub struct MetalMathMode(usize);
895);
896raw_value_type!(
897    /// Mirrors the `Metal` framework counterpart for `MetalMatrixLayout`.
898    pub struct MetalMatrixLayout(usize);
899);
900raw_value_type!(
901    /// Mirrors the `Metal` framework counterpart for `MetalMotionBorderMode`.
902    pub struct MetalMotionBorderMode(usize);
903);
904raw_value_type!(
905    /// Mirrors the `Metal` framework counterpart for `MetalMultisampleDepthResolveFilter`.
906    pub struct MetalMultisampleDepthResolveFilter(usize);
907);
908raw_value_type!(
909    /// Mirrors the `Metal` framework counterpart for `MetalMultisampleStencilResolveFilter`.
910    pub struct MetalMultisampleStencilResolveFilter(usize);
911);
912raw_value_type!(
913    /// Mirrors the `Metal` framework counterpart for `MetalMutability`.
914    pub struct MetalMutability(usize);
915);
916raw_value_type!(
917    /// Mirrors the `Metal` framework counterpart for `MetalPatchType`.
918    pub struct MetalPatchType(usize);
919);
920raw_value_type!(
921    /// Mirrors the `Metal` framework counterpart for `MetalPipelineOption`.
922    pub struct MetalPipelineOption(usize);
923);
924raw_value_type!(
925    /// Mirrors the `Metal` framework counterpart for `MetalPrimitiveTopologyClass`.
926    pub struct MetalPrimitiveTopologyClass(usize);
927);
928raw_value_type!(
929    /// Mirrors the `Metal` framework counterpart for `MetalReadWriteTextureTier`.
930    pub struct MetalReadWriteTextureTier(usize);
931);
932raw_value_type!(
933    /// Mirrors the `Metal` framework counterpart for `MetalRenderStages`.
934    pub struct MetalRenderStages(usize);
935);
936raw_value_type!(
937    /// Mirrors the `Metal` framework counterpart for `MetalResourceUsage`.
938    pub struct MetalResourceUsage(usize);
939);
940raw_value_type!(
941    /// Mirrors the `Metal` framework counterpart for `MetalShaderValidation`.
942    pub struct MetalShaderValidation(usize);
943);
944raw_value_type!(
945    /// Mirrors the `Metal` framework counterpart for `MetalSparsePageSize`.
946    pub struct MetalSparsePageSize(usize);
947);
948raw_value_type!(
949    /// Mirrors the `Metal` framework counterpart for `MetalSparseTextureRegionAlignmentMode`.
950    pub struct MetalSparseTextureRegionAlignmentMode(usize);
951);
952raw_value_type!(
953    /// Mirrors the `Metal` framework counterpart for `MetalStages`.
954    pub struct MetalStages(usize);
955);
956raw_value_type!(
957    /// Mirrors the `Metal` framework counterpart for `MetalStepFunction`.
958    pub struct MetalStepFunction(usize);
959);
960raw_value_type!(
961    /// Mirrors the `Metal` framework counterpart for `MetalStitchedLibraryOptions`.
962    pub struct MetalStitchedLibraryOptions(usize);
963);
964raw_value_type!(
965    /// Mirrors the `Metal` framework counterpart for `MetalStoreActionOptions`.
966    pub struct MetalStoreActionOptions(usize);
967);
968raw_value_type!(
969    /// Mirrors the `Metal` framework counterpart for `MetalTensorDataType`.
970    pub struct MetalTensorDataType(usize);
971);
972raw_value_type!(
973    /// Mirrors the `Metal` framework counterpart for `MetalTensorError`.
974    pub struct MetalTensorError(usize);
975);
976raw_value_type!(
977    /// Mirrors the `Metal` framework counterpart for `MetalTensorUsage`.
978    pub struct MetalTensorUsage(usize);
979);
980raw_value_type!(
981    /// Mirrors the `Metal` framework counterpart for `MetalTessellationControlPointIndexType`.
982    pub struct MetalTessellationControlPointIndexType(usize);
983);
984raw_value_type!(
985    /// Mirrors the `Metal` framework counterpart for `MetalTessellationFactorFormat`.
986    pub struct MetalTessellationFactorFormat(usize);
987);
988raw_value_type!(
989    /// Mirrors the `Metal` framework counterpart for `MetalTessellationFactorStepFunction`.
990    pub struct MetalTessellationFactorStepFunction(usize);
991);
992raw_value_type!(
993    /// Mirrors the `Metal` framework counterpart for `MetalTessellationPartitionMode`.
994    pub struct MetalTessellationPartitionMode(usize);
995);
996raw_value_type!(
997    /// Mirrors the `Metal` framework counterpart for `MetalTextureCompressionType`.
998    pub struct MetalTextureCompressionType(usize);
999);
1000raw_value_type!(
1001    /// Mirrors the `Metal` framework counterpart for `MetalTextureSparseTier`.
1002    pub struct MetalTextureSparseTier(usize);
1003);
1004raw_value_type!(
1005    /// Mirrors the `Metal` framework counterpart for `MetalTextureSwizzle`.
1006    pub struct MetalTextureSwizzle(usize);
1007);
1008raw_value_type!(
1009    /// Mirrors the `Metal` framework counterpart for `MetalTransformType`.
1010    pub struct MetalTransformType(usize);
1011);
1012raw_value_type!(
1013    /// Mirrors the `Metal` framework counterpart for `MetalTriangleFillMode`.
1014    pub struct MetalTriangleFillMode(usize);
1015);
1016raw_value_type!(
1017    /// Mirrors the `Metal` framework counterpart for `MetalVertexFormat`.
1018    pub struct MetalVertexFormat(usize);
1019);
1020raw_value_type!(
1021    /// Mirrors the `Metal` framework counterpart for `MetalVertexStepFunction`.
1022    pub struct MetalVertexStepFunction(usize);
1023);
1024raw_value_type!(
1025    /// Mirrors the `Metal` framework counterpart for `MetalVisibilityResultMode`.
1026    pub struct MetalVisibilityResultMode(usize);
1027);
1028raw_value_type!(
1029    /// Mirrors the `Metal` framework counterpart for `MetalVisibilityResultType`.
1030    pub struct MetalVisibilityResultType(usize);
1031);
1032raw_value_type!(
1033    /// Mirrors the `Metal` framework counterpart for `MetalWinding`.
1034    pub struct MetalWinding(usize);
1035);
1036opaque_symbol_handle!(
1037    /// Mirrors the `Metal` framework counterpart for `Metal4Archive`.
1038    pub struct Metal4Archive;
1039);
1040opaque_symbol_handle!(
1041    /// Mirrors the `Metal` framework counterpart for `Metal4ArgumentTable`.
1042    pub struct Metal4ArgumentTable;
1043);
1044opaque_symbol_handle!(
1045    /// Mirrors the `Metal` framework counterpart for `Metal4BinaryFunction`.
1046    pub struct Metal4BinaryFunction;
1047);
1048opaque_symbol_handle!(
1049    /// Mirrors the `Metal` framework counterpart for `Metal4CommandAllocator`.
1050    pub struct Metal4CommandAllocator;
1051);
1052opaque_symbol_handle!(
1053    /// Mirrors the `Metal` framework counterpart for `Metal4CommandBuffer`.
1054    pub struct Metal4CommandBuffer;
1055);
1056opaque_symbol_handle!(
1057    /// Mirrors the `Metal` framework counterpart for `Metal4CommandEncoder`.
1058    pub struct Metal4CommandEncoder;
1059);
1060opaque_symbol_handle!(
1061    /// Mirrors the `Metal` framework counterpart for `Metal4CommandQueue`.
1062    pub struct Metal4CommandQueue;
1063);
1064opaque_symbol_handle!(
1065    /// Mirrors the `Metal` framework counterpart for `Metal4CommitFeedback`.
1066    pub struct Metal4CommitFeedback;
1067);
1068opaque_symbol_handle!(
1069    /// Mirrors the `Metal` framework counterpart for `Metal4Compiler`.
1070    pub struct Metal4Compiler;
1071);
1072opaque_symbol_handle!(
1073    /// Mirrors the `Metal` framework counterpart for `Metal4CompilerTask`.
1074    pub struct Metal4CompilerTask;
1075);
1076opaque_symbol_handle!(
1077    /// Mirrors the `Metal` framework counterpart for `Metal4ComputeCommandEncoder`.
1078    pub struct Metal4ComputeCommandEncoder;
1079);
1080opaque_symbol_handle!(
1081    /// Mirrors the `Metal` framework counterpart for `Metal4CounterHeap`.
1082    pub struct Metal4CounterHeap;
1083);
1084opaque_symbol_handle!(
1085    /// Mirrors the `Metal` framework counterpart for `Metal4FxFrameInterpolator`.
1086    pub struct Metal4FxFrameInterpolator;
1087);
1088opaque_symbol_handle!(
1089    /// Mirrors the `Metal` framework counterpart for `Metal4FxSpatialScaler`.
1090    pub struct Metal4FxSpatialScaler;
1091);
1092opaque_symbol_handle!(
1093    /// Mirrors the `Metal` framework counterpart for `Metal4FxTemporalDenoisedScaler`.
1094    pub struct Metal4FxTemporalDenoisedScaler;
1095);
1096opaque_symbol_handle!(
1097    /// Mirrors the `Metal` framework counterpart for `Metal4FxTemporalScaler`.
1098    pub struct Metal4FxTemporalScaler;
1099);
1100opaque_symbol_handle!(
1101    /// Mirrors the `Metal` framework counterpart for `Metal4MachineLearningCommandEncoder`.
1102    pub struct Metal4MachineLearningCommandEncoder;
1103);
1104opaque_symbol_handle!(
1105    /// Mirrors the `Metal` framework counterpart for `Metal4MachineLearningPipelineState`.
1106    pub struct Metal4MachineLearningPipelineState;
1107);
1108opaque_symbol_handle!(
1109    /// Mirrors the `Metal` framework counterpart for `Metal4PipelineDataSetSerializer`.
1110    pub struct Metal4PipelineDataSetSerializer;
1111);
1112opaque_symbol_handle!(
1113    /// Mirrors the `Metal` framework counterpart for `Metal4RenderCommandEncoder`.
1114    pub struct Metal4RenderCommandEncoder;
1115);
1116opaque_symbol_handle!(
1117    /// Mirrors the `Metal` framework counterpart for `MetalAccelerationStructureCommandEncoder`.
1118    pub struct MetalAccelerationStructureCommandEncoder;
1119);
1120opaque_symbol_handle!(
1121    /// Mirrors the `Metal` framework counterpart for `MetalAllocation`.
1122    pub struct MetalAllocation;
1123);
1124opaque_symbol_handle!(
1125    /// Mirrors the `Metal` framework counterpart for `MetalBinding`.
1126    pub struct MetalBinding;
1127);
1128opaque_symbol_handle!(
1129    /// Mirrors the `Metal` framework counterpart for `MetalBufferBinding`.
1130    pub struct MetalBufferBinding;
1131);
1132opaque_symbol_handle!(
1133    /// Mirrors the `Metal` framework counterpart for `MetalCommandBufferEncoderInfo`.
1134    pub struct MetalCommandBufferEncoderInfo;
1135);
1136opaque_symbol_handle!(
1137    /// Mirrors the `Metal` framework counterpart for `MetalCommandEncoder`.
1138    pub struct MetalCommandEncoder;
1139);
1140opaque_symbol_handle!(
1141    /// Mirrors the `Metal` framework counterpart for `MetalCounter`.
1142    pub struct MetalCounter;
1143);
1144opaque_symbol_handle!(
1145    /// Mirrors the `Metal` framework counterpart for `MetalDrawable`.
1146    pub struct MetalDrawable;
1147);
1148opaque_symbol_handle!(
1149    /// Mirrors the `Metal` framework counterpart for `MetalFunctionHandle`.
1150    pub struct MetalFunctionHandle;
1151);
1152opaque_symbol_handle!(
1153    /// Mirrors the `Metal` framework counterpart for `MetalFunctionLog`.
1154    pub struct MetalFunctionLog;
1155);
1156opaque_symbol_handle!(
1157    /// Mirrors the `Metal` framework counterpart for `MetalFunctionLogDebugLocation`.
1158    pub struct MetalFunctionLogDebugLocation;
1159);
1160opaque_symbol_handle!(
1161    /// Mirrors the `Metal` framework counterpart for `MetalFunctionStitchingAttribute`.
1162    pub struct MetalFunctionStitchingAttribute;
1163);
1164opaque_symbol_handle!(
1165    /// Mirrors the `Metal` framework counterpart for `MetalFunctionStitchingNode`.
1166    pub struct MetalFunctionStitchingNode;
1167);
1168opaque_symbol_handle!(
1169    /// Mirrors the `Metal` framework counterpart for `MetalFxFrameInterpolator`.
1170    pub struct MetalFxFrameInterpolator;
1171);
1172opaque_symbol_handle!(
1173    /// Mirrors the `Metal` framework counterpart for `MetalFxFrameInterpolatorBase`.
1174    pub struct MetalFxFrameInterpolatorBase;
1175);
1176opaque_symbol_handle!(
1177    /// Mirrors the `Metal` framework counterpart for `MetalFxSpatialScalerBase`.
1178    pub struct MetalFxSpatialScalerBase;
1179);
1180opaque_symbol_handle!(
1181    /// Mirrors the `Metal` framework counterpart for `MetalFxTemporalDenoisedScaler`.
1182    pub struct MetalFxTemporalDenoisedScaler;
1183);
1184opaque_symbol_handle!(
1185    /// Mirrors the `Metal` framework counterpart for `MetalFxTemporalDenoisedScalerBase`.
1186    pub struct MetalFxTemporalDenoisedScalerBase;
1187);
1188opaque_symbol_handle!(
1189    /// Mirrors the `Metal` framework counterpart for `MetalFxTemporalScalerBase`.
1190    pub struct MetalFxTemporalScalerBase;
1191);
1192opaque_symbol_handle!(
1193    /// Mirrors the `Metal` framework counterpart for `MetalIndirectComputeCommand`.
1194    pub struct MetalIndirectComputeCommand;
1195);
1196opaque_symbol_handle!(
1197    /// `id<MTLIndirectComputeCommandEncoder>` — encodes indirect compute dispatches.
1198    pub struct MetalIndirectComputeCommandEncoder;
1199);
1200opaque_symbol_handle!(
1201    /// Mirrors the `Metal` framework counterpart for `MetalIndirectRenderCommand`.
1202    pub struct MetalIndirectRenderCommand;
1203);
1204opaque_symbol_handle!(
1205    /// `id<MTLIndirectRenderCommandEncoder>` — encodes indirect render commands.
1206    pub struct MetalIndirectRenderCommandEncoder;
1207);
1208opaque_symbol_handle!(
1209    /// Mirrors the `Metal` framework counterpart for `MetalIoCommandBuffer`.
1210    pub struct MetalIoCommandBuffer;
1211);
1212opaque_symbol_handle!(
1213    /// Mirrors the `Metal` framework counterpart for `MetalIoCommandQueue`.
1214    pub struct MetalIoCommandQueue;
1215);
1216opaque_symbol_handle!(
1217    /// Mirrors the `Metal` framework counterpart for `MetalIoFileHandle`.
1218    pub struct MetalIoFileHandle;
1219);
1220opaque_symbol_handle!(
1221    /// Mirrors the `Metal` framework counterpart for `MetalIoScratchBuffer`.
1222    pub struct MetalIoScratchBuffer;
1223);
1224opaque_symbol_handle!(
1225    /// Mirrors the `Metal` framework counterpart for `MetalIoScratchBufferAllocator`.
1226    pub struct MetalIoScratchBufferAllocator;
1227);
1228opaque_symbol_handle!(
1229    /// Mirrors the `Metal` framework counterpart for `MetalLogContainer`.
1230    pub struct MetalLogContainer;
1231);
1232opaque_symbol_handle!(
1233    /// Mirrors the `Metal` framework counterpart for `MetalObjectPayloadBinding`.
1234    pub struct MetalObjectPayloadBinding;
1235);
1236opaque_symbol_handle!(
1237    /// Mirrors the `Metal` framework counterpart for `MetalParallelRenderCommandEncoder`.
1238    pub struct MetalParallelRenderCommandEncoder;
1239);
1240opaque_symbol_handle!(
1241    /// Mirrors the `Metal` framework counterpart for `MetalRasterizationRateMap`.
1242    pub struct MetalRasterizationRateMap;
1243);
1244opaque_symbol_handle!(
1245    /// Mirrors the `Metal` framework counterpart for `MetalResource`.
1246    pub struct MetalResource;
1247);
1248opaque_symbol_handle!(
1249    /// Mirrors the `Metal` framework counterpart for `MetalResourceStateCommandEncoder`.
1250    pub struct MetalResourceStateCommandEncoder;
1251);
1252opaque_symbol_handle!(
1253    /// Mirrors the `Metal` framework counterpart for `MetalResourceViewPool`.
1254    pub struct MetalResourceViewPool;
1255);
1256opaque_symbol_handle!(
1257    /// Mirrors the `Metal` framework counterpart for `MetalTensor`.
1258    pub struct MetalTensor;
1259);
1260opaque_symbol_handle!(
1261    /// Mirrors the `Metal` framework counterpart for `MetalTensorBinding`.
1262    pub struct MetalTensorBinding;
1263);
1264opaque_symbol_handle!(
1265    /// Mirrors the `Metal` framework counterpart for `MetalTextureBinding`.
1266    pub struct MetalTextureBinding;
1267);
1268opaque_symbol_handle!(
1269    /// Mirrors the `Metal` framework counterpart for `MetalTextureViewPool`.
1270    pub struct MetalTextureViewPool;
1271);
1272opaque_symbol_handle!(
1273    /// Mirrors the `Metal` framework counterpart for `MetalThreadgroupBinding`.
1274    pub struct MetalThreadgroupBinding;
1275);
1276opaque_symbol_class!(pub struct Metal4AccelerationStructureBoundingBoxGeometryDescriptor => "MTL4AccelerationStructureBoundingBoxGeometryDescriptor";);
1277opaque_symbol_class!(pub struct Metal4AccelerationStructureCurveGeometryDescriptor => "MTL4AccelerationStructureCurveGeometryDescriptor";);
1278opaque_symbol_class!(pub struct Metal4AccelerationStructureDescriptor => "MTL4AccelerationStructureDescriptor";);
1279opaque_symbol_class!(pub struct Metal4AccelerationStructureGeometryDescriptor => "MTL4AccelerationStructureGeometryDescriptor";);
1280opaque_symbol_class!(pub struct Metal4AccelerationStructureMotionBoundingBoxGeometryDescriptor => "MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor";);
1281opaque_symbol_class!(pub struct Metal4AccelerationStructureMotionCurveGeometryDescriptor => "MTL4AccelerationStructureMotionCurveGeometryDescriptor";);
1282opaque_symbol_class!(pub struct Metal4AccelerationStructureMotionTriangleGeometryDescriptor => "MTL4AccelerationStructureMotionTriangleGeometryDescriptor";);
1283opaque_symbol_class!(pub struct Metal4AccelerationStructureTriangleGeometryDescriptor => "MTL4AccelerationStructureTriangleGeometryDescriptor";);
1284opaque_symbol_class!(pub struct Metal4ArgumentTableDescriptor => "MTL4ArgumentTableDescriptor";);
1285opaque_symbol_class!(pub struct Metal4BinaryFunctionDescriptor => "MTL4BinaryFunctionDescriptor";);
1286opaque_symbol_class!(pub struct Metal4CommandAllocatorDescriptor => "MTL4CommandAllocatorDescriptor";);
1287opaque_symbol_class!(pub struct Metal4CommandBufferOptions => "MTL4CommandBufferOptions";);
1288opaque_symbol_class!(pub struct Metal4CommandQueueDescriptor => "MTL4CommandQueueDescriptor";);
1289opaque_symbol_class!(pub struct Metal4CommitOptions => "MTL4CommitOptions";);
1290opaque_symbol_class!(pub struct Metal4CompilerDescriptor => "MTL4CompilerDescriptor";);
1291opaque_symbol_class!(pub struct Metal4CompilerTaskOptions => "MTL4CompilerTaskOptions";);
1292opaque_symbol_class!(pub struct Metal4ComputePipelineDescriptor => "MTL4ComputePipelineDescriptor";);
1293opaque_symbol_class!(pub struct Metal4CounterHeapDescriptor => "MTL4CounterHeapDescriptor";);
1294opaque_symbol_class!(pub struct Metal4FunctionDescriptor => "MTL4FunctionDescriptor";);
1295opaque_symbol_class!(pub struct Metal4IndirectInstanceAccelerationStructureDescriptor => "MTL4IndirectInstanceAccelerationStructureDescriptor";);
1296opaque_symbol_class!(pub struct Metal4InstanceAccelerationStructureDescriptor => "MTL4InstanceAccelerationStructureDescriptor";);
1297opaque_symbol_class!(pub struct Metal4LibraryDescriptor => "MTL4LibraryDescriptor";);
1298opaque_symbol_class!(pub struct Metal4LibraryFunctionDescriptor => "MTL4LibraryFunctionDescriptor";);
1299opaque_symbol_class!(pub struct Metal4MachineLearningPipelineDescriptor => "MTL4MachineLearningPipelineDescriptor";);
1300opaque_symbol_class!(pub struct Metal4MachineLearningPipelineReflection => "MTL4MachineLearningPipelineReflection";);
1301opaque_symbol_class!(pub struct Metal4MeshRenderPipelineDescriptor => "MTL4MeshRenderPipelineDescriptor";);
1302opaque_symbol_class!(pub struct Metal4PipelineDataSetSerializerDescriptor => "MTL4PipelineDataSetSerializerDescriptor";);
1303opaque_symbol_class!(pub struct Metal4PipelineDescriptor => "MTL4PipelineDescriptor";);
1304opaque_symbol_class!(pub struct Metal4PipelineOptions => "MTL4PipelineOptions";);
1305opaque_symbol_class!(pub struct Metal4PipelineStageDynamicLinkingDescriptor => "MTL4PipelineStageDynamicLinkingDescriptor";);
1306opaque_symbol_class!(pub struct Metal4PrimitiveAccelerationStructureDescriptor => "MTL4PrimitiveAccelerationStructureDescriptor";);
1307opaque_symbol_class!(pub struct Metal4RenderPassDescriptor => "MTL4RenderPassDescriptor";);
1308opaque_symbol_class!(pub struct Metal4RenderPipelineBinaryFunctionsDescriptor => "MTL4RenderPipelineBinaryFunctionsDescriptor";);
1309opaque_symbol_class!(pub struct Metal4RenderPipelineColorAttachmentDescriptor => "MTL4RenderPipelineColorAttachmentDescriptor";);
1310opaque_symbol_class!(pub struct Metal4RenderPipelineColorAttachmentDescriptorArray => "MTL4RenderPipelineColorAttachmentDescriptorArray";);
1311opaque_symbol_class!(pub struct Metal4RenderPipelineDescriptor => "MTL4RenderPipelineDescriptor";);
1312opaque_symbol_class!(pub struct Metal4RenderPipelineDynamicLinkingDescriptor => "MTL4RenderPipelineDynamicLinkingDescriptor";);
1313opaque_symbol_class!(pub struct Metal4SpecializedFunctionDescriptor => "MTL4SpecializedFunctionDescriptor";);
1314opaque_symbol_class!(pub struct Metal4StaticLinkingDescriptor => "MTL4StaticLinkingDescriptor";);
1315opaque_symbol_class!(pub struct Metal4StitchedFunctionDescriptor => "MTL4StitchedFunctionDescriptor";);
1316opaque_symbol_class!(pub struct Metal4TileRenderPipelineDescriptor => "MTL4TileRenderPipelineDescriptor";);
1317opaque_symbol_class!(pub struct MetalAccelerationStructureBoundingBoxGeometryDescriptor => "MTLAccelerationStructureBoundingBoxGeometryDescriptor";);
1318opaque_symbol_class!(pub struct MetalAccelerationStructureCurveGeometryDescriptor => "MTLAccelerationStructureCurveGeometryDescriptor";);
1319opaque_symbol_class!(pub struct MetalAccelerationStructureDescriptor => "MTLAccelerationStructureDescriptor";);
1320opaque_symbol_class!(pub struct MetalAccelerationStructureGeometryDescriptor => "MTLAccelerationStructureGeometryDescriptor";);
1321opaque_symbol_class!(pub struct MetalAccelerationStructureMotionBoundingBoxGeometryDescriptor => "MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor";);
1322opaque_symbol_class!(pub struct MetalAccelerationStructureMotionCurveGeometryDescriptor => "MTLAccelerationStructureMotionCurveGeometryDescriptor";);
1323opaque_symbol_class!(pub struct MetalAccelerationStructureMotionTriangleGeometryDescriptor => "MTLAccelerationStructureMotionTriangleGeometryDescriptor";);
1324opaque_symbol_class!(pub struct MetalAccelerationStructurePassDescriptor => "MTLAccelerationStructurePassDescriptor";);
1325opaque_symbol_class!(pub struct MetalAccelerationStructurePassSampleBufferAttachmentDescriptor => "MTLAccelerationStructurePassSampleBufferAttachmentDescriptor";);
1326opaque_symbol_class!(pub struct MetalAccelerationStructurePassSampleBufferAttachmentDescriptorArray => "MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray";);
1327opaque_symbol_class!(pub struct MetalAccelerationStructureTriangleGeometryDescriptor => "MTLAccelerationStructureTriangleGeometryDescriptor";);
1328opaque_symbol_class!(pub struct MetalArchitecture => "MTLArchitecture";);
1329opaque_symbol_class!(pub struct MetalArgument => "MTLArgument";);
1330opaque_symbol_class!(pub struct MetalArrayType => "MTLArrayType";);
1331opaque_symbol_class!(pub struct MetalAttribute => "MTLAttribute";);
1332opaque_symbol_class!(pub struct MetalAttributeDescriptor => "MTLAttributeDescriptor";);
1333opaque_symbol_class!(pub struct MetalAttributeDescriptorArray => "MTLAttributeDescriptorArray";);
1334opaque_symbol_class!(pub struct MetalBinaryArchiveDescriptor => "MTLBinaryArchiveDescriptor";);
1335opaque_symbol_class!(pub struct MetalBlitPassDescriptor => "MTLBlitPassDescriptor";);
1336opaque_symbol_class!(pub struct MetalBlitPassSampleBufferAttachmentDescriptor => "MTLBlitPassSampleBufferAttachmentDescriptor";);
1337opaque_symbol_class!(pub struct MetalBlitPassSampleBufferAttachmentDescriptorArray => "MTLBlitPassSampleBufferAttachmentDescriptorArray";);
1338opaque_symbol_class!(pub struct MetalBufferLayoutDescriptor => "MTLBufferLayoutDescriptor";);
1339opaque_symbol_class!(pub struct MetalBufferLayoutDescriptorArray => "MTLBufferLayoutDescriptorArray";);
1340opaque_symbol_class!(
1341    /// `MTLCaptureDescriptor` — configures a GPU capture session.
1342    pub struct MetalCaptureDescriptor => "MTLCaptureDescriptor";
1343);
1344opaque_symbol_class!(pub struct MetalCommandBufferDescriptor => "MTLCommandBufferDescriptor";);
1345opaque_symbol_class!(pub struct MetalCommandQueueDescriptor => "MTLCommandQueueDescriptor";);
1346opaque_symbol_class!(pub struct MetalCompileOptions => "MTLCompileOptions";);
1347opaque_symbol_class!(pub struct MetalComputePassDescriptor => "MTLComputePassDescriptor";);
1348opaque_symbol_class!(pub struct MetalComputePassSampleBufferAttachmentDescriptor => "MTLComputePassSampleBufferAttachmentDescriptor";);
1349opaque_symbol_class!(pub struct MetalComputePassSampleBufferAttachmentDescriptorArray => "MTLComputePassSampleBufferAttachmentDescriptorArray";);
1350opaque_symbol_class!(pub struct MetalComputePipelineReflection => "MTLComputePipelineReflection";);
1351opaque_symbol_class!(pub struct MetalCounterSampleBufferDescriptor => "MTLCounterSampleBufferDescriptor";);
1352opaque_symbol_class!(pub struct MetalFunctionConstant => "MTLFunctionConstant";);
1353opaque_symbol_class!(pub struct MetalFunctionConstantValues => "MTLFunctionConstantValues";);
1354opaque_symbol_class!(pub struct MetalFunctionDescriptor => "MTLFunctionDescriptor";);
1355opaque_symbol_class!(pub struct MetalFunctionReflection => "MTLFunctionReflection";);
1356opaque_symbol_class!(pub struct MetalFunctionStitchingAttributeAlwaysInline => "MTLFunctionStitchingAttributeAlwaysInline";);
1357opaque_symbol_class!(pub struct MetalFunctionStitchingFunctionNode => "MTLFunctionStitchingFunctionNode";);
1358opaque_symbol_class!(pub struct MetalFunctionStitchingGraph => "MTLFunctionStitchingGraph";);
1359opaque_symbol_class!(pub struct MetalFunctionStitchingInputNode => "MTLFunctionStitchingInputNode";);
1360opaque_symbol_class!(pub struct MetalFxFrameInterpolatorDescriptor => "MTLFXFrameInterpolatorDescriptor";);
1361opaque_symbol_class!(pub struct MetalFxTemporalDenoisedScalerDescriptor => "MTLFXTemporalDenoisedScalerDescriptor";);
1362opaque_symbol_class!(pub struct MetalHeapDescriptor => "MTLHeapDescriptor";);
1363opaque_symbol_class!(pub struct MetalIndirectCommandBufferDescriptor => "MTLIndirectCommandBufferDescriptor";);
1364opaque_symbol_class!(pub struct MetalIndirectInstanceAccelerationStructureDescriptor => "MTLIndirectInstanceAccelerationStructureDescriptor";);
1365opaque_symbol_class!(pub struct MetalInstanceAccelerationStructureDescriptor => "MTLInstanceAccelerationStructureDescriptor";);
1366opaque_symbol_class!(pub struct MetalIntersectionFunctionDescriptor => "MTLIntersectionFunctionDescriptor";);
1367opaque_symbol_class!(pub struct MetalIntersectionFunctionTableDescriptor => "MTLIntersectionFunctionTableDescriptor";);
1368opaque_symbol_class!(pub struct MetalIoCommandQueueDescriptor => "MTLIOCommandQueueDescriptor";);
1369opaque_symbol_class!(pub struct MetalLinkedFunctions => "MTLLinkedFunctions";);
1370opaque_symbol_class!(pub struct MetalLogStateDescriptor => "MTLLogStateDescriptor";);
1371opaque_symbol_class!(pub struct MetalLogicalToPhysicalColorAttachmentMap => "MTLLogicalToPhysicalColorAttachmentMap";);
1372opaque_symbol_class!(pub struct MetalMeshRenderPipelineDescriptor => "MTLMeshRenderPipelineDescriptor";);
1373opaque_symbol_class!(pub struct MetalMotionKeyframeData => "MTLMotionKeyframeData";);
1374opaque_symbol_class!(pub struct MetalPipelineBufferDescriptor => "MTLPipelineBufferDescriptor";);
1375opaque_symbol_class!(pub struct MetalPipelineBufferDescriptorArray => "MTLPipelineBufferDescriptorArray";);
1376opaque_symbol_class!(pub struct MetalPointerType => "MTLPointerType";);
1377opaque_symbol_class!(pub struct MetalPrimitiveAccelerationStructureDescriptor => "MTLPrimitiveAccelerationStructureDescriptor";);
1378opaque_symbol_class!(pub struct MetalRasterizationRateLayerArray => "MTLRasterizationRateLayerArray";);
1379opaque_symbol_class!(pub struct MetalRasterizationRateLayerDescriptor => "MTLRasterizationRateLayerDescriptor";);
1380opaque_symbol_class!(pub struct MetalRasterizationRateMapDescriptor => "MTLRasterizationRateMapDescriptor";);
1381opaque_symbol_class!(pub struct MetalRasterizationRateSampleArray => "MTLRasterizationRateSampleArray";);
1382opaque_symbol_class!(pub struct MetalRenderPassAttachmentDescriptor => "MTLRenderPassAttachmentDescriptor";);
1383opaque_symbol_class!(pub struct MetalRenderPassColorAttachmentDescriptor => "MTLRenderPassColorAttachmentDescriptor";);
1384opaque_symbol_class!(pub struct MetalRenderPassColorAttachmentDescriptorArray => "MTLRenderPassColorAttachmentDescriptorArray";);
1385opaque_symbol_class!(pub struct MetalRenderPassDepthAttachmentDescriptor => "MTLRenderPassDepthAttachmentDescriptor";);
1386opaque_symbol_class!(pub struct MetalRenderPassDescriptor => "MTLRenderPassDescriptor";);
1387opaque_symbol_class!(pub struct MetalRenderPassSampleBufferAttachmentDescriptor => "MTLRenderPassSampleBufferAttachmentDescriptor";);
1388opaque_symbol_class!(pub struct MetalRenderPassSampleBufferAttachmentDescriptorArray => "MTLRenderPassSampleBufferAttachmentDescriptorArray";);
1389opaque_symbol_class!(pub struct MetalRenderPassStencilAttachmentDescriptor => "MTLRenderPassStencilAttachmentDescriptor";);
1390opaque_symbol_class!(pub struct MetalRenderPipelineColorAttachmentDescriptorArray => "MTLRenderPipelineColorAttachmentDescriptorArray";);
1391opaque_symbol_class!(pub struct MetalRenderPipelineFunctionsDescriptor => "MTLRenderPipelineFunctionsDescriptor";);
1392opaque_symbol_class!(pub struct MetalRenderPipelineReflection => "MTLRenderPipelineReflection";);
1393opaque_symbol_class!(pub struct MetalResidencySetDescriptor => "MTLResidencySetDescriptor";);
1394opaque_symbol_class!(pub struct MetalResourceStatePassDescriptor => "MTLResourceStatePassDescriptor";);
1395opaque_symbol_class!(pub struct MetalResourceStatePassSampleBufferAttachmentDescriptor => "MTLResourceStatePassSampleBufferAttachmentDescriptor";);
1396opaque_symbol_class!(pub struct MetalResourceStatePassSampleBufferAttachmentDescriptorArray => "MTLResourceStatePassSampleBufferAttachmentDescriptorArray";);
1397opaque_symbol_class!(pub struct MetalResourceViewPoolDescriptor => "MTLResourceViewPoolDescriptor";);
1398opaque_symbol_class!(pub struct MetalSharedEventHandle => "MTLSharedEventHandle";);
1399opaque_symbol_class!(pub struct MetalSharedEventListener => "MTLSharedEventListener";);
1400opaque_symbol_class!(pub struct MetalSharedTextureHandle => "MTLSharedTextureHandle";);
1401opaque_symbol_class!(pub struct MetalStageInputOutputDescriptor => "MTLStageInputOutputDescriptor";);
1402opaque_symbol_class!(pub struct MetalStitchedLibraryDescriptor => "MTLStitchedLibraryDescriptor";);
1403opaque_symbol_class!(pub struct MetalStructMember => "MTLStructMember";);
1404opaque_symbol_class!(pub struct MetalStructType => "MTLStructType";);
1405opaque_symbol_class!(pub struct MetalTensorDescriptor => "MTLTensorDescriptor";);
1406opaque_symbol_class!(pub struct MetalTensorExtents => "MTLTensorExtents";);
1407opaque_symbol_class!(pub struct MetalTensorReferenceType => "MTLTensorReferenceType";);
1408opaque_symbol_class!(pub struct MetalTextureReferenceType => "MTLTextureReferenceType";);
1409opaque_symbol_class!(pub struct MetalTextureViewDescriptor => "MTLTextureViewDescriptor";);
1410opaque_symbol_class!(pub struct MetalTileRenderPipelineColorAttachmentDescriptorArray => "MTLTileRenderPipelineColorAttachmentDescriptorArray";);
1411opaque_symbol_class!(pub struct MetalType => "MTLType";);
1412opaque_symbol_class!(pub struct MetalVertexAttribute => "MTLVertexAttribute";);
1413opaque_symbol_class!(pub struct MetalVertexAttributeDescriptor => "MTLVertexAttributeDescriptor";);
1414opaque_symbol_class!(pub struct MetalVertexAttributeDescriptorArray => "MTLVertexAttributeDescriptorArray";);
1415opaque_symbol_class!(pub struct MetalVertexBufferLayoutDescriptor => "MTLVertexBufferLayoutDescriptor";);
1416opaque_symbol_class!(pub struct MetalVertexBufferLayoutDescriptorArray => "MTLVertexBufferLayoutDescriptorArray";);
1417opaque_symbol_class!(pub struct MetalVertexDescriptor => "MTLVertexDescriptor";);
1418opaque_symbol_class!(pub struct MetalVisibleFunctionTableDescriptor => "MTLVisibleFunctionTableDescriptor";);