2 releases

0.2.2 May 21, 2024
0.2.1 May 21, 2024
0.2.0 Apr 17, 2024

#120 in macOS and iOS APIs

Download history 7/week @ 2024-05-03 3126/week @ 2024-05-17 9637/week @ 2024-05-24 14156/week @ 2024-05-31 13258/week @ 2024-06-07 15651/week @ 2024-06-14 15820/week @ 2024-06-21 23178/week @ 2024-06-28 25818/week @ 2024-07-05 28618/week @ 2024-07-12 30327/week @ 2024-07-19 40025/week @ 2024-07-26 39743/week @ 2024-08-02 44856/week @ 2024-08-09 34416/week @ 2024-08-16

165,562 downloads per month
Used in 516 crates (12 directly)

MIT license

3.5MB
72K SLoC

objc2-metal

Latest version License Documentation CI

Rust bindings to Apple's framework Metal.

This README is kept intentionally small to consolidate the documentation, see the Rust docs for more details on this crate.

This crate is part of the objc2 project, see that for related crates.


lib.rs:

Bindings to the Metal framework

See Apple's docs and the general docs on framework crates for more information.

Metal has tools for validating that you're using it correctly, using these is highly recommended! See Apple's documentation on it, or run man MetalValidation to get information on environment variables.

Note: To use MTLCreateSystemDefaultDevice you need to link to CoreGraphics, this can be done by using objc2-app-kit, or by doing:

#[link(name = "CoreGraphics", kind = "framework")]
extern "C" {}

Example

Drawing a rotating triangle.

With the following shader.

Dependencies