diff options
Diffstat (limited to 'third_party/rust/metal/src')
-rw-r--r-- | third_party/rust/metal/src/device.rs | 3 | ||||
-rw-r--r-- | third_party/rust/metal/src/lib.rs | 8 | ||||
-rw-r--r-- | third_party/rust/metal/src/library.rs | 9 | ||||
-rw-r--r-- | third_party/rust/metal/src/mps.rs | 7 | ||||
-rw-r--r-- | third_party/rust/metal/src/sync.rs | 4 |
5 files changed, 15 insertions, 16 deletions
diff --git a/third_party/rust/metal/src/device.rs b/third_party/rust/metal/src/device.rs index 11b5575577..75061cc497 100644 --- a/third_party/rust/metal/src/device.rs +++ b/third_party/rust/metal/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/third_party/rust/metal/src/lib.rs b/third_party/rust/metal/src/lib.rs index b79acf6e84..535c01da68 100644 --- a/third_party/rust/metal/src/lib.rs +++ b/third_party/rust/metal/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/third_party/rust/metal/src/library.rs b/third_party/rust/metal/src/library.rs index 2c7d0c92ce..9f7d58cc7c 100644 --- a/third_party/rust/metal/src/library.rs +++ b/third_party/rust/metal/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) @@ -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/> diff --git a/third_party/rust/metal/src/mps.rs b/third_party/rust/metal/src/mps.rs index edd4936e8e..f4c9fc89a2 100644 --- a/third_party/rust/metal/src/mps.rs +++ b/third_party/rust/metal/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/third_party/rust/metal/src/sync.rs b/third_party/rust/metal/src/sync.rs index 550e06be12..c36804813e 100644 --- a/third_party/rust/metal/src/sync.rs +++ b/third_party/rust/metal/src/sync.rs @@ -7,7 +7,7 @@ use super::*; use block::{Block, RcBlock}; -use std::mem; +use std::ptr; #[cfg(feature = "dispatch_queue")] use dispatch; @@ -63,7 +63,7 @@ impl SharedEventRef { *mut BlockBase<(&SharedEventRef, u64), ()>, >(block); (*block).flags |= BLOCK_HAS_SIGNATURE | BLOCK_HAS_COPY_DISPOSE; - (*block).extra = &BLOCK_EXTRA; + (*block).extra = ptr::addr_of!(BLOCK_EXTRA); let () = msg_send![self, notifyListener:listener atValue:value block:block]; } |