@@ -19,33 +19,83 @@ struct MTLTextureSwizzleChannels
1919 alpha:: MTLTextureSwizzle
2020end
2121
22+ function MTLTextureSwizzleChannelsMake (r, g, b, a)
23+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLTextureSwizzleChannelsMake (r:: MTLTextureSwizzle ,
24+ g:: MTLTextureSwizzle ,
25+ b:: MTLTextureSwizzle ,
26+ a:: MTLTextureSwizzle ):: MTLTextureSwizzleChannels
27+ end
28+
2229struct MTLOrigin
2330 x:: NSUInteger
2431 y:: NSUInteger
2532 z:: NSUInteger
2633 MTLOrigin (x= 0 , y= 0 , z= 0 ) = new (x, y, z)
2734end
2835
36+ function MTLOriginMake (x, y, z)
37+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLOriginMake (x:: NSUInteger ,
38+ y:: NSUInteger ,
39+ z:: NSUInteger ):: MTLOrigin
40+ end
41+
2942struct MTLSize
3043 width:: NSUInteger
3144 height:: NSUInteger
3245 depth:: NSUInteger
3346 MTLSize (w= 1 , h= 1 , d= 1 ) = new (w, h, d)
3447end
3548
49+ function MTLSizeMake (width, height, depth)
50+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLSizeMake (width:: NSUInteger ,
51+ height:: NSUInteger ,
52+ depth:: NSUInteger ):: MTLSize
53+ end
54+
3655struct MTLRegion
3756 origin:: MTLOrigin
3857 size:: MTLSize
3958 MTLRegion (origin= MTLOrigin (), size= MTLSize ()) = new (origin, size)
4059end
4160
61+ function MTLRegionMake1D (x, width)
62+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLRegionMake1D (x:: NSUInteger ,
63+ width:: NSUInteger ):: MTLRegion
64+ end
65+
66+ function MTLRegionMake2D (x, y, width, height)
67+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLRegionMake2D (x:: NSUInteger ,
68+ y:: NSUInteger ,
69+ width:: NSUInteger ,
70+ height:: NSUInteger ):: MTLRegion
71+ end
72+
73+ function MTLRegionMake3D (x, y, z, width, height, depth)
74+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLRegionMake3D (x:: NSUInteger ,
75+ y:: NSUInteger ,
76+ z:: NSUInteger ,
77+ width:: NSUInteger ,
78+ height:: NSUInteger ,
79+ depth:: NSUInteger ):: MTLRegion
80+ end
81+
4282struct MTLSamplePosition
4383 x:: Cfloat
4484 y:: Cfloat
4585end
4686
87+ function MTLSamplePositionMake (x, y)
88+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLSamplePositionMake (x:: Cfloat ,
89+ y:: Cfloat ):: MTLSamplePosition
90+ end
91+
4792const MTLCoordinate2D = MTLSamplePosition
4893
94+ function MTLCoordinate2DMake (x, y)
95+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLCoordinate2DMake (x:: Cfloat ,
96+ y:: Cfloat ):: MTLCoordinate2D
97+ end
98+
4999struct MTLResourceID
50100 _impl:: UInt64
51101end
@@ -654,6 +704,13 @@ struct MTLClearColor
654704 alpha:: Cdouble
655705end
656706
707+ function MTLClearColorMake (red, green, blue, alpha)
708+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLClearColorMake (red:: Cdouble ,
709+ green:: Cdouble ,
710+ blue:: Cdouble ,
711+ alpha:: Cdouble ):: MTLClearColor
712+ end
713+
657714@cenum MTLLoadAction:: UInt64 begin
658715 MTLLoadActionDontCare = 0x0000000000000000
659716 MTLLoadActionLoad = 0x0000000000000001
@@ -1137,13 +1194,26 @@ end
11371194
11381195const MTLPackedFloat3 = _MTLPackedFloat3
11391196
1197+ function MTLPackedFloat3Make (x, y, z)
1198+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLPackedFloat3Make (x:: Cfloat ,
1199+ y:: Cfloat ,
1200+ z:: Cfloat ):: MTLPackedFloat3
1201+ end
1202+
11401203struct MTLPackedFloatQuaternion
11411204 x:: Cfloat
11421205 y:: Cfloat
11431206 z:: Cfloat
11441207 w:: Cfloat
11451208end
11461209
1210+ function MTLPackedFloatQuaternionMake (x, y, z, w)
1211+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLPackedFloatQuaternionMake (x:: Cfloat ,
1212+ y:: Cfloat ,
1213+ z:: Cfloat ,
1214+ w:: Cfloat ):: MTLPackedFloatQuaternion
1215+ end
1216+
11471217struct _MTLPackedFloat4x3
11481218 columns:: NTuple{4,MTLPackedFloat3}
11491219end
@@ -1308,6 +1378,11 @@ struct MTLIndirectCommandBufferExecutionRange
13081378 length:: UInt32
13091379end
13101380
1381+ function MTLIndirectCommandBufferExecutionRangeMake (location, length)
1382+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLIndirectCommandBufferExecutionRangeMake (location:: UInt32 ,
1383+ length:: UInt32 ):: MTLIndirectCommandBufferExecutionRange
1384+ end
1385+
13111386@cenum MTLFunctionLogType:: UInt64 begin
13121387 MTLFunctionLogTypeValidation = 0x0000000000000000
13131388end
@@ -1395,3 +1470,23 @@ end
13951470end
13961471
13971472const MTLIOCompressionContext = Ptr{Cvoid}
1473+
1474+ function MTLIOCompressionContextDefaultChunkSize ()
1475+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLIOCompressionContextDefaultChunkSize ():: Csize_t
1476+ end
1477+
1478+ function MTLIOCreateCompressionContext (path, type, chunkSize)
1479+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLIOCreateCompressionContext (path:: Cstring ,
1480+ type:: MTLIOCompressionMethod ,
1481+ chunkSize:: Csize_t ):: MTLIOCompressionContext
1482+ end
1483+
1484+ function MTLIOCompressionContextAppendData (context, data, size)
1485+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLIOCompressionContextAppendData (context:: MTLIOCompressionContext ,
1486+ data:: Ptr{Cvoid} ,
1487+ size:: Csize_t ):: Cvoid
1488+ end
1489+
1490+ function MTLIOFlushAndDestroyCompressionContext (context)
1491+ @ccall (Symbol (" /System/Library/Frameworks/Metal.framework/Resources/BridgeSupport/Metal.dylib" )). MTLIOFlushAndDestroyCompressionContext (context:: MTLIOCompressionContext ):: MTLIOCompressionStatus
1492+ end
0 commit comments