mtl-rs 0.2.1

Rust bindings for Apple's Metal API
#![allow(deprecated)]

use objc2::{Encode, Encoding, RefEncode};

/// Location of the GPU on macOS (ported from `MTLDeviceLocation`).
#[deprecated(note = "device location is not applicable on Apple Silicon")]
#[repr(u64)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, PartialOrd, Ord)]
pub enum MTLDeviceLocation {
    BuiltIn = 0,
    Slot = 1,
    External = 2,
    Unspecified = u64::MAX,
}

unsafe impl Encode for MTLDeviceLocation {
    const ENCODING: Encoding = u64::ENCODING;
}

unsafe impl RefEncode for MTLDeviceLocation {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}