docs.rs failed to build mtl-sys-1.0.1
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.
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.
metal.rs
Rust bindings to Apple's Metal framework. This is a direct conversion of metal-cpp to Rust, preserving the same API structure and naming conventions where possible.
94% of this codebase was converted from C++ to Rust by Claude, Anthropic's AI assistant.
Requirements
- macOS or iOS with Metal-capable hardware
- Rust 1.85+
Crates
| Crate | Description |
|---|---|
mtl-gpu |
Safe Metal bindings - devices, resources, commands, pipelines, encoders |
mtl-sys |
Low-level Objective-C FFI (zero external dependencies) |
mtl-foundation |
Foundation framework bindings (NSObject, NSString, NSArray, etc.) |
mtl-fx |
MetalFX bindings (SpatialScaler, TemporalScaler, FrameInterpolator) |
mtl-quartz-core |
CAMetalLayer/CAMetalDrawable for display integration |
Usage
Add to your Cargo.toml:
[]
= { = "https://github.com/jasonherald/metal.rs" }
Example: Query device info
use device;
Example: Run a compute shader
use ;
const SHADER: &str = r#"
#include <metal_stdlib>
using namespace metal;
kernel void double_values(device float* data [[buffer(0)]], uint id [[thread_position_in_grid]]) {
data[id] = data[id] * 2.0;
}
"#;
Running Examples
# ... examples 04-10 cover blit operations, async completion, and Metal 4 features
API Coverage
- 253/253 classes (100%)
- 2963/3175 methods (93%)
- 125/125 enums (100%)
See docs/API_COVERAGE.md for details.
License
MIT OR Apache-2.0