Browse Source
Metal device is mandatory to handle P010 chroma on mobile/tv devices. The Metal device API can only be used in ObjC context hence a new ObjC source file had to be created to handle the device detection.pull/162/head
committed by
Jean-Baptiste Kempf
5 changed files with 39 additions and 6 deletions
@ -0,0 +1,14 @@ |
|||
#import "vt_utils.h" |
|||
#import <Foundation/Foundation.h> |
|||
#import <Metal/Metal.h> |
|||
|
|||
bool cvpx_system_has_metal_device() |
|||
{ |
|||
#if TARGET_OS_IPHONE |
|||
id<MTLDevice> device = MTLCreateSystemDefaultDevice(); |
|||
return device != nil; |
|||
#else |
|||
NSArray <id<MTLDevice>> *devices = MTLCopyAllDevices(); |
|||
return devices.count > 0; |
|||
#endif |
|||
} |
|||
Loading…
Reference in new issue