Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Metal 3.0 and 3.1 #304

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading