mtl-rs 0.1.0

Rust bindings for Apple's Metal API
docs.rs failed to build mtl-rs-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

mtl-rs

Rust bindings for Apple's Metal API, built on the modern objc2 ecosystem.

Features

  • Comprehensive Metal API coverage
  • MTL4 (Metal 4) API bindings
  • Built on objc2 for safe and modern Objective-C interop
  • Supports macOS and iOS

Installation

Add to your Cargo.toml:

[dependencies]
mtl-rs = "0.1.0"

Usage

use metal::{create_system_default_device, MTLDevice};

fn main() {
    let device = create_system_default_device()
        .expect("No Metal device found");

    println!("Device: {:?}", device.name());
    println!("Unified memory: {}", device.has_unified_memory());
    println!("Max threadgroup size: {:?}", device.max_threads_per_threadgroup());
}

Platforms

  • macOS (x86_64, aarch64)
  • iOS (aarch64)

License

MIT