From 0ff4b032bcb9752a2fa7cb86efd8b554d30a1180 Mon Sep 17 00:00:00 2001 From: atlas dostal Date: Wed, 13 Mar 2024 23:44:17 -0700 Subject: [PATCH 1/2] Add Metal 3.0 and 3.1 --- src/library.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/library.rs b/src/library.rs index 2c7d0c9..a05bbbf 100644 --- a/src/library.rs +++ b/src/library.rs @@ -361,6 +361,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 From e16364e3accc045abf35820b04d0b0a04eaf04d2 Mon Sep 17 00:00:00 2001 From: atlas dostal Date: Thu, 14 Mar 2024 18:58:23 -0700 Subject: [PATCH 2/2] Fix clippy --- src/device.rs | 3 +-- src/lib.rs | 8 +------- src/library.rs | 5 ++--- src/mps.rs | 7 +++++-- src/sync.rs | 1 - 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/device.rs b/src/device.rs index 11b5575..75061cc 100644 --- a/src/device.rs +++ b/src/device.rs @@ -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}; diff --git a/src/lib.rs b/src/lib.rs index b79acf6..535c01d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; diff --git a/src/library.rs b/src/library.rs index a05bbbf..9f7d58c 100644 --- a/src/library.rs +++ b/src/library.rs @@ -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) diff --git a/src/mps.rs b/src/mps.rs index edd4936..f4c9fc8 100644 --- a/src/mps.rs +++ b/src/mps.rs @@ -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; } diff --git a/src/sync.rs b/src/sync.rs index 284fd90..c368048 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -7,7 +7,6 @@ use super::*; use block::{Block, RcBlock}; -use std::mem; use std::ptr; #[cfg(feature = "dispatch_queue")]