Skip to content

Commit

Permalink
Fix visionos cfgs
Browse files Browse the repository at this point in the history
  • Loading branch information
guusw authored and kvark committed Sep 27, 2024
1 parent 02b4375 commit 96973ad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ pub struct MTLAccelerationStructureSizes {
#[cfg_attr(feature = "link", link(name = "Metal", kind = "framework"))]
extern "C" {
fn MTLCreateSystemDefaultDevice() -> *mut MTLDevice;
#[cfg(not(target_os = "ios"))]
#[cfg(not(any(target_os = "ios", target_os = "visionos")))]
fn MTLCopyAllDevices() -> *mut Object; //TODO: Array
}

Expand All @@ -1475,11 +1475,11 @@ type dispatch_block_t = *const Block<(), ()>;
const DISPATCH_DATA_DESTRUCTOR_DEFAULT: dispatch_block_t = ptr::null();

#[cfg_attr(
all(feature = "link", any(target_os = "macos", target_os = "ios")),
all(feature = "link", any(target_os = "macos", target_os = "ios", target_os = "visionos")),
link(name = "System", kind = "dylib")
)]
#[cfg_attr(
all(feature = "link", not(any(target_os = "macos", target_os = "ios"))),
all(feature = "link", not(any(target_os = "macos", target_os = "ios", target_os = "visionos"))),
link(name = "dispatch", kind = "dylib")
)]
#[allow(improper_ctypes)]
Expand Down Expand Up @@ -1520,11 +1520,11 @@ impl Device {
}

pub fn all() -> Vec<Self> {
#[cfg(target_os = "ios")]
#[cfg(any(target_os = "ios", target_os = "visionos"))]
{
Self::system_default().into_iter().collect()
}
#[cfg(not(target_os = "ios"))]
#[cfg(not(any(target_os = "ios", target_os = "visionos")))]
unsafe {
let array = MTLCopyAllDevices();
let count: NSUInteger = msg_send![array, count];
Expand Down

0 comments on commit 96973ad

Please sign in to comment.