Skip to content

Commit 1b0c776

Browse files
committed
Lots of small things for 0.17 release
1 parent 9c4b236 commit 1b0c776

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "metal"
3-
version = "0.16.1"
3+
version = "0.17.0"
44
description = "Rust bindings for Metal"
55
documentation = "https://docs.rs/crate/metal"
66
homepage = "https://github.com/gfx-rs/metal-rs"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# metal-rs
22
[![Build Status](https://travis-ci.org/gfx-rs/metal-rs.svg?branch=master)](https://travis-ci.org/gfx-rs/metal-rs)
3+
[![Crates.io](https://img.shields.io/crates/v/metal.svg?label=metal)](https://crates.io/crates/metal)
34

45
Unsafe Rust bindings for the Metal 3D Graphics API.
56

src/device.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,17 +1395,12 @@ impl Device {
13951395
unsafe { MTLCreateSystemDefaultDevice().as_mut().map(|x| Self(x)) }
13961396
}
13971397

1398-
#[cfg(target_os = "ios")]
1399-
pub fn all() -> Vec<Device> {
1400-
if let Some(system_default) = Device::system_default() {
1401-
vec![system_default]
1402-
} else {
1403-
vec![]
1398+
pub fn all() -> Vec<Self> {
1399+
#[cfg(target_os = "ios")]
1400+
{
1401+
Self::system_default().into_iter().collect()
14041402
}
1405-
}
1406-
1407-
#[cfg(not(target_os = "ios"))]
1408-
pub fn all() -> Vec<Device> {
1403+
#[cfg(not(target_os = "ios"))]
14091404
unsafe {
14101405
let array = MTLCopyAllDevices();
14111406
let count: NSUInteger = msg_send![array, count];
@@ -1641,7 +1636,6 @@ impl DeviceRef {
16411636
}
16421637
}
16431638

1644-
#[cfg(feature = "private")]
16451639
pub unsafe fn new_compute_pipeline_state(
16461640
&self,
16471641
descriptor: &ComputePipelineDescriptorRef,

src/encoder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,7 @@ impl RenderCommandEncoderRef {
228228
}
229229
}
230230

231-
//TODO: change argument order
232-
pub fn set_visibility_result_mode(&self, offset: NSUInteger, mode: MTLVisibilityResultMode) {
231+
pub fn set_visibility_result_mode(&self, mode: MTLVisibilityResultMode, offset: NSUInteger) {
233232
unsafe {
234233
msg_send![self, setVisibilityResultMode:mode
235234
offset:offset]

src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ fn nsstring_from_str(string: &str) -> *mut objc::runtime::Object {
4848
let bytes = string.as_ptr() as *const c_void;
4949
unsafe {
5050
let obj: *mut objc::runtime::Object = msg_send![cls, alloc];
51-
let obj: *mut objc::runtime::Object = msg_send![obj, initWithBytes:bytes
52-
length:string.len()
53-
encoding:UTF8_ENCODING];
51+
let obj: *mut objc::runtime::Object = msg_send![
52+
obj,
53+
initWithBytes:bytes
54+
length:string.len()
55+
encoding:UTF8_ENCODING
56+
];
5457
let _: *mut c_void = msg_send![obj, autorelease];
5558
obj
5659
}

src/library.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ pub enum MTLLanguageVersion {
100100
V1_2 = 0x10002,
101101
V2_0 = 0x20000,
102102
V2_1 = 0x20001,
103+
V2_2 = 0x20002,
103104
}
104105

105106
pub enum MTLFunctionConstantValues {}

0 commit comments

Comments
 (0)