yum-mirror/VkFFT

git clone https://git.yummers.dev/yum-mirror/VkFFT

Tolmachev DmitriiMetal support in VkFFTba7001c

develop
54.0 KiB1254 linesraw
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2//
3// Metal/MTLDevice.hpp
4//
5// Copyright 2020-2021 Apple Inc.
6//
7// Licensed under the Apache License, Version 2.0 (the "License");
8// you may not use this file except in compliance with the License.
9// You may obtain a copy of the License at
10//
11//     http://www.apache.org/licenses/LICENSE-2.0
12//
13// Unless required by applicable law or agreed to in writing, software
14// distributed under the License is distributed on an "AS IS" BASIS,
15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16// See the License for the specific language governing permissions and
17// limitations under the License.
18//
19//-------------------------------------------------------------------------------------------------------------------------------------------------------------
20
21#pragma once
22
23#include "MTLDefines.hpp"
24#include "MTLHeaderBridge.hpp"
25#include "MTLPrivate.hpp"
26
27#include <Foundation/Foundation.hpp>
28
29#include "MTLArgument.hpp"
30#include "MTLDevice.hpp"
31#include "MTLPixelFormat.hpp"
32#include "MTLResource.hpp"
33#include "MTLTexture.hpp"
34#include "MTLTypes.hpp"
35#include <IOSurface/IOSurfaceRef.h>
36#include <functional>
37
38namespace MTL
39{
40_MTL_ENUM(NS::UInteger, FeatureSet) {
41    FeatureSet_iOS_GPUFamily1_v1 = 0,
42    FeatureSet_iOS_GPUFamily2_v1 = 1,
43    FeatureSet_iOS_GPUFamily1_v2 = 2,
44    FeatureSet_iOS_GPUFamily2_v2 = 3,
45    FeatureSet_iOS_GPUFamily3_v1 = 4,
46    FeatureSet_iOS_GPUFamily1_v3 = 5,
47    FeatureSet_iOS_GPUFamily2_v3 = 6,
48    FeatureSet_iOS_GPUFamily3_v2 = 7,
49    FeatureSet_iOS_GPUFamily1_v4 = 8,
50    FeatureSet_iOS_GPUFamily2_v4 = 9,
51    FeatureSet_iOS_GPUFamily3_v3 = 10,
52    FeatureSet_iOS_GPUFamily4_v1 = 11,
53    FeatureSet_iOS_GPUFamily1_v5 = 12,
54    FeatureSet_iOS_GPUFamily2_v5 = 13,
55    FeatureSet_iOS_GPUFamily3_v4 = 14,
56    FeatureSet_iOS_GPUFamily4_v2 = 15,
57    FeatureSet_iOS_GPUFamily5_v1 = 16,
58    FeatureSet_macOS_GPUFamily1_v1 = 10000,
59    FeatureSet_OSX_GPUFamily1_v1 = 10000,
60    FeatureSet_macOS_GPUFamily1_v2 = 10001,
61    FeatureSet_OSX_GPUFamily1_v2 = 10001,
62    FeatureSet_OSX_ReadWriteTextureTier2 = 10002,
63    FeatureSet_macOS_ReadWriteTextureTier2 = 10002,
64    FeatureSet_macOS_GPUFamily1_v3 = 10003,
65    FeatureSet_macOS_GPUFamily1_v4 = 10004,
66    FeatureSet_macOS_GPUFamily2_v1 = 10005,
67    FeatureSet_watchOS_GPUFamily1_v1 = 20000,
68    FeatureSet_WatchOS_GPUFamily1_v1 = 20000,
69    FeatureSet_watchOS_GPUFamily2_v1 = 20001,
70    FeatureSet_WatchOS_GPUFamily2_v1 = 20001,
71    FeatureSet_tvOS_GPUFamily1_v1 = 30000,
72    FeatureSet_TVOS_GPUFamily1_v1 = 30000,
73    FeatureSet_tvOS_GPUFamily1_v2 = 30001,
74    FeatureSet_tvOS_GPUFamily1_v3 = 30002,
75    FeatureSet_tvOS_GPUFamily2_v1 = 30003,
76    FeatureSet_tvOS_GPUFamily1_v4 = 30004,
77    FeatureSet_tvOS_GPUFamily2_v2 = 30005,
78};
79
80_MTL_ENUM(NS::Integer, GPUFamily) {
81    GPUFamilyApple1 = 1001,
82    GPUFamilyApple2 = 1002,
83    GPUFamilyApple3 = 1003,
84    GPUFamilyApple4 = 1004,
85    GPUFamilyApple5 = 1005,
86    GPUFamilyApple6 = 1006,
87    GPUFamilyApple7 = 1007,
88    GPUFamilyApple8 = 1008,
89    GPUFamilyMac1 = 2001,
90    GPUFamilyMac2 = 2002,
91    GPUFamilyCommon1 = 3001,
92    GPUFamilyCommon2 = 3002,
93    GPUFamilyCommon3 = 3003,
94    GPUFamilyMacCatalyst1 = 4001,
95    GPUFamilyMacCatalyst2 = 4002,
96};
97
98_MTL_ENUM(NS::UInteger, DeviceLocation) {
99    DeviceLocationBuiltIn = 0,
100    DeviceLocationSlot = 1,
101    DeviceLocationExternal = 2,
102    DeviceLocationUnspecified = NS::UIntegerMax,
103};
104
105_MTL_OPTIONS(NS::UInteger, PipelineOption) {
106    PipelineOptionNone = 0,
107    PipelineOptionArgumentInfo = 1,
108    PipelineOptionBufferTypeInfo = 2,
109    PipelineOptionFailOnBinaryArchiveMiss = 4,
110};
111
112_MTL_ENUM(NS::UInteger, ReadWriteTextureTier) {
113    ReadWriteTextureTierNone = 0,
114    ReadWriteTextureTier1 = 1,
115    ReadWriteTextureTier2 = 2,
116};
117
118_MTL_ENUM(NS::UInteger, ArgumentBuffersTier) {
119    ArgumentBuffersTier1 = 0,
120    ArgumentBuffersTier2 = 1,
121};
122
123_MTL_ENUM(NS::UInteger, SparseTextureRegionAlignmentMode) {
124    SparseTextureRegionAlignmentModeOutward = 0,
125    SparseTextureRegionAlignmentModeInward = 1,
126};
127
128struct AccelerationStructureSizes
129{
130    NS::UInteger accelerationStructureSize;
131    NS::UInteger buildScratchBufferSize;
132    NS::UInteger refitScratchBufferSize;
133} _MTL_PACKED;
134
135_MTL_ENUM(NS::UInteger, CounterSamplingPoint) {
136    CounterSamplingPointAtStageBoundary = 0,
137    CounterSamplingPointAtDrawBoundary = 1,
138    CounterSamplingPointAtDispatchBoundary = 2,
139    CounterSamplingPointAtTileDispatchBoundary = 3,
140    CounterSamplingPointAtBlitBoundary = 4,
141};
142
143struct SizeAndAlign
144{
145    NS::UInteger size;
146    NS::UInteger align;
147} _MTL_PACKED;
148
149class ArgumentDescriptor : public NS::Copying<ArgumentDescriptor>
150{
151public:
152    static class ArgumentDescriptor* alloc();
153
154    class ArgumentDescriptor*        init();
155
156    static class ArgumentDescriptor* argumentDescriptor();
157
158    MTL::DataType                    dataType() const;
159    void                             setDataType(MTL::DataType dataType);
160
161    NS::UInteger                     index() const;
162    void                             setIndex(NS::UInteger index);
163
164    NS::UInteger                     arrayLength() const;
165    void                             setArrayLength(NS::UInteger arrayLength);
166
167    MTL::ArgumentAccess              access() const;
168    void                             setAccess(MTL::ArgumentAccess access);
169
170    MTL::TextureType                 textureType() const;
171    void                             setTextureType(MTL::TextureType textureType);
172
173    NS::UInteger                     constantBlockAlignment() const;
174    void                             setConstantBlockAlignment(NS::UInteger constantBlockAlignment);
175};
176
177using DeviceNotificationName = NS::String*;
178
179_MTL_CONST(DeviceNotificationName, DeviceWasAddedNotification);
180
181_MTL_CONST(DeviceNotificationName, DeviceRemovalRequestedNotification);
182
183_MTL_CONST(DeviceNotificationName, DeviceWasRemovedNotification);
184
185using DeviceNotificationHandlerBlock = void (^)(class Device* pDevice, DeviceNotificationName notifyName);
186
187using DeviceNotificationHandlerFunction = std::function<void(class Device* pDevice, DeviceNotificationName notifyName)>;
188
189using AutoreleasedComputePipelineReflection = class ComputePipelineReflection*;
190
191using AutoreleasedRenderPipelineReflection = class RenderPipelineReflection*;
192
193using NewLibraryCompletionHandler = void (^)(class Library*, NS::Error*);
194
195using NewLibraryCompletionHandlerFunction = std::function<void(class Library*, NS::Error*)>;
196
197using NewRenderPipelineStateCompletionHandler = void (^)(class RenderPipelineState*, NS::Error*);
198
199using NewRenderPipelineStateCompletionHandlerFunction = std::function<void(class RenderPipelineState*, NS::Error*)>;
200
201using NewRenderPipelineStateWithReflectionCompletionHandler = void (^)(class RenderPipelineState*, class RenderPipelineReflection*, NS::Error*);
202
203using NewRenderPipelineStateWithReflectionCompletionHandlerFunction = std::function<void(class RenderPipelineState*, class RenderPipelineReflection*, NS::Error*)>;
204
205using NewComputePipelineStateCompletionHandler = void (^)(class ComputePipelineState*, NS::Error*);
206
207using NewComputePipelineStateCompletionHandlerFunction = std::function<void(class ComputePipelineState*, NS::Error*)>;
208
209using NewComputePipelineStateWithReflectionCompletionHandler = void (^)(class ComputePipelineState*, class ComputePipelineReflection*, NS::Error*);
210
211using NewComputePipelineStateWithReflectionCompletionHandlerFunction = std::function<void(class ComputePipelineState*, class ComputePipelineReflection*, NS::Error*)>;
212
213using Timestamp = std::uint64_t;
214
215MTL::Device* CreateSystemDefaultDevice();
216
217NS::Array*   CopyAllDevices();
218
219NS::Array*   CopyAllDevicesWithObserver(NS::Object** pOutObserver, DeviceNotificationHandlerBlock handler);
220
221NS::Array*   CopyAllDevicesWithObserver(NS::Object** pOutObserver, const DeviceNotificationHandlerFunction& handler);
222
223void         RemoveDeviceObserver(const NS::Object* pObserver);
224
225class Device : public NS::Referencing<Device>
226{
227public:
228    void                            newLibrary(const NS::String* pSource, const class CompileOptions* pOptions, const NewLibraryCompletionHandlerFunction& completionHandler);
229
230    void                            newLibrary(const class StitchedLibraryDescriptor* pDescriptor, const MTL::NewLibraryCompletionHandlerFunction& completionHandler);
231
232    void                            newRenderPipelineState(const class RenderPipelineDescriptor* pDescriptor, const NewRenderPipelineStateCompletionHandlerFunction& completionHandler);
233
234    void                            newRenderPipelineState(const class RenderPipelineDescriptor* pDescriptor, PipelineOption options, const NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler);
235
236    void                            newRenderPipelineState(const class TileRenderPipelineDescriptor* pDescriptor, PipelineOption options, const NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler);
237
238    void                            newComputePipelineState(const class Function* pFunction, const NewComputePipelineStateCompletionHandlerFunction& completionHandler);
239
240    void                            newComputePipelineState(const class Function* pFunction, PipelineOption options, const NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler);
241
242    void                            newComputePipelineState(const class ComputePipelineDescriptor* pDescriptor, PipelineOption options, const NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler);
243
244    bool                            isHeadless() const;
245
246    NS::String*                     name() const;
247
248    uint64_t                        registryID() const;
249
250    MTL::Size                       maxThreadsPerThreadgroup() const;
251
252    bool                            lowPower() const;
253
254    bool                            headless() const;
255
256    bool                            removable() const;
257
258    bool                            hasUnifiedMemory() const;
259
260    uint64_t                        recommendedMaxWorkingSetSize() const;
261
262    MTL::DeviceLocation             location() const;
263
264    NS::UInteger                    locationNumber() const;
265
266    uint64_t                        maxTransferRate() const;
267
268    bool                            depth24Stencil8PixelFormatSupported() const;
269
270    MTL::ReadWriteTextureTier       readWriteTextureSupport() const;
271
272    MTL::ArgumentBuffersTier        argumentBuffersSupport() const;
273
274    bool                            rasterOrderGroupsSupported() const;
275
276    bool                            supports32BitFloatFiltering() const;
277
278    bool                            supports32BitMSAA() const;
279
280    bool                            supportsQueryTextureLOD() const;
281
282    bool                            supportsBCTextureCompression() const;
283
284    bool                            supportsPullModelInterpolation() const;
285
286    bool                            barycentricCoordsSupported() const;
287
288    bool                            supportsShaderBarycentricCoordinates() const;
289
290    NS::UInteger                    currentAllocatedSize() const;
291
292    class CommandQueue*             newCommandQueue();
293
294    class CommandQueue*             newCommandQueue(NS::UInteger maxCommandBufferCount);
295
296    MTL::SizeAndAlign               heapTextureSizeAndAlign(const class TextureDescriptor* desc);
297
298    MTL::SizeAndAlign               heapBufferSizeAndAlign(NS::UInteger length, MTL::ResourceOptions options);
299
300    class Heap*                     newHeap(const class HeapDescriptor* descriptor);
301
302    class Buffer*                   newBuffer(NS::UInteger length, MTL::ResourceOptions options);
303
304    class Buffer*                   newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options);
305
306    class Buffer*                   newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options, const void (^deallocator)(void*, NS::UInteger));
307
308    class DepthStencilState*        newDepthStencilState(const class DepthStencilDescriptor* descriptor);
309
310    class Texture*                  newTexture(const class TextureDescriptor* descriptor);
311
312    class Texture*                  newTexture(const class TextureDescriptor* descriptor, const IOSurfaceRef iosurface, NS::UInteger plane);
313
314    class Texture*                  newSharedTexture(const class TextureDescriptor* descriptor);
315
316    class Texture*                  newSharedTexture(const class SharedTextureHandle* sharedHandle);
317
318    class SamplerState*             newSamplerState(const class SamplerDescriptor* descriptor);
319
320    class Library*                  newDefaultLibrary();
321
322    class Library*                  newDefaultLibrary(const NS::Bundle* bundle, NS::Error** error);
323
324    class Library*                  newLibrary(const NS::String* filepath, NS::Error** error);
325
326    class Library*                  newLibrary(const NS::URL* url, NS::Error** error);
327
328    class Library*                  newLibrary(const dispatch_data_t data, NS::Error** error);
329
330    class Library*                  newLibrary(const NS::String* source, const class CompileOptions* options, NS::Error** error);
331
332    void                            newLibrary(const NS::String* source, const class CompileOptions* options, const MTL::NewLibraryCompletionHandler completionHandler);
333
334    class Library*                  newLibrary(const class StitchedLibraryDescriptor* descriptor, NS::Error** error);
335
336    void                            newLibrary(const class StitchedLibraryDescriptor* descriptor, const MTL::NewLibraryCompletionHandler completionHandler);
337
338    class RenderPipelineState*      newRenderPipelineState(const class RenderPipelineDescriptor* descriptor, NS::Error** error);
339
340    class RenderPipelineState*      newRenderPipelineState(const class RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error);
341
342    void                            newRenderPipelineState(const class RenderPipelineDescriptor* descriptor, const MTL::NewRenderPipelineStateCompletionHandler completionHandler);
343
344    void                            newRenderPipelineState(const class RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler);
345
346    class ComputePipelineState*     newComputePipelineState(const class Function* computeFunction, NS::Error** error);
347
348    class ComputePipelineState*     newComputePipelineState(const class Function* computeFunction, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error);
349
350    void                            newComputePipelineState(const class Function* computeFunction, const MTL::NewComputePipelineStateCompletionHandler completionHandler);
351
352    void                            newComputePipelineState(const class Function* computeFunction, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler);
353
354    class ComputePipelineState*     newComputePipelineState(const class ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error);
355
356    void                            newComputePipelineState(const class ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler);
357
358    class Fence*                    newFence();
359
360    bool                            supportsFeatureSet(MTL::FeatureSet featureSet);
361
362    bool                            supportsFamily(MTL::GPUFamily gpuFamily);
363
364    bool                            supportsTextureSampleCount(NS::UInteger sampleCount);
365
366    NS::UInteger                    minimumLinearTextureAlignmentForPixelFormat(MTL::PixelFormat format);
367
368    NS::UInteger                    minimumTextureBufferAlignmentForPixelFormat(MTL::PixelFormat format);
369
370    class RenderPipelineState*      newRenderPipelineState(const class TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error);
371
372    void                            newRenderPipelineState(const class TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler);
373
374    NS::UInteger                    maxThreadgroupMemoryLength() const;
375
376    NS::UInteger                    maxArgumentBufferSamplerCount() const;
377
378    bool                            programmableSamplePositionsSupported() const;
379
380    void                            getDefaultSamplePositions(MTL::SamplePosition* positions, NS::UInteger count);
381
382    class ArgumentEncoder*          newArgumentEncoder(const NS::Array* arguments);
383
384    bool                            supportsRasterizationRateMap(NS::UInteger layerCount);
385
386    class RasterizationRateMap*     newRasterizationRateMap(const class RasterizationRateMapDescriptor* descriptor);
387
388    class IndirectCommandBuffer*    newIndirectCommandBuffer(const class IndirectCommandBufferDescriptor* descriptor, NS::UInteger maxCount, MTL::ResourceOptions options);
389
390    class Event*                    newEvent();
391
392    class SharedEvent*              newSharedEvent();
393
394    class SharedEvent*              newSharedEvent(const class SharedEventHandle* sharedEventHandle);
395
396    uint64_t                        peerGroupID() const;
397
398    uint32_t                        peerIndex() const;
399
400    uint32_t                        peerCount() const;
401
402    MTL::Size                       sparseTileSize(MTL::TextureType textureType, MTL::PixelFormat pixelFormat, NS::UInteger sampleCount);
403
404    NS::UInteger                    sparseTileSizeInBytes() const;
405
406    void                            convertSparsePixelRegions(const MTL::Region* pixelRegions, MTL::Region* tileRegions, MTL::Size tileSize, MTL::SparseTextureRegionAlignmentMode mode, NS::UInteger numRegions);
407
408    void                            convertSparseTileRegions(const MTL::Region* tileRegions, MTL::Region* pixelRegions, MTL::Size tileSize, NS::UInteger numRegions);
409
410    NS::UInteger                    maxBufferLength() const;
411
412    NS::Array*                      counterSets() const;
413
414    class CounterSampleBuffer*      newCounterSampleBuffer(const class CounterSampleBufferDescriptor* descriptor, NS::Error** error);
415
416    void                            sampleTimestamps(MTL::Timestamp* cpuTimestamp, MTL::Timestamp* gpuTimestamp);
417
418    bool                            supportsCounterSampling(MTL::CounterSamplingPoint samplingPoint);
419
420    bool                            supportsVertexAmplificationCount(NS::UInteger count);
421
422    bool                            supportsDynamicLibraries() const;
423
424    bool                            supportsRenderDynamicLibraries() const;
425
426    class DynamicLibrary*           newDynamicLibrary(const class Library* library, NS::Error** error);
427
428    class DynamicLibrary*           newDynamicLibrary(const NS::URL* url, NS::Error** error);
429
430    class BinaryArchive*            newBinaryArchive(const class BinaryArchiveDescriptor* descriptor, NS::Error** error);
431
432    bool                            supportsRaytracing() const;
433
434    MTL::AccelerationStructureSizes accelerationStructureSizes(const class AccelerationStructureDescriptor* descriptor);
435
436    class AccelerationStructure*    newAccelerationStructure(NS::UInteger size);
437
438    class AccelerationStructure*    newAccelerationStructure(const class AccelerationStructureDescriptor* descriptor);
439
440    bool                            supportsFunctionPointers() const;
441
442    bool                            supportsFunctionPointersFromRender() const;
443
444    bool                            supportsRaytracingFromRender() const;
445
446    bool                            supportsPrimitiveMotionBlur() const;
447};
448
449}
450
451// static method: alloc
452_MTL_INLINE MTL::ArgumentDescriptor* MTL::ArgumentDescriptor::alloc()
453{
454    return NS::Object::alloc<MTL::ArgumentDescriptor>(_MTL_PRIVATE_CLS(MTLArgumentDescriptor));
455}
456
457// method: init
458_MTL_INLINE MTL::ArgumentDescriptor* MTL::ArgumentDescriptor::init()
459{
460    return NS::Object::init<MTL::ArgumentDescriptor>();
461}
462
463// static method: argumentDescriptor
464_MTL_INLINE MTL::ArgumentDescriptor* MTL::ArgumentDescriptor::argumentDescriptor()
465{
466    return Object::sendMessage<MTL::ArgumentDescriptor*>(_MTL_PRIVATE_CLS(MTLArgumentDescriptor), _MTL_PRIVATE_SEL(argumentDescriptor));
467}
468
469// property: dataType
470_MTL_INLINE MTL::DataType MTL::ArgumentDescriptor::dataType() const
471{
472    return Object::sendMessage<MTL::DataType>(this, _MTL_PRIVATE_SEL(dataType));
473}
474
475_MTL_INLINE void MTL::ArgumentDescriptor::setDataType(MTL::DataType dataType)
476{
477    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setDataType_), dataType);
478}
479
480// property: index
481_MTL_INLINE NS::UInteger MTL::ArgumentDescriptor::index() const
482{
483    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(index));
484}
485
486_MTL_INLINE void MTL::ArgumentDescriptor::setIndex(NS::UInteger index)
487{
488    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setIndex_), index);
489}
490
491// property: arrayLength
492_MTL_INLINE NS::UInteger MTL::ArgumentDescriptor::arrayLength() const
493{
494    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(arrayLength));
495}
496
497_MTL_INLINE void MTL::ArgumentDescriptor::setArrayLength(NS::UInteger arrayLength)
498{
499    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setArrayLength_), arrayLength);
500}
501
502// property: access
503_MTL_INLINE MTL::ArgumentAccess MTL::ArgumentDescriptor::access() const
504{
505    return Object::sendMessage<MTL::ArgumentAccess>(this, _MTL_PRIVATE_SEL(access));
506}
507
508_MTL_INLINE void MTL::ArgumentDescriptor::setAccess(MTL::ArgumentAccess access)
509{
510    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setAccess_), access);
511}
512
513// property: textureType
514_MTL_INLINE MTL::TextureType MTL::ArgumentDescriptor::textureType() const
515{
516    return Object::sendMessage<MTL::TextureType>(this, _MTL_PRIVATE_SEL(textureType));
517}
518
519_MTL_INLINE void MTL::ArgumentDescriptor::setTextureType(MTL::TextureType textureType)
520{
521    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setTextureType_), textureType);
522}
523
524// property: constantBlockAlignment
525_MTL_INLINE NS::UInteger MTL::ArgumentDescriptor::constantBlockAlignment() const
526{
527    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(constantBlockAlignment));
528}
529
530_MTL_INLINE void MTL::ArgumentDescriptor::setConstantBlockAlignment(NS::UInteger constantBlockAlignment)
531{
532    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setConstantBlockAlignment_), constantBlockAlignment);
533}
534
535#if defined(MTL_PRIVATE_IMPLEMENTATION)
536
537extern "C" MTL::Device* MTLCreateSystemDefaultDevice();
538
539extern "C" NS::Array*   MTLCopyAllDevices();
540
541extern "C" NS::Array*   MTLCopyAllDevicesWithObserver(NS::Object**, MTL::DeviceNotificationHandlerBlock);
542
543extern "C" void         MTLRemoveDeviceObserver(const NS::Object*);
544
545#include <TargetConditionals.h>
546
547MTL::Device* MTL::CreateSystemDefaultDevice()
548{
549    return ::MTLCreateSystemDefaultDevice();
550}
551
552NS::Array* MTL::CopyAllDevices()
553{
554#if TARGET_OS_OSX
555    return ::MTLCopyAllDevices();
556#else
557    return nullptr;
558#endif // TARGET_OS_OSX
559}
560
561NS::Array* MTL::CopyAllDevicesWithObserver(NS::Object** pOutObserver, DeviceNotificationHandlerBlock handler)
562{
563#if TARGET_OS_OSX
564    return ::MTLCopyAllDevicesWithObserver(pOutObserver, handler);
565#else
566    (void)pOutObserver;
567    (void)handler;
568
569    return nullptr;
570#endif // TARGET_OS_OSX
571}
572
573NS::Array* MTL::CopyAllDevicesWithObserver(NS::Object** pOutObserver, const DeviceNotificationHandlerFunction& handler)
574{
575    __block DeviceNotificationHandlerFunction function = handler;
576
577    return CopyAllDevicesWithObserver(pOutObserver, ^(Device* pDevice, DeviceNotificationName pNotificationName) { function(pDevice, pNotificationName); });
578}
579
580void MTL::RemoveDeviceObserver(const NS::Object* pObserver)
581{
582#if TARGET_OS_OSX
583    ::MTLRemoveDeviceObserver(pObserver);
584#endif // TARGET_OS_OSX
585}
586
587#endif // MTL_PRIVATE_IMPLEMENTATION
588
589_MTL_INLINE void MTL::Device::newLibrary(const NS::String* pSource, const CompileOptions* pOptions, const NewLibraryCompletionHandlerFunction& completionHandler)
590{
591    __block NewLibraryCompletionHandlerFunction blockCompletionHandler = completionHandler;
592
593    newLibrary(pSource, pOptions, ^(Library* pLibrary, NS::Error* pError) { blockCompletionHandler(pLibrary, pError); });
594}
595
596_MTL_INLINE void MTL::Device::newLibrary(const class StitchedLibraryDescriptor* pDescriptor, const MTL::NewLibraryCompletionHandlerFunction& completionHandler)
597{
598    __block NewLibraryCompletionHandlerFunction blockCompletionHandler = completionHandler;
599
600    newLibrary(pDescriptor, ^(Library* pLibrary, NS::Error* pError) { blockCompletionHandler(pLibrary, pError); });
601}
602
603_MTL_INLINE void MTL::Device::newRenderPipelineState(const RenderPipelineDescriptor* pDescriptor, const NewRenderPipelineStateCompletionHandlerFunction& completionHandler)
604{
605    __block NewRenderPipelineStateCompletionHandlerFunction blockCompletionHandler = completionHandler;
606
607    newRenderPipelineState(pDescriptor, ^(RenderPipelineState* pPipelineState, NS::Error* pError) { blockCompletionHandler(pPipelineState, pError); });
608}
609
610_MTL_INLINE void MTL::Device::newRenderPipelineState(const RenderPipelineDescriptor* pDescriptor, PipelineOption options, const NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler)
611{
612    __block NewRenderPipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler;
613
614    newRenderPipelineState(pDescriptor, options, ^(RenderPipelineState* pPipelineState, class RenderPipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); });
615}
616
617_MTL_INLINE void MTL::Device::newRenderPipelineState(const TileRenderPipelineDescriptor* pDescriptor, PipelineOption options, const NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler)
618{
619    __block NewRenderPipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler;
620
621    newRenderPipelineState(pDescriptor, options, ^(RenderPipelineState* pPipelineState, class RenderPipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); });
622}
623
624_MTL_INLINE void MTL::Device::newComputePipelineState(const class Function* pFunction, const NewComputePipelineStateCompletionHandlerFunction& completionHandler)
625{
626    __block NewComputePipelineStateCompletionHandlerFunction blockCompletionHandler = completionHandler;
627
628    newComputePipelineState(pFunction, ^(ComputePipelineState* pPipelineState, NS::Error* pError) { blockCompletionHandler(pPipelineState, pError); });
629}
630
631_MTL_INLINE void MTL::Device::newComputePipelineState(const Function* pFunction, PipelineOption options, const NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler)
632{
633    __block NewComputePipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler;
634
635    newComputePipelineState(pFunction, options, ^(ComputePipelineState* pPipelineState, ComputePipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); });
636}
637
638_MTL_INLINE void MTL::Device::newComputePipelineState(const ComputePipelineDescriptor* pDescriptor, PipelineOption options, const NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler)
639{
640    __block NewComputePipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler;
641
642    newComputePipelineState(pDescriptor, options, ^(ComputePipelineState* pPipelineState, ComputePipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); });
643}
644
645_MTL_INLINE bool MTL::Device::isHeadless() const
646{
647    return headless();
648}
649
650// property: name
651_MTL_INLINE NS::String* MTL::Device::name() const
652{
653    return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(name));
654}
655
656// property: registryID
657_MTL_INLINE uint64_t MTL::Device::registryID() const
658{
659    return Object::sendMessage<uint64_t>(this, _MTL_PRIVATE_SEL(registryID));
660}
661
662// property: maxThreadsPerThreadgroup
663_MTL_INLINE MTL::Size MTL::Device::maxThreadsPerThreadgroup() const
664{
665    return Object::sendMessage<MTL::Size>(this, _MTL_PRIVATE_SEL(maxThreadsPerThreadgroup));
666}
667
668// property: lowPower
669_MTL_INLINE bool MTL::Device::lowPower() const
670{
671    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isLowPower));
672}
673
674// property: headless
675_MTL_INLINE bool MTL::Device::headless() const
676{
677    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isHeadless));
678}
679
680// property: removable
681_MTL_INLINE bool MTL::Device::removable() const
682{
683    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isRemovable));
684}
685
686// property: hasUnifiedMemory
687_MTL_INLINE bool MTL::Device::hasUnifiedMemory() const
688{
689    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(hasUnifiedMemory));
690}
691
692// property: recommendedMaxWorkingSetSize
693_MTL_INLINE uint64_t MTL::Device::recommendedMaxWorkingSetSize() const
694{
695    return Object::sendMessage<uint64_t>(this, _MTL_PRIVATE_SEL(recommendedMaxWorkingSetSize));
696}
697
698// property: location
699_MTL_INLINE MTL::DeviceLocation MTL::Device::location() const
700{
701    return Object::sendMessage<MTL::DeviceLocation>(this, _MTL_PRIVATE_SEL(location));
702}
703
704// property: locationNumber
705_MTL_INLINE NS::UInteger MTL::Device::locationNumber() const
706{
707    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(locationNumber));
708}
709
710// property: maxTransferRate
711_MTL_INLINE uint64_t MTL::Device::maxTransferRate() const
712{
713    return Object::sendMessage<uint64_t>(this, _MTL_PRIVATE_SEL(maxTransferRate));
714}
715
716// property: depth24Stencil8PixelFormatSupported
717_MTL_INLINE bool MTL::Device::depth24Stencil8PixelFormatSupported() const
718{
719    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(isDepth24Stencil8PixelFormatSupported));
720}
721
722// property: readWriteTextureSupport
723_MTL_INLINE MTL::ReadWriteTextureTier MTL::Device::readWriteTextureSupport() const
724{
725    return Object::sendMessage<MTL::ReadWriteTextureTier>(this, _MTL_PRIVATE_SEL(readWriteTextureSupport));
726}
727
728// property: argumentBuffersSupport
729_MTL_INLINE MTL::ArgumentBuffersTier MTL::Device::argumentBuffersSupport() const
730{
731    return Object::sendMessage<MTL::ArgumentBuffersTier>(this, _MTL_PRIVATE_SEL(argumentBuffersSupport));
732}
733
734// property: rasterOrderGroupsSupported
735_MTL_INLINE bool MTL::Device::rasterOrderGroupsSupported() const
736{
737    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(areRasterOrderGroupsSupported));
738}
739
740// property: supports32BitFloatFiltering
741_MTL_INLINE bool MTL::Device::supports32BitFloatFiltering() const
742{
743    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supports32BitFloatFiltering));
744}
745
746// property: supports32BitMSAA
747_MTL_INLINE bool MTL::Device::supports32BitMSAA() const
748{
749    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supports32BitMSAA));
750}
751
752// property: supportsQueryTextureLOD
753_MTL_INLINE bool MTL::Device::supportsQueryTextureLOD() const
754{
755    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsQueryTextureLOD));
756}
757
758// property: supportsBCTextureCompression
759_MTL_INLINE bool MTL::Device::supportsBCTextureCompression() const
760{
761    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsBCTextureCompression));
762}
763
764// property: supportsPullModelInterpolation
765_MTL_INLINE bool MTL::Device::supportsPullModelInterpolation() const
766{
767    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsPullModelInterpolation));
768}
769
770// property: barycentricCoordsSupported
771_MTL_INLINE bool MTL::Device::barycentricCoordsSupported() const
772{
773    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(areBarycentricCoordsSupported));
774}
775
776// property: supportsShaderBarycentricCoordinates
777_MTL_INLINE bool MTL::Device::supportsShaderBarycentricCoordinates() const
778{
779    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsShaderBarycentricCoordinates));
780}
781
782// property: currentAllocatedSize
783_MTL_INLINE NS::UInteger MTL::Device::currentAllocatedSize() const
784{
785    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(currentAllocatedSize));
786}
787
788// method: newCommandQueue
789_MTL_INLINE MTL::CommandQueue* MTL::Device::newCommandQueue()
790{
791    return Object::sendMessage<MTL::CommandQueue*>(this, _MTL_PRIVATE_SEL(newCommandQueue));
792}
793
794// method: newCommandQueueWithMaxCommandBufferCount:
795_MTL_INLINE MTL::CommandQueue* MTL::Device::newCommandQueue(NS::UInteger maxCommandBufferCount)
796{
797    return Object::sendMessage<MTL::CommandQueue*>(this, _MTL_PRIVATE_SEL(newCommandQueueWithMaxCommandBufferCount_), maxCommandBufferCount);
798}
799
800// method: heapTextureSizeAndAlignWithDescriptor:
801_MTL_INLINE MTL::SizeAndAlign MTL::Device::heapTextureSizeAndAlign(const MTL::TextureDescriptor* desc)
802{
803    return Object::sendMessage<MTL::SizeAndAlign>(this, _MTL_PRIVATE_SEL(heapTextureSizeAndAlignWithDescriptor_), desc);
804}
805
806// method: heapBufferSizeAndAlignWithLength:options:
807_MTL_INLINE MTL::SizeAndAlign MTL::Device::heapBufferSizeAndAlign(NS::UInteger length, MTL::ResourceOptions options)
808{
809    return Object::sendMessage<MTL::SizeAndAlign>(this, _MTL_PRIVATE_SEL(heapBufferSizeAndAlignWithLength_options_), length, options);
810}
811
812// method: newHeapWithDescriptor:
813_MTL_INLINE MTL::Heap* MTL::Device::newHeap(const MTL::HeapDescriptor* descriptor)
814{
815    return Object::sendMessage<MTL::Heap*>(this, _MTL_PRIVATE_SEL(newHeapWithDescriptor_), descriptor);
816}
817
818// method: newBufferWithLength:options:
819_MTL_INLINE MTL::Buffer* MTL::Device::newBuffer(NS::UInteger length, MTL::ResourceOptions options)
820{
821    return Object::sendMessage<MTL::Buffer*>(this, _MTL_PRIVATE_SEL(newBufferWithLength_options_), length, options);
822}
823
824// method: newBufferWithBytes:length:options:
825_MTL_INLINE MTL::Buffer* MTL::Device::newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options)
826{
827    return Object::sendMessage<MTL::Buffer*>(this, _MTL_PRIVATE_SEL(newBufferWithBytes_length_options_), pointer, length, options);
828}
829
830// method: newBufferWithBytesNoCopy:length:options:deallocator:
831_MTL_INLINE MTL::Buffer* MTL::Device::newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options, const void (^deallocator)(void*, NS::UInteger))
832{
833    return Object::sendMessage<MTL::Buffer*>(this, _MTL_PRIVATE_SEL(newBufferWithBytesNoCopy_length_options_deallocator_), pointer, length, options, deallocator);
834}
835
836// method: newDepthStencilStateWithDescriptor:
837_MTL_INLINE MTL::DepthStencilState* MTL::Device::newDepthStencilState(const MTL::DepthStencilDescriptor* descriptor)
838{
839    return Object::sendMessage<MTL::DepthStencilState*>(this, _MTL_PRIVATE_SEL(newDepthStencilStateWithDescriptor_), descriptor);
840}
841
842// method: newTextureWithDescriptor:
843_MTL_INLINE MTL::Texture* MTL::Device::newTexture(const MTL::TextureDescriptor* descriptor)
844{
845    return Object::sendMessage<MTL::Texture*>(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_), descriptor);
846}
847
848// method: newTextureWithDescriptor:iosurface:plane:
849_MTL_INLINE MTL::Texture* MTL::Device::newTexture(const MTL::TextureDescriptor* descriptor, const IOSurfaceRef iosurface, NS::UInteger plane)
850{
851    return Object::sendMessage<MTL::Texture*>(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_iosurface_plane_), descriptor, iosurface, plane);
852}
853
854// method: newSharedTextureWithDescriptor:
855_MTL_INLINE MTL::Texture* MTL::Device::newSharedTexture(const MTL::TextureDescriptor* descriptor)
856{
857    return Object::sendMessage<MTL::Texture*>(this, _MTL_PRIVATE_SEL(newSharedTextureWithDescriptor_), descriptor);
858}
859
860// method: newSharedTextureWithHandle:
861_MTL_INLINE MTL::Texture* MTL::Device::newSharedTexture(const MTL::SharedTextureHandle* sharedHandle)
862{
863    return Object::sendMessage<MTL::Texture*>(this, _MTL_PRIVATE_SEL(newSharedTextureWithHandle_), sharedHandle);
864}
865
866// method: newSamplerStateWithDescriptor:
867_MTL_INLINE MTL::SamplerState* MTL::Device::newSamplerState(const MTL::SamplerDescriptor* descriptor)
868{
869    return Object::sendMessage<MTL::SamplerState*>(this, _MTL_PRIVATE_SEL(newSamplerStateWithDescriptor_), descriptor);
870}
871
872// method: newDefaultLibrary
873_MTL_INLINE MTL::Library* MTL::Device::newDefaultLibrary()
874{
875    return Object::sendMessage<MTL::Library*>(this, _MTL_PRIVATE_SEL(newDefaultLibrary));
876}
877
878// method: newDefaultLibraryWithBundle:error:
879_MTL_INLINE MTL::Library* MTL::Device::newDefaultLibrary(const NS::Bundle* bundle, NS::Error** error)
880{
881    return Object::sendMessage<MTL::Library*>(this, _MTL_PRIVATE_SEL(newDefaultLibraryWithBundle_error_), bundle, error);
882}
883
884// method: newLibraryWithFile:error:
885_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const NS::String* filepath, NS::Error** error)
886{
887    return Object::sendMessage<MTL::Library*>(this, _MTL_PRIVATE_SEL(newLibraryWithFile_error_), filepath, error);
888}
889
890// method: newLibraryWithURL:error:
891_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const NS::URL* url, NS::Error** error)
892{
893    return Object::sendMessage<MTL::Library*>(this, _MTL_PRIVATE_SEL(newLibraryWithURL_error_), url, error);
894}
895
896// method: newLibraryWithData:error:
897_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const dispatch_data_t data, NS::Error** error)
898{
899    return Object::sendMessage<MTL::Library*>(this, _MTL_PRIVATE_SEL(newLibraryWithData_error_), data, error);
900}
901
902// method: newLibraryWithSource:options:error:
903_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const NS::String* source, const MTL::CompileOptions* options, NS::Error** error)
904{
905    return Object::sendMessage<MTL::Library*>(this, _MTL_PRIVATE_SEL(newLibraryWithSource_options_error_), source, options, error);
906}
907
908// method: newLibraryWithSource:options:completionHandler:
909_MTL_INLINE void MTL::Device::newLibrary(const NS::String* source, const MTL::CompileOptions* options, const MTL::NewLibraryCompletionHandler completionHandler)
910{
911    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(newLibraryWithSource_options_completionHandler_), source, options, completionHandler);
912}
913
914// method: newLibraryWithStitchedDescriptor:error:
915_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const MTL::StitchedLibraryDescriptor* descriptor, NS::Error** error)
916{
917    return Object::sendMessage<MTL::Library*>(this, _MTL_PRIVATE_SEL(newLibraryWithStitchedDescriptor_error_), descriptor, error);
918}
919
920// method: newLibraryWithStitchedDescriptor:completionHandler:
921_MTL_INLINE void MTL::Device::newLibrary(const MTL::StitchedLibraryDescriptor* descriptor, const MTL::NewLibraryCompletionHandler completionHandler)
922{
923    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(newLibraryWithStitchedDescriptor_completionHandler_), descriptor, completionHandler);
924}
925
926// method: newRenderPipelineStateWithDescriptor:error:
927_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, NS::Error** error)
928{
929    return Object::sendMessage<MTL::RenderPipelineState*>(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_error_), descriptor, error);
930}
931
932// method: newRenderPipelineStateWithDescriptor:options:reflection:error:
933_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error)
934{
935    return Object::sendMessage<MTL::RenderPipelineState*>(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_options_reflection_error_), descriptor, options, reflection, error);
936}
937
938// method: newRenderPipelineStateWithDescriptor:completionHandler:
939_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, const MTL::NewRenderPipelineStateCompletionHandler completionHandler)
940{
941    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_completionHandler_), descriptor, completionHandler);
942}
943
944// method: newRenderPipelineStateWithDescriptor:options:completionHandler:
945_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler)
946{
947    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_options_completionHandler_), descriptor, options, completionHandler);
948}
949
950// method: newComputePipelineStateWithFunction:error:
951_MTL_INLINE MTL::ComputePipelineState* MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, NS::Error** error)
952{
953    return Object::sendMessage<MTL::ComputePipelineState*>(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_error_), computeFunction, error);
954}
955
956// method: newComputePipelineStateWithFunction:options:reflection:error:
957_MTL_INLINE MTL::ComputePipelineState* MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error)
958{
959    return Object::sendMessage<MTL::ComputePipelineState*>(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_options_reflection_error_), computeFunction, options, reflection, error);
960}
961
962// method: newComputePipelineStateWithFunction:completionHandler:
963_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, const MTL::NewComputePipelineStateCompletionHandler completionHandler)
964{
965    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_completionHandler_), computeFunction, completionHandler);
966}
967
968// method: newComputePipelineStateWithFunction:options:completionHandler:
969_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler)
970{
971    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_options_completionHandler_), computeFunction, options, completionHandler);
972}
973
974// method: newComputePipelineStateWithDescriptor:options:reflection:error:
975_MTL_INLINE MTL::ComputePipelineState* MTL::Device::newComputePipelineState(const MTL::ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error)
976{
977    return Object::sendMessage<MTL::ComputePipelineState*>(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_options_reflection_error_), descriptor, options, reflection, error);
978}
979
980// method: newComputePipelineStateWithDescriptor:options:completionHandler:
981_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler)
982{
983    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_options_completionHandler_), descriptor, options, completionHandler);
984}
985
986// method: newFence
987_MTL_INLINE MTL::Fence* MTL::Device::newFence()
988{
989    return Object::sendMessage<MTL::Fence*>(this, _MTL_PRIVATE_SEL(newFence));
990}
991
992// method: supportsFeatureSet:
993_MTL_INLINE bool MTL::Device::supportsFeatureSet(MTL::FeatureSet featureSet)
994{
995    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsFeatureSet_), featureSet);
996}
997
998// method: supportsFamily:
999_MTL_INLINE bool MTL::Device::supportsFamily(MTL::GPUFamily gpuFamily)
1000{
1001    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsFamily_), gpuFamily);
1002}
1003
1004// method: supportsTextureSampleCount:
1005_MTL_INLINE bool MTL::Device::supportsTextureSampleCount(NS::UInteger sampleCount)
1006{
1007    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsTextureSampleCount_), sampleCount);
1008}
1009
1010// method: minimumLinearTextureAlignmentForPixelFormat:
1011_MTL_INLINE NS::UInteger MTL::Device::minimumLinearTextureAlignmentForPixelFormat(MTL::PixelFormat format)
1012{
1013    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(minimumLinearTextureAlignmentForPixelFormat_), format);
1014}
1015
1016// method: minimumTextureBufferAlignmentForPixelFormat:
1017_MTL_INLINE NS::UInteger MTL::Device::minimumTextureBufferAlignmentForPixelFormat(MTL::PixelFormat format)
1018{
1019    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(minimumTextureBufferAlignmentForPixelFormat_), format);
1020}
1021
1022// method: newRenderPipelineStateWithTileDescriptor:options:reflection:error:
1023_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error)
1024{
1025    return Object::sendMessage<MTL::RenderPipelineState*>(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithTileDescriptor_options_reflection_error_), descriptor, options, reflection, error);
1026}
1027
1028// method: newRenderPipelineStateWithTileDescriptor:options:completionHandler:
1029_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler)
1030{
1031    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithTileDescriptor_options_completionHandler_), descriptor, options, completionHandler);
1032}
1033
1034// property: maxThreadgroupMemoryLength
1035_MTL_INLINE NS::UInteger MTL::Device::maxThreadgroupMemoryLength() const
1036{
1037    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(maxThreadgroupMemoryLength));
1038}
1039
1040// property: maxArgumentBufferSamplerCount
1041_MTL_INLINE NS::UInteger MTL::Device::maxArgumentBufferSamplerCount() const
1042{
1043    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(maxArgumentBufferSamplerCount));
1044}
1045
1046// property: programmableSamplePositionsSupported
1047_MTL_INLINE bool MTL::Device::programmableSamplePositionsSupported() const
1048{
1049    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(areProgrammableSamplePositionsSupported));
1050}
1051
1052// method: getDefaultSamplePositions:count:
1053_MTL_INLINE void MTL::Device::getDefaultSamplePositions(MTL::SamplePosition* positions, NS::UInteger count)
1054{
1055    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(getDefaultSamplePositions_count_), positions, count);
1056}
1057
1058// method: newArgumentEncoderWithArguments:
1059_MTL_INLINE MTL::ArgumentEncoder* MTL::Device::newArgumentEncoder(const NS::Array* arguments)
1060{
1061    return Object::sendMessage<MTL::ArgumentEncoder*>(this, _MTL_PRIVATE_SEL(newArgumentEncoderWithArguments_), arguments);
1062}
1063
1064// method: supportsRasterizationRateMapWithLayerCount:
1065_MTL_INLINE bool MTL::Device::supportsRasterizationRateMap(NS::UInteger layerCount)
1066{
1067    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsRasterizationRateMapWithLayerCount_), layerCount);
1068}
1069
1070// method: newRasterizationRateMapWithDescriptor:
1071_MTL_INLINE MTL::RasterizationRateMap* MTL::Device::newRasterizationRateMap(const MTL::RasterizationRateMapDescriptor* descriptor)
1072{
1073    return Object::sendMessage<MTL::RasterizationRateMap*>(this, _MTL_PRIVATE_SEL(newRasterizationRateMapWithDescriptor_), descriptor);
1074}
1075
1076// method: newIndirectCommandBufferWithDescriptor:maxCommandCount:options:
1077_MTL_INLINE MTL::IndirectCommandBuffer* MTL::Device::newIndirectCommandBuffer(const MTL::IndirectCommandBufferDescriptor* descriptor, NS::UInteger maxCount, MTL::ResourceOptions options)
1078{
1079    return Object::sendMessage<MTL::IndirectCommandBuffer*>(this, _MTL_PRIVATE_SEL(newIndirectCommandBufferWithDescriptor_maxCommandCount_options_), descriptor, maxCount, options);
1080}
1081
1082// method: newEvent
1083_MTL_INLINE MTL::Event* MTL::Device::newEvent()
1084{
1085    return Object::sendMessage<MTL::Event*>(this, _MTL_PRIVATE_SEL(newEvent));
1086}
1087
1088// method: newSharedEvent
1089_MTL_INLINE MTL::SharedEvent* MTL::Device::newSharedEvent()
1090{
1091    return Object::sendMessage<MTL::SharedEvent*>(this, _MTL_PRIVATE_SEL(newSharedEvent));
1092}
1093
1094// method: newSharedEventWithHandle:
1095_MTL_INLINE MTL::SharedEvent* MTL::Device::newSharedEvent(const MTL::SharedEventHandle* sharedEventHandle)
1096{
1097    return Object::sendMessage<MTL::SharedEvent*>(this, _MTL_PRIVATE_SEL(newSharedEventWithHandle_), sharedEventHandle);
1098}
1099
1100// property: peerGroupID
1101_MTL_INLINE uint64_t MTL::Device::peerGroupID() const
1102{
1103    return Object::sendMessage<uint64_t>(this, _MTL_PRIVATE_SEL(peerGroupID));
1104}
1105
1106// property: peerIndex
1107_MTL_INLINE uint32_t MTL::Device::peerIndex() const
1108{
1109    return Object::sendMessage<uint32_t>(this, _MTL_PRIVATE_SEL(peerIndex));
1110}
1111
1112// property: peerCount
1113_MTL_INLINE uint32_t MTL::Device::peerCount() const
1114{
1115    return Object::sendMessage<uint32_t>(this, _MTL_PRIVATE_SEL(peerCount));
1116}
1117
1118// method: sparseTileSizeWithTextureType:pixelFormat:sampleCount:
1119_MTL_INLINE MTL::Size MTL::Device::sparseTileSize(MTL::TextureType textureType, MTL::PixelFormat pixelFormat, NS::UInteger sampleCount)
1120{
1121    return Object::sendMessage<MTL::Size>(this, _MTL_PRIVATE_SEL(sparseTileSizeWithTextureType_pixelFormat_sampleCount_), textureType, pixelFormat, sampleCount);
1122}
1123
1124// property: sparseTileSizeInBytes
1125_MTL_INLINE NS::UInteger MTL::Device::sparseTileSizeInBytes() const
1126{
1127    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(sparseTileSizeInBytes));
1128}
1129
1130// method: convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions:
1131_MTL_INLINE void MTL::Device::convertSparsePixelRegions(const MTL::Region* pixelRegions, MTL::Region* tileRegions, MTL::Size tileSize, MTL::SparseTextureRegionAlignmentMode mode, NS::UInteger numRegions)
1132{
1133    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(convertSparsePixelRegions_toTileRegions_withTileSize_alignmentMode_numRegions_), pixelRegions, tileRegions, tileSize, mode, numRegions);
1134}
1135
1136// method: convertSparseTileRegions:toPixelRegions:withTileSize:numRegions:
1137_MTL_INLINE void MTL::Device::convertSparseTileRegions(const MTL::Region* tileRegions, MTL::Region* pixelRegions, MTL::Size tileSize, NS::UInteger numRegions)
1138{
1139    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(convertSparseTileRegions_toPixelRegions_withTileSize_numRegions_), tileRegions, pixelRegions, tileSize, numRegions);
1140}
1141
1142// property: maxBufferLength
1143_MTL_INLINE NS::UInteger MTL::Device::maxBufferLength() const
1144{
1145    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(maxBufferLength));
1146}
1147
1148// property: counterSets
1149_MTL_INLINE NS::Array* MTL::Device::counterSets() const
1150{
1151    return Object::sendMessage<NS::Array*>(this, _MTL_PRIVATE_SEL(counterSets));
1152}
1153
1154// method: newCounterSampleBufferWithDescriptor:error:
1155_MTL_INLINE MTL::CounterSampleBuffer* MTL::Device::newCounterSampleBuffer(const MTL::CounterSampleBufferDescriptor* descriptor, NS::Error** error)
1156{
1157    return Object::sendMessage<MTL::CounterSampleBuffer*>(this, _MTL_PRIVATE_SEL(newCounterSampleBufferWithDescriptor_error_), descriptor, error);
1158}
1159
1160// method: sampleTimestamps:gpuTimestamp:
1161_MTL_INLINE void MTL::Device::sampleTimestamps(MTL::Timestamp* cpuTimestamp, MTL::Timestamp* gpuTimestamp)
1162{
1163    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(sampleTimestamps_gpuTimestamp_), cpuTimestamp, gpuTimestamp);
1164}
1165
1166// method: supportsCounterSampling:
1167_MTL_INLINE bool MTL::Device::supportsCounterSampling(MTL::CounterSamplingPoint samplingPoint)
1168{
1169    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsCounterSampling_), samplingPoint);
1170}
1171
1172// method: supportsVertexAmplificationCount:
1173_MTL_INLINE bool MTL::Device::supportsVertexAmplificationCount(NS::UInteger count)
1174{
1175    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsVertexAmplificationCount_), count);
1176}
1177
1178// property: supportsDynamicLibraries
1179_MTL_INLINE bool MTL::Device::supportsDynamicLibraries() const
1180{
1181    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsDynamicLibraries));
1182}
1183
1184// property: supportsRenderDynamicLibraries
1185_MTL_INLINE bool MTL::Device::supportsRenderDynamicLibraries() const
1186{
1187    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsRenderDynamicLibraries));
1188}
1189
1190// method: newDynamicLibrary:error:
1191_MTL_INLINE MTL::DynamicLibrary* MTL::Device::newDynamicLibrary(const MTL::Library* library, NS::Error** error)
1192{
1193    return Object::sendMessage<MTL::DynamicLibrary*>(this, _MTL_PRIVATE_SEL(newDynamicLibrary_error_), library, error);
1194}
1195
1196// method: newDynamicLibraryWithURL:error:
1197_MTL_INLINE MTL::DynamicLibrary* MTL::Device::newDynamicLibrary(const NS::URL* url, NS::Error** error)
1198{
1199    return Object::sendMessage<MTL::DynamicLibrary*>(this, _MTL_PRIVATE_SEL(newDynamicLibraryWithURL_error_), url, error);
1200}
1201
1202// method: newBinaryArchiveWithDescriptor:error:
1203_MTL_INLINE MTL::BinaryArchive* MTL::Device::newBinaryArchive(const MTL::BinaryArchiveDescriptor* descriptor, NS::Error** error)
1204{
1205    return Object::sendMessage<MTL::BinaryArchive*>(this, _MTL_PRIVATE_SEL(newBinaryArchiveWithDescriptor_error_), descriptor, error);
1206}
1207
1208// property: supportsRaytracing
1209_MTL_INLINE bool MTL::Device::supportsRaytracing() const
1210{
1211    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsRaytracing));
1212}
1213
1214// method: accelerationStructureSizesWithDescriptor:
1215_MTL_INLINE MTL::AccelerationStructureSizes MTL::Device::accelerationStructureSizes(const MTL::AccelerationStructureDescriptor* descriptor)
1216{
1217    return Object::sendMessage<MTL::AccelerationStructureSizes>(this, _MTL_PRIVATE_SEL(accelerationStructureSizesWithDescriptor_), descriptor);
1218}
1219
1220// method: newAccelerationStructureWithSize:
1221_MTL_INLINE MTL::AccelerationStructure* MTL::Device::newAccelerationStructure(NS::UInteger size)
1222{
1223    return Object::sendMessage<MTL::AccelerationStructure*>(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithSize_), size);
1224}
1225
1226// method: newAccelerationStructureWithDescriptor:
1227_MTL_INLINE MTL::AccelerationStructure* MTL::Device::newAccelerationStructure(const MTL::AccelerationStructureDescriptor* descriptor)
1228{
1229    return Object::sendMessage<MTL::AccelerationStructure*>(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithDescriptor_), descriptor);
1230}
1231
1232// property: supportsFunctionPointers
1233_MTL_INLINE bool MTL::Device::supportsFunctionPointers() const
1234{
1235    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsFunctionPointers));
1236}
1237
1238// property: supportsFunctionPointersFromRender
1239_MTL_INLINE bool MTL::Device::supportsFunctionPointersFromRender() const
1240{
1241    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsFunctionPointersFromRender));
1242}
1243
1244// property: supportsRaytracingFromRender
1245_MTL_INLINE bool MTL::Device::supportsRaytracingFromRender() const
1246{
1247    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsRaytracingFromRender));
1248}
1249
1250// property: supportsPrimitiveMotionBlur
1251_MTL_INLINE bool MTL::Device::supportsPrimitiveMotionBlur() const
1252{
1253    return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportsPrimitiveMotionBlur));
1254}