/
metal.yaml
535 lines (525 loc) · 20.6 KB
/
metal.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
package: org.robovm.apple.metal
include: [foundation.yaml, dispatch.yaml]
library: Metal
framework: Metal
clang_args: ['-x', 'objective-c']
headers:
- /System/Library/Frameworks/Metal.framework/Headers/Metal.h
private_typedefs:
'void (^)(id<MTLLibrary>, NSError *)': '@Block VoidBlock2<MTLLibrary, NSError>'
'void (^)(id<MTLRenderPipelineState>, NSError *)': '@Block VoidBlock2<MTLRenderPipelineState, NSError>'
'void (^)(id<MTLRenderPipelineState>, MTLRenderPipelineReflection *, NSError *)': '@Block VoidBlock3<MTLRenderPipelineState, MTLRenderPipelineReflection, NSError>'
'void (^)(id<MTLComputePipelineState>, NSError *)': '@Block VoidBlock2<MTLComputePipelineState, NSError>'
'void (^)(id<MTLComputePipelineState>, MTLComputePipelineReflection *, NSError *)': '@Block VoidBlock3<MTLComputePipelineState, MTLComputePipelineReflection, NSError>'
'void (^)(void *, NSUInteger)': '@Block("(@Pointer,@MachineSizedUInt)") VoidBlock2<Long, Long>'
enums:
MTLPixelFormat: {}
MTLPurgeableState: {}
MTLCPUCacheMode: {}
MTLResourceOptions: {}
MTLFunctionType: {}
MTLLibraryErrorCode: { first: MTLLibraryErrorUnsupported }
MTLRenderPipelineErrorCode: { first: MTLRenderPipelineErrorInternal }
MTLFeatureSet: {}
MTLPipelineOption: {}
MTLTextureType: {}
MTLCommandBufferStatus: {}
MTLCommandBufferErrorCode: { first: MTLCommandBufferErrorNone }
MTLCompareFunction: {}
MTLStencilOperation: {}
MTLLoadAction: {}
MTLStoreAction: {}
MTLDataType: {}
MTLArgumentType: {}
MTLArgumentAccess: {}
MTLBlendFactor: {}
MTLBlendOperation: {}
MTLColorWriteMask: {}
MTLVertexFormat: {}
MTLVertexStepFunction: {}
MTLPrimitiveType: {}
MTLIndexType: {}
MTLVisibilityResultMode: {}
MTLCullMode: {}
MTLWinding: { prefix: MTLWinding }
MTLTriangleFillMode: {}
MTLSamplerMinMagFilter: {}
MTLSamplerMipFilter: {}
MTLSamplerAddressMode: {}
classes:
MTLCommandBufferError:
extends: NSError
MTLLibraryError:
extends: NSError
MTLRenderPipelineError:
extends: NSError
# Structs
MTLClearColor: {} # DONE
MTLOrigin: {} # DONE
MTLRegion: {} # DONE
MTLScissorRect: {} # DONE
MTLSize: {} # DONE
MTLViewport: {} # DONE
MTLArgument: {} # DONE
MTLArrayType: # DONE
methods:
'-elementStructType':
property: true
'-elementArrayType':
property: true
MTLCompileOptions: # DONE
properties:
'preprocessorMacros':
type: '@org.robovm.rt.bro.annotation.Marshaler(NSDictionary.AsStringStringMapMarshaler.class) Map<String, String>'
MTLComputePipelineReflection: # DONE
properties:
'arguments':
type: NSArray<MTLArgument>
MTLDepthStencilDescriptor: {} # DONE
MTLRenderPassAttachmentDescriptor: {} # DONE
MTLRenderPassColorAttachmentDescriptor: {} # DONE
MTLRenderPassDepthAttachmentDescriptor: {} # DONE
MTLRenderPassStencilAttachmentDescriptor: {} # DONE
MTLRenderPassColorAttachmentDescriptorArray: # DONE
methods:
'-objectAtIndexedSubscript:':
name: get
'-setObject:atIndexedSubscript:':
name: set
MTLRenderPassDescriptor: # DONE
methods:
'+renderPassDescriptor':
name: create
MTLRenderPipelineColorAttachmentDescriptor: {} # DONE
MTLRenderPipelineColorAttachmentDescriptorArray: # DONE
methods:
'-objectAtIndexedSubscript:':
name: get
'-setObject:atIndexedSubscript:':
name: set
MTLRenderPipelineDescriptor: {} # DONE
MTLRenderPipelineReflection: # DONE
properties:
'vertexArguments':
type: NSArray<MTLArgument>
'fragmentArguments':
type: NSArray<MTLArgument>
MTLSamplerDescriptor: # DONE
properties:
'normalizedCoordinates':
name: normalizesCoordinates
MTLStencilDescriptor: {} # DONE
MTLStructMember: # DONE
methods:
'-structType':
property: true
'-arrayType':
property: true
MTLStructType: # DONE
properties:
'members':
type: NSArray<MTLStructMember>
methods:
'-memberByName:':
name: getMemberByName
MTLTextureDescriptor: # DONE
methods:
'+texture2DDescriptorWithPixelFormat:width:height:mipmapped:':
name: create2DDescriptor
'+textureCubeDescriptorWithPixelFormat:size:mipmapped:':
name: createCubeDescriptor
MTLVertexAttribute: {} # DONE
MTLVertexAttributeDescriptor: {} # DONE
MTLVertexAttributeDescriptorArray: # DONE
methods:
'-objectAtIndexedSubscript:':
name: get
'-setObject:atIndexedSubscript:':
name: set
MTLVertexBufferLayoutDescriptor: {} # DONE
MTLVertexBufferLayoutDescriptorArray: # DONE
methods:
'-objectAtIndexedSubscript:':
name: get
'-setObject:atIndexedSubscript:':
name: set
MTLVertexDescriptor: # DONE
methods:
'+vertexDescriptor':
name: create
protocols:
MTLBlitCommandEncoder: # DONE
class: true
visibility: 'public final'
methods:
'-copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:':
name: copyFromTextureToTexture
'-copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:':
name: copyFromBufferToTexture
'-copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:':
name: copyFromTextureToBuffer
'-generateMipmapsForTexture:':
trim_after_first_colon: true
'-fillBuffer:range:value:':
trim_after_first_colon: true
'-copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size:':
name: copyFromBufferToBuffer
MTLBuffer: # DONE
class: true
visibility: 'public final'
methods:
'-contents':
name: getContents0
return_type: '@Pointer long'
visibility: protected
'-newTextureWithDescriptor:offset:bytesPerRow:':
name: newTexture
return_marshaler: NSObject.NoRetainMarshaler
MTLCommandBuffer: # DONE
class: true
visibility: 'public final'
properties:
'retainedReferences':
name: maintainsRetainedReferences
omit_prefix: true
methods:
'-addScheduledHandler:':
trim_after_first_colon: true
parameters:
block:
type: '@Block VoidBlock1<MTLCommandBuffer>'
'-presentDrawable:':
trim_after_first_colon: true
'-presentDrawable:atTime:':
name: presentDrawableAtTime
'-addCompletedHandler:':
trim_after_first_colon: true
parameters:
block:
type: '@Block VoidBlock1<MTLCommandBuffer>'
'-blitCommandEncoder':
name: newBlitCommandEncoder
'-renderCommandEncoderWithDescriptor:':
name: newRenderCommandEncoder
'-computeCommandEncoder':
name: newComputeCommandEncoder
'-parallelRenderCommandEncoderWithDescriptor:':
name: newParallelRenderCommandEncoder
MTLCommandEncoder: # DONE
methods:
'-insertDebugSignpost:':
trim_after_first_colon: true
'-pushDebugGroup:':
trim_after_first_colon: true
MTLCommandQueue: # DONE
class: true
visibility: 'public final'
methods:
'-commandBuffer':
property: true
'-commandBufferWithUnretainedReferences':
property: true
MTLComputeCommandEncoder: # DONE
class: true
visibility: 'public final'
methods:
'-setBytes:length:atIndex:':
trim_after_first_colon: true
visibility: protected
parameters:
bytes:
type: '@Pointer long'
'-setBufferOffset:atIndex:':
trim_after_first_colon: true
'-setBuffer:offset:atIndex:':
trim_after_first_colon: true
'-setBuffers:offsets:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
buffers:
type: MTLBuffer.MTLBufferPtr
'-setTexture:atIndex:':
trim_after_first_colon: true
'-setTextures:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
textures:
type: MTLTexture.MTLTexturePtr
'-setSamplerState:atIndex:':
trim_after_first_colon: true
'-setSamplerStates:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
samplers:
type: MTLSamplerState.MTLSamplerStatePtr
'-setSamplerState:lodMinClamp:lodMaxClamp:atIndex:':
trim_after_first_colon: true
'-setSamplerStates:lodMinClamps:lodMaxClamps:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
samplers:
type: MTLSamplerState.MTLSamplerStatePtr
'-setThreadgroupMemoryLength:atIndex:':
trim_after_first_colon: true
'-dispatchThreadgroups:threadsPerThreadgroup:':
trim_after_first_colon: true
MTLComputePipelineState: # DONE
class: true
visibility: 'public final'
MTLDepthStencilState: # DONE
class: true
visibility: 'public final'
MTLDevice: # DONE
class: true
visibility: 'public final'
methods:
'-newCommandQueueWithMaxCommandBufferCount:':
name: newCommandQueue
'-newBufferWithLength:options:':
name: newBuffer
'-newBufferWithBytes:length:options:':
name: newBuffer
visibility: protected
parameters:
pointer:
type: '@Pointer long'
'-newBufferWithBytesNoCopy:length:options:deallocator:':
name: newBuffer
visibility: protected
parameters:
pointer:
type: '@Pointer long'
'-newDepthStencilStateWithDescriptor:':
name: newDepthStencilState
'-newTextureWithDescriptor:':
name: newTexture
'-newSamplerStateWithDescriptor:':
name: newSamplerState
'-newLibraryWithFile:error:':
trim_after_first_colon: true
visibility: protected # throws NSErrorException
'-newLibraryWithData:error:':
trim_after_first_colon: true
visibility: protected # throws NSErrorException
parameters:
data:
type: DispatchData
'-newLibraryWithSource:options:error:':
trim_after_first_colon: true
visibility: protected # throws NSErrorException
'-newLibraryWithSource:options:completionHandler:':
trim_after_first_colon: true
'-newRenderPipelineStateWithDescriptor:error:':
name: newRenderPipelineState
visibility: protected # throws NSErrorException
'-newRenderPipelineStateWithDescriptor:options:reflection:error:':
name: newRenderPipelineState
visibility: protected # throws NSErrorException
'-newRenderPipelineStateWithDescriptor:completionHandler:':
name: newRenderPipelineState
'-newRenderPipelineStateWithDescriptor:options:completionHandler:':
name: newRenderPipelineState
'-newComputePipelineStateWithFunction:error:':
name: newComputePipelineState
visibility: protected # throws NSErrorException
'-newComputePipelineStateWithFunction:options:reflection:error:':
name: newComputePipelineState
visibility: protected # throws NSErrorException
'-newComputePipelineStateWithFunction:completionHandler:':
name: newComputePipelineState
'-newComputePipelineStateWithFunction:options:completionHandler:':
name: newComputePipelineState
'-supportsFeatureSet:':
trim_after_first_colon: true
MTLDrawable: # DONE
methods:
'-presentAtTime:':
trim_after_first_colon: true
MTLFunction: # DONE
class: true
visibility: 'public final'
properties:
'vertexAttributes':
type: NSArray<MTLVertexAttribute>
MTLLibrary: # DONE
class: true
visibility: 'public final'
properties:
'functionNames':
type: '@org.robovm.rt.bro.annotation.Marshaler(NSArray.AsStringListMarshaler.class) List<String>'
methods:
'-newFunctionWithName:':
name: newFunction
return_marshaler: NSObject.NoRetainMarshaler
MTLParallelRenderCommandEncoder: # DONE
class: true
visibility: 'public final'
methods:
'-renderCommandEncoder':
name: newRenderCommandEncoder
MTLRenderCommandEncoder: # DONE
class: true
visibility: 'public final'
methods:
'-setVertexBytes:length:atIndex:':
trim_after_first_colon: true
visibility: protected
parameters:
bytes:
type: '@Pointer long'
'-setVertexBufferOffset:atIndex:':
trim_after_first_colon: true
'-setVertexBuffer:offset:atIndex:':
trim_after_first_colon: true
'-setVertexBuffers:offsets:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
buffers:
type: MTLBuffer.MTLBufferPtr
'-setVertexTexture:atIndex:':
trim_after_first_colon: true
'-setVertexTextures:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
textures:
type: MTLTexture.MTLTexturePtr
'-setVertexSamplerState:atIndex:':
trim_after_first_colon: true
'-setVertexSamplerStates:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
samplers:
type: MTLSamplerState.MTLSamplerStatePtr
'-setVertexSamplerState:lodMinClamp:lodMaxClamp:atIndex:':
trim_after_first_colon: true
'-setVertexSamplerStates:lodMinClamps:lodMaxClamps:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
samplers:
type: MTLSamplerState.MTLSamplerStatePtr
'-setDepthBias:slopeScale:clamp:':
trim_after_first_colon: true
'-setFragmentBuffer:offset:atIndex:':
trim_after_first_colon: true
'-setFragmentBuffers:offsets:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
buffers:
type: MTLBuffer.MTLBufferPtr
'-setFragmentTexture:atIndex:':
trim_after_first_colon: true
'-setFragmentTextures:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
textures:
type: MTLTexture.MTLTexturePtr
'-setFragmentSamplerState:atIndex:':
trim_after_first_colon: true
'-setFragmentSamplerStates:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
samplers:
type: MTLSamplerState.MTLSamplerStatePtr
'-setFragmentSamplerState:lodMinClamp:lodMaxClamp:atIndex:':
trim_after_first_colon: true
'-setFragmentSamplerStates:lodMinClamps:lodMaxClamps:withRange:':
trim_after_first_colon: true
visibility: protected
parameters:
samplers:
type: MTLSamplerState.MTLSamplerStatePtr
'-setBlendColorRed:green:blue:alpha:':
name: setBlendColor
'-setVisibilityResultMode:offset:':
trim_after_first_colon: true
'-drawPrimitives:vertexStart:vertexCount:instanceCount:':
trim_after_first_colon: true
'-drawPrimitives:vertexStart:vertexCount:':
trim_after_first_colon: true
'-drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:':
trim_after_first_colon: true
'-drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:':
trim_after_first_colon: true
MTLRenderPipelineState: # DONE
class: true
visibility: 'public final'
MTLResource: # DONE
methods:
'-setPurgeableState:':
trim_after_first_colon: true
MTLSamplerState: # DONE
class: true
visibility: 'public final'
MTLTexture: # DONE
class: true
visibility: 'public final'
methods:
'-getBytes:bytesPerRow:bytesPerImage:fromRegion:mipmapLevel:slice:':
trim_after_first_colon: true
visibility: protected
parameters:
pixelBytes:
type: '@Pointer long'
'-replaceRegion:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage:':
trim_after_first_colon: true
visibility: protected
parameters:
pixelBytes:
type: '@Pointer long'
'-getBytes:bytesPerRow:fromRegion:mipmapLevel:':
trim_after_first_colon: true
visibility: protected
parameters:
pixelBytes:
type: '@Pointer long'
'-replaceRegion:mipmapLevel:withBytes:bytesPerRow:':
trim_after_first_colon: true
visibility: protected
parameters:
pixelBytes:
type: '@Pointer long'
'-newTextureViewWithPixelFormat:':
name: newTextureView
return_marshaler: NSObject.NoRetainMarshaler
functions:
MTLClearColorMake:
exclude: true # use constructor instead
MTLCreate(SystemDefaultDevice):
class: MTLDevice
name: 'get#{g[0]}'
return_marshaler: NSObject.NoRetainMarshaler
# Make sure we don't miss any functions if new ones are introduced in a later version
(k?MTL.*):
class: Metal
name: 'Function__#{g[0]}'
values:
# Error
MTLCommandBufferErrorDomain:
class: MTLCommandBufferError
name: getClassDomain
MTLLibraryErrorDomain:
class: MTLLibraryError
name: getClassDomain
MTLRenderPipelineErrorDomain:
class: MTLRenderPipelineError
name: getClassDomain
# Make sure we don't miss any values if new ones are introduced in a later version
(k?MTL.*):
class: Metal
name: 'Value__#{g[0]}'
constants:
# Make sure we don't miss any constants if new ones are introduced in a later version
(k?MTL.*):
class: Metal
name: 'Constant__#{g[0]}'