2 releases

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

#59 in macOS and iOS APIs

Download history 37076/week @ 2024-07-24 40132/week @ 2024-07-31 43128/week @ 2024-08-07 42870/week @ 2024-08-14 48279/week @ 2024-08-21 47074/week @ 2024-08-28 51059/week @ 2024-09-04 45523/week @ 2024-09-11 49852/week @ 2024-09-18 52088/week @ 2024-09-25 60687/week @ 2024-10-02 60341/week @ 2024-10-09 63516/week @ 2024-10-16 61891/week @ 2024-10-23 65731/week @ 2024-10-30 67946/week @ 2024-11-06

269,959 downloads per month
Used in 825 crates (14 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