33
44using CEnum: CEnum, @cenum
55
6+ const libmtl = Symbol (" /System/Library/Frameworks/Metal.framework/Metal" )
7+
68const _NSRange = NSRange
79
810
@@ -23,7 +25,7 @@ struct MTLTextureSwizzleChannels
2325end
2426
2527function MTLTextureSwizzleChannelsMake (r, g, b, a)
26- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLTextureSwizzleChannelsMake (r:: MTLTextureSwizzle , g:: MTLTextureSwizzle , b:: MTLTextureSwizzle , a:: MTLTextureSwizzle ):: MTLTextureSwizzleChannels
28+ return @ccall libmtl . MTLTextureSwizzleChannelsMake (r:: MTLTextureSwizzle , g:: MTLTextureSwizzle , b:: MTLTextureSwizzle , a:: MTLTextureSwizzle ):: MTLTextureSwizzleChannels
2729end
2830
2931struct MTLOrigin
@@ -33,7 +35,7 @@ struct MTLOrigin
3335end
3436
3537function MTLOriginMake (x, y, z)
36- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLOriginMake (x:: NSUInteger , y:: NSUInteger , z:: NSUInteger ):: MTLOrigin
38+ return @ccall libmtl . MTLOriginMake (x:: NSUInteger , y:: NSUInteger , z:: NSUInteger ):: MTLOrigin
3739end
3840
3941struct MTLSize
@@ -43,7 +45,7 @@ struct MTLSize
4345end
4446
4547function MTLSizeMake (width, height, depth)
46- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLSizeMake (width:: NSUInteger , height:: NSUInteger , depth:: NSUInteger ):: MTLSize
48+ return @ccall libmtl . MTLSizeMake (width:: NSUInteger , height:: NSUInteger , depth:: NSUInteger ):: MTLSize
4749end
4850
4951struct MTLRegion
@@ -52,15 +54,15 @@ struct MTLRegion
5254end
5355
5456function MTLRegionMake1D (x, width)
55- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLRegionMake1D (x:: NSUInteger , width:: NSUInteger ):: MTLRegion
57+ return @ccall libmtl . MTLRegionMake1D (x:: NSUInteger , width:: NSUInteger ):: MTLRegion
5658end
5759
5860function MTLRegionMake2D (x, y, width, height)
59- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLRegionMake2D (x:: NSUInteger , y:: NSUInteger , width:: NSUInteger , height:: NSUInteger ):: MTLRegion
61+ return @ccall libmtl . MTLRegionMake2D (x:: NSUInteger , y:: NSUInteger , width:: NSUInteger , height:: NSUInteger ):: MTLRegion
6062end
6163
6264function MTLRegionMake3D (x, y, z, width, height, depth)
63- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLRegionMake3D (x:: NSUInteger , y:: NSUInteger , z:: NSUInteger , width:: NSUInteger , height:: NSUInteger , depth:: NSUInteger ):: MTLRegion
65+ return @ccall libmtl . MTLRegionMake3D (x:: NSUInteger , y:: NSUInteger , z:: NSUInteger , width:: NSUInteger , height:: NSUInteger , depth:: NSUInteger ):: MTLRegion
6466end
6567
6668struct MTLSamplePosition
@@ -69,13 +71,13 @@ struct MTLSamplePosition
6971end
7072
7173function MTLSamplePositionMake (x, y)
72- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLSamplePositionMake (x:: Cfloat , y:: Cfloat ):: MTLSamplePosition
74+ return @ccall libmtl . MTLSamplePositionMake (x:: Cfloat , y:: Cfloat ):: MTLSamplePosition
7375end
7476
7577const MTLCoordinate2D = MTLSamplePosition
7678
7779function MTLCoordinate2DMake (x, y)
78- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLCoordinate2DMake (x:: Cfloat , y:: Cfloat ):: MTLCoordinate2D
80+ return @ccall libmtl . MTLCoordinate2DMake (x:: Cfloat , y:: Cfloat ):: MTLCoordinate2D
7981end
8082
8183struct MTLResourceID
@@ -1346,7 +1348,7 @@ struct MTLClearColor
13461348end
13471349
13481350function MTLClearColorMake (red, green, blue, alpha)
1349- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLClearColorMake (red:: Cdouble , green:: Cdouble , blue:: Cdouble , alpha:: Cdouble ):: MTLClearColor
1351+ return @ccall libmtl . MTLClearColorMake (red:: Cdouble , green:: Cdouble , blue:: Cdouble , alpha:: Cdouble ):: MTLClearColor
13501352end
13511353
13521354@cenum MTLLoadAction:: UInt64 begin
@@ -2373,7 +2375,7 @@ struct MTL4BufferRange
23732375end
23742376
23752377function MTL4BufferRangeMake (bufferAddress, length)
2376- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTL4BufferRangeMake (bufferAddress:: MTLGPUAddress , length:: UInt64 ):: MTL4BufferRange
2378+ return @ccall libmtl . MTL4BufferRangeMake (bufferAddress:: MTLGPUAddress , length:: UInt64 ):: MTL4BufferRange
23772379end
23782380
23792381struct _MTLPackedFloat3
@@ -2412,7 +2414,7 @@ end
24122414const MTLPackedFloat3 = _MTLPackedFloat3
24132415
24142416function MTLPackedFloat3Make (x, y, z)
2415- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLPackedFloat3Make (x:: Cfloat , y:: Cfloat , z:: Cfloat ):: MTLPackedFloat3
2417+ return @ccall libmtl . MTLPackedFloat3Make (x:: Cfloat , y:: Cfloat , z:: Cfloat ):: MTLPackedFloat3
24162418end
24172419
24182420struct MTLPackedFloatQuaternion
@@ -2423,7 +2425,7 @@ struct MTLPackedFloatQuaternion
24232425end
24242426
24252427function MTLPackedFloatQuaternionMake (x, y, z, w)
2426- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLPackedFloatQuaternionMake (x:: Cfloat , y:: Cfloat , z:: Cfloat , w:: Cfloat ):: MTLPackedFloatQuaternion
2428+ return @ccall libmtl . MTLPackedFloatQuaternionMake (x:: Cfloat , y:: Cfloat , z:: Cfloat , w:: Cfloat ):: MTLPackedFloatQuaternion
24272429end
24282430
24292431struct _MTLPackedFloat4x3
@@ -2991,7 +2993,7 @@ struct MTLIndirectCommandBufferExecutionRange
29912993end
29922994
29932995function MTLIndirectCommandBufferExecutionRangeMake (location, length)
2994- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLIndirectCommandBufferExecutionRangeMake (location:: UInt32 , length:: UInt32 ):: MTLIndirectCommandBufferExecutionRange
2996+ return @ccall libmtl . MTLIndirectCommandBufferExecutionRangeMake (location:: UInt32 , length:: UInt32 ):: MTLIndirectCommandBufferExecutionRange
29952997end
29962998
29972999@objcwrapper immutable = true MTLIndirectCommandBufferDescriptor <: NSObject
@@ -3269,19 +3271,19 @@ end
32693271const MTLIOCompressionContext = Ptr{Cvoid}
32703272
32713273function MTLIOCompressionContextDefaultChunkSize ()
3272- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLIOCompressionContextDefaultChunkSize ():: Csize_t
3274+ return @ccall libmtl . MTLIOCompressionContextDefaultChunkSize ():: Csize_t
32733275end
32743276
32753277function MTLIOCreateCompressionContext (path, type, chunkSize)
3276- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLIOCreateCompressionContext (path:: Cstring , type:: MTLIOCompressionMethod , chunkSize:: Csize_t ):: MTLIOCompressionContext
3278+ return @ccall libmtl . MTLIOCreateCompressionContext (path:: Cstring , type:: MTLIOCompressionMethod , chunkSize:: Csize_t ):: MTLIOCompressionContext
32773279end
32783280
32793281function MTLIOCompressionContextAppendData (context, data, size)
3280- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLIOCompressionContextAppendData (context:: MTLIOCompressionContext , data:: Ptr{Cvoid} , size:: Csize_t ):: Cvoid
3282+ return @ccall libmtl . MTLIOCompressionContextAppendData (context:: MTLIOCompressionContext , data:: Ptr{Cvoid} , size:: Csize_t ):: Cvoid
32813283end
32823284
32833285function MTLIOFlushAndDestroyCompressionContext (context)
3284- return @ccall ( Symbol ( " /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib " )) . MTLIOFlushAndDestroyCompressionContext (context:: MTLIOCompressionContext ):: MTLIOCompressionStatus
3286+ return @ccall libmtl . MTLIOFlushAndDestroyCompressionContext (context:: MTLIOCompressionContext ):: MTLIOCompressionStatus
32853287end
32863288
32873289@objcwrapper immutable = true availability = macos (v " 15.0.0" ) MTLResidencySetDescriptor <: NSObject
0 commit comments