diff --git a/Cargo.toml b/Cargo.toml index d1b7ed8f..dc31a3af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "metal" -version = "0.13.0" +version = "0.13.1" description = "Rust bindings for Metal" documentation = "https://docs.rs/crate/metal" homepage = "https://github.com/gfx-rs/metal-rs" diff --git a/src/device.rs b/src/device.rs index 1bb76d8f..8ebed06b 100644 --- a/src/device.rs +++ b/src/device.rs @@ -1336,7 +1336,7 @@ foreign_obj_type! { } impl Device { - pub fn system_default() -> Device { + pub fn system_default() -> Self { unsafe { Device(MTLCreateSystemDefaultDevice()) } } @@ -1632,4 +1632,10 @@ impl DeviceRef { msg_send![self, heapTextureSizeAndAlignWithDescriptor: descriptor] } } + + pub fn minimum_linear_texture_alignment_for_pixel_format(&self, format: MTLPixelFormat) -> NSUInteger { + unsafe { + msg_send![self, minimumLinearTextureAlignmentForPixelFormat: format] + } + } }