use objc2::{Encode, Encoding, RefEncode};
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct MTLIntersectionFunctionBufferArguments {
pub intersection_function_buffer: u64,
pub intersection_function_buffer_size: u64,
pub intersection_function_stride: u64,
}
unsafe impl Encode for MTLIntersectionFunctionBufferArguments {
const ENCODING: Encoding = Encoding::Struct("?", &[u64::ENCODING, u64::ENCODING, u64::ENCODING]);
}
unsafe impl RefEncode for MTLIntersectionFunctionBufferArguments {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(test)]
mod tests {
use core::mem::{align_of, size_of};
use super::MTLIntersectionFunctionBufferArguments;
#[test]
fn buffer_arguments_match_the_metal_abi() {
assert_eq!(size_of::<MTLIntersectionFunctionBufferArguments>(), 24);
assert_eq!(align_of::<MTLIntersectionFunctionBufferArguments>(), 8);
}
}