apple-metal-rs
Safe Rust bindings for Apple's Metal framework on macOS.
The crate is intentionally tiny: it exposes the bits needed to obtain a
GPU device handle and bridge it with Apple's
IOSurface for
zero-copy texture access. For higher-level rendering you can pair it
with the metal crate or
objc2-metal.
Quick start
use MetalDevice;
let device = system_default.expect;
println!;
Zero-copy from IOSurface
With the default iosurface feature:
#
#
#
Status
v0.1 covers:
MetalDevice::system_default()—MTLCreateSystemDefaultDeviceMetalTexturewithwidth / height / pixel_format / as_ptrIOSurfaceMetalExt::create_metal_texture(device, plane_index)- Common
MTLPixelFormatconstants is_ycbcr_biplanar(fourcc)helper
Extracted from apple-cf-rs v0.1.1's metal feature so the Metal
surface area can grow on its own without bloating CoreFoundation.