Skip to content

Commit

Permalink
Add Metal 3.0 and 3.1 (#304)
Browse files Browse the repository at this point in the history
* Add Metal 3.0 and 3.1

* Fix clippy
  • Loading branch information
atlv24 authored Mar 15, 2024
1 parent b0f88c1 commit ff8fd3d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
3 changes: 1 addition & 2 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
use super::*;

use block::{Block, ConcreteBlock};
use foreign_types::ForeignType;
use objc::runtime::{Object, NO, YES};
use objc::runtime::{NO, YES};

use std::{ffi::CStr, os::raw::c_char, path::Path, ptr};

Expand Down
8 changes: 1 addition & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ pub extern crate foreign_types;
#[macro_use]
pub extern crate paste;

use std::{
borrow::{Borrow, ToOwned},
marker::PhantomData,
mem,
ops::Deref,
os::raw::c_void,
};
use std::{borrow::Borrow, marker::PhantomData, mem, ops::Deref, os::raw::c_void};

use core_graphics_types::{base::CGFloat, geometry::CGSize};
use foreign_types::ForeignType;
Expand Down
9 changes: 6 additions & 3 deletions src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@

use super::*;

use foreign_types::ForeignType;
use objc::runtime::{Object, BOOL, NO, YES};
use objc::runtime::{BOOL, NO, YES};

use std::ffi::CStr;
use std::os::raw::{c_char, c_void};
use std::os::raw::c_char;
use std::ptr;

/// Only available on (macos(10.12), ios(10.0)
Expand Down Expand Up @@ -361,6 +360,10 @@ pub enum MTLLanguageVersion {
V2_3 = 0x20003,
/// available on macOS 12.0+, iOS 15.0+
V2_4 = 0x20004,
/// available on macOS 13.0+, iOS 16.0+
V3_0 = 0x30000,
/// available on macOS 14.0+, iOS 17.0+
V3_1 = 0x30001,
}

/// See <https://developer.apple.com/documentation/metal/mtlfunctionconstantvalues/>
Expand Down
7 changes: 5 additions & 2 deletions src/mps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@

use super::*;

use objc::runtime::{BOOL, YES};
use objc::runtime::BOOL;

#[cfg_attr(feature = "link", link(name = "MetalPerformanceShaders", kind = "framework"))]
#[cfg_attr(
feature = "link",
link(name = "MetalPerformanceShaders", kind = "framework")
)]
extern "C" {
fn MPSSupportsMTLDevice(device: *const std::ffi::c_void) -> BOOL;
}
Expand Down
1 change: 0 additions & 1 deletion src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

use super::*;
use block::{Block, RcBlock};
use std::mem;
use std::ptr;

#[cfg(feature = "dispatch_queue")]
Expand Down

0 comments on commit ff8fd3d

Please sign in to comment.