Skip to main content

MTLCopyAllDevicesWithObserver

Function MTLCopyAllDevicesWithObserver 

Source
pub unsafe extern "C" fn MTLCopyAllDevicesWithObserver(
    observer: *mut DeviceObserver,
    handler: *const c_void,
) -> *mut c_void
Expand description

Copy all devices with a notification observer.

Returns an NSArray containing all available Metal devices and sets up a notification observer for device hot-plug events.

§C++ Equivalent

NS::Array* MTL::CopyAllDevicesWithObserver(
    NS::Object** pOutObserver,
    MTL::DeviceNotificationHandlerBlock handler
);

§Arguments

  • observer - Output parameter that receives the observer reference
  • handler - Block called when device changes occur

§Returns

A pointer to an NSArray of Metal devices. The caller owns the array.