mtl-rs 0.1.11

Rust bindings for Apple's Metal API
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use objc2::{Encode, Encoding, RefEncode};

/// Reduction mode for sampler filtering (from `MTLSamplerReductionMode`).
#[repr(u64)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, PartialOrd, Ord)]
pub enum MTLSamplerReductionMode {
    WeightedAverage = 0,
    Minimum = 1,
    Maximum = 2,
}

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

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