yum-mirror/VkFFT
git clone https://git.yummers.dev/yum-mirror/VkFFT
ba7001c
v1.2.31
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 ) { 41FeatureSet_iOS_GPUFamily1_v1 = 0 , 42FeatureSet_iOS_GPUFamily2_v1 = 1 , 43FeatureSet_iOS_GPUFamily1_v2 = 2 , 44FeatureSet_iOS_GPUFamily2_v2 = 3 , 45FeatureSet_iOS_GPUFamily3_v1 = 4 , 46FeatureSet_iOS_GPUFamily1_v3 = 5 , 47FeatureSet_iOS_GPUFamily2_v3 = 6 , 48FeatureSet_iOS_GPUFamily3_v2 = 7 , 49FeatureSet_iOS_GPUFamily1_v4 = 8 , 50FeatureSet_iOS_GPUFamily2_v4 = 9 , 51FeatureSet_iOS_GPUFamily3_v3 = 10 , 52FeatureSet_iOS_GPUFamily4_v1 = 11 , 53FeatureSet_iOS_GPUFamily1_v5 = 12 , 54FeatureSet_iOS_GPUFamily2_v5 = 13 , 55FeatureSet_iOS_GPUFamily3_v4 = 14 , 56FeatureSet_iOS_GPUFamily4_v2 = 15 , 57FeatureSet_iOS_GPUFamily5_v1 = 16 , 58FeatureSet_macOS_GPUFamily1_v1 = 10000 , 59FeatureSet_OSX_GPUFamily1_v1 = 10000 , 60FeatureSet_macOS_GPUFamily1_v2 = 10001 , 61FeatureSet_OSX_GPUFamily1_v2 = 10001 , 62FeatureSet_OSX_ReadWriteTextureTier2 = 10002 , 63FeatureSet_macOS_ReadWriteTextureTier2 = 10002 , 64FeatureSet_macOS_GPUFamily1_v3 = 10003 , 65FeatureSet_macOS_GPUFamily1_v4 = 10004 , 66FeatureSet_macOS_GPUFamily2_v1 = 10005 , 67FeatureSet_watchOS_GPUFamily1_v1 = 20000 , 68FeatureSet_WatchOS_GPUFamily1_v1 = 20000 , 69FeatureSet_watchOS_GPUFamily2_v1 = 20001 , 70FeatureSet_WatchOS_GPUFamily2_v1 = 20001 , 71FeatureSet_tvOS_GPUFamily1_v1 = 30000 , 72FeatureSet_TVOS_GPUFamily1_v1 = 30000 , 73FeatureSet_tvOS_GPUFamily1_v2 = 30001 , 74FeatureSet_tvOS_GPUFamily1_v3 = 30002 , 75FeatureSet_tvOS_GPUFamily2_v1 = 30003 , 76FeatureSet_tvOS_GPUFamily1_v4 = 30004 , 77FeatureSet_tvOS_GPUFamily2_v2 = 30005 , 78} ; 79 80_MTL_ENUM ( NS :: Integer , GPUFamily ) { 81GPUFamilyApple1 = 1001 , 82GPUFamilyApple2 = 1002 , 83GPUFamilyApple3 = 1003 , 84GPUFamilyApple4 = 1004 , 85GPUFamilyApple5 = 1005 , 86GPUFamilyApple6 = 1006 , 87GPUFamilyApple7 = 1007 , 88GPUFamilyApple8 = 1008 , 89GPUFamilyMac1 = 2001 , 90GPUFamilyMac2 = 2002 , 91GPUFamilyCommon1 = 3001 , 92GPUFamilyCommon2 = 3002 , 93GPUFamilyCommon3 = 3003 , 94GPUFamilyMacCatalyst1 = 4001 , 95GPUFamilyMacCatalyst2 = 4002 , 96} ; 97 98_MTL_ENUM ( NS :: UInteger , DeviceLocation ) { 99DeviceLocationBuiltIn = 0 , 100DeviceLocationSlot = 1 , 101DeviceLocationExternal = 2 , 102DeviceLocationUnspecified = NS :: UIntegerMax , 103} ; 104 105_MTL_OPTIONS ( NS :: UInteger , PipelineOption ) { 106PipelineOptionNone = 0 , 107PipelineOptionArgumentInfo = 1 , 108PipelineOptionBufferTypeInfo = 2 , 109PipelineOptionFailOnBinaryArchiveMiss = 4 , 110} ; 111 112_MTL_ENUM ( NS :: UInteger , ReadWriteTextureTier ) { 113ReadWriteTextureTierNone = 0 , 114ReadWriteTextureTier1 = 1 , 115ReadWriteTextureTier2 = 2 , 116} ; 117 118_MTL_ENUM ( NS :: UInteger , ArgumentBuffersTier ) { 119ArgumentBuffersTier1 = 0 , 120ArgumentBuffersTier2 = 1 , 121} ; 122 123_MTL_ENUM ( NS :: UInteger , SparseTextureRegionAlignmentMode ) { 124SparseTextureRegionAlignmentModeOutward = 0 , 125SparseTextureRegionAlignmentModeInward = 1 , 126} ; 127 128struct AccelerationStructureSizes 129{ 130NS :: UInteger accelerationStructureSize ; 131NS :: UInteger buildScratchBufferSize ; 132NS :: UInteger refitScratchBufferSize ; 133} _MTL_PACKED ; 134 135_MTL_ENUM ( NS :: UInteger , CounterSamplingPoint ) { 136CounterSamplingPointAtStageBoundary = 0 , 137CounterSamplingPointAtDrawBoundary = 1 , 138CounterSamplingPointAtDispatchBoundary = 2 , 139CounterSamplingPointAtTileDispatchBoundary = 3 , 140CounterSamplingPointAtBlitBoundary = 4 , 141} ; 142 143struct SizeAndAlign 144{ 145NS :: UInteger size ; 146NS :: UInteger align ; 147} _MTL_PACKED ; 148 149class ArgumentDescriptor : public NS :: Copying < ArgumentDescriptor > 150{ 151public : 152static class ArgumentDescriptor * alloc () ; 153 154class ArgumentDescriptor * init () ; 155 156static class ArgumentDescriptor * argumentDescriptor () ; 157 158MTL :: DataType dataType () const ; 159void setDataType ( MTL :: DataType dataType ) ; 160 161NS :: UInteger index () const ; 162void setIndex ( NS :: UInteger index ) ; 163 164NS :: UInteger arrayLength () const ; 165void setArrayLength ( NS :: UInteger arrayLength ) ; 166 167MTL :: ArgumentAccess access () const ; 168void setAccess ( MTL :: ArgumentAccess access ) ; 169 170MTL :: TextureType textureType () const ; 171void setTextureType ( MTL :: TextureType textureType ) ; 172 173NS :: UInteger constantBlockAlignment () const ; 174void 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 : 228void newLibrary ( const NS :: String * pSource , const class CompileOptions * pOptions , const NewLibraryCompletionHandlerFunction & completionHandler ) ; 229 230void newLibrary ( const class StitchedLibraryDescriptor * pDescriptor , const MTL :: NewLibraryCompletionHandlerFunction & completionHandler ) ; 231 232void newRenderPipelineState ( const class RenderPipelineDescriptor * pDescriptor , const NewRenderPipelineStateCompletionHandlerFunction & completionHandler ) ; 233 234void newRenderPipelineState ( const class RenderPipelineDescriptor * pDescriptor , PipelineOption options , const NewRenderPipelineStateWithReflectionCompletionHandlerFunction & completionHandler ) ; 235 236void newRenderPipelineState ( const class TileRenderPipelineDescriptor * pDescriptor , PipelineOption options , const NewRenderPipelineStateWithReflectionCompletionHandlerFunction & completionHandler ) ; 237 238void newComputePipelineState ( const class Function * pFunction , const NewComputePipelineStateCompletionHandlerFunction & completionHandler ) ; 239 240void newComputePipelineState ( const class Function * pFunction , PipelineOption options , const NewComputePipelineStateWithReflectionCompletionHandlerFunction & completionHandler ) ; 241 242void newComputePipelineState ( const class ComputePipelineDescriptor * pDescriptor , PipelineOption options , const NewComputePipelineStateWithReflectionCompletionHandlerFunction & completionHandler ) ; 243 244bool isHeadless () const ; 245 246NS :: String * name () const ; 247 248uint64_t registryID () const ; 249 250MTL :: Size maxThreadsPerThreadgroup () const ; 251 252bool lowPower () const ; 253 254bool headless () const ; 255 256bool removable () const ; 257 258bool hasUnifiedMemory () const ; 259 260uint64_t recommendedMaxWorkingSetSize () const ; 261 262MTL :: DeviceLocation location () const ; 263 264NS :: UInteger locationNumber () const ; 265 266uint64_t maxTransferRate () const ; 267 268bool depth24Stencil8PixelFormatSupported () const ; 269 270MTL :: ReadWriteTextureTier readWriteTextureSupport () const ; 271 272MTL :: ArgumentBuffersTier argumentBuffersSupport () const ; 273 274bool rasterOrderGroupsSupported () const ; 275 276bool supports32BitFloatFiltering () const ; 277 278bool supports32BitMSAA () const ; 279 280bool supportsQueryTextureLOD () const ; 281 282bool supportsBCTextureCompression () const ; 283 284bool supportsPullModelInterpolation () const ; 285 286bool barycentricCoordsSupported () const ; 287 288bool supportsShaderBarycentricCoordinates () const ; 289 290NS :: UInteger currentAllocatedSize () const ; 291 292class CommandQueue * newCommandQueue () ; 293 294class CommandQueue * newCommandQueue ( NS :: UInteger maxCommandBufferCount ) ; 295 296MTL :: SizeAndAlign heapTextureSizeAndAlign ( const class TextureDescriptor * desc ) ; 297 298MTL :: SizeAndAlign heapBufferSizeAndAlign ( NS :: UInteger length , MTL :: ResourceOptions options ) ; 299 300class Heap * newHeap ( const class HeapDescriptor * descriptor ) ; 301 302class Buffer * newBuffer ( NS :: UInteger length , MTL :: ResourceOptions options ) ; 303 304class Buffer * newBuffer ( const void * pointer , NS :: UInteger length , MTL :: ResourceOptions options ) ; 305 306class Buffer * newBuffer ( const void * pointer , NS :: UInteger length , MTL :: ResourceOptions options , const void ( ^ deallocator )( void * , NS :: UInteger )) ; 307 308class DepthStencilState * newDepthStencilState ( const class DepthStencilDescriptor * descriptor ) ; 309 310class Texture * newTexture ( const class TextureDescriptor * descriptor ) ; 311 312class Texture * newTexture ( const class TextureDescriptor * descriptor , const IOSurfaceRef iosurface , NS :: UInteger plane ) ; 313 314class Texture * newSharedTexture ( const class TextureDescriptor * descriptor ) ; 315 316class Texture * newSharedTexture ( const class SharedTextureHandle * sharedHandle ) ; 317 318class SamplerState * newSamplerState ( const class SamplerDescriptor * descriptor ) ; 319 320class Library * newDefaultLibrary () ; 321 322class Library * newDefaultLibrary ( const NS :: Bundle * bundle , NS :: Error ** error ) ; 323 324class Library * newLibrary ( const NS :: String * filepath , NS :: Error ** error ) ; 325 326class Library * newLibrary ( const NS :: URL * url , NS :: Error ** error ) ; 327 328class Library * newLibrary ( const dispatch_data_t data , NS :: Error ** error ) ; 329 330class Library * newLibrary ( const NS :: String * source , const class CompileOptions * options , NS :: Error ** error ) ; 331 332void newLibrary ( const NS :: String * source , const class CompileOptions * options , const MTL :: NewLibraryCompletionHandler completionHandler ) ; 333 334class Library * newLibrary ( const class StitchedLibraryDescriptor * descriptor , NS :: Error ** error ) ; 335 336void newLibrary ( const class StitchedLibraryDescriptor * descriptor , const MTL :: NewLibraryCompletionHandler completionHandler ) ; 337 338class RenderPipelineState * newRenderPipelineState ( const class RenderPipelineDescriptor * descriptor , NS :: Error ** error ) ; 339 340class RenderPipelineState * newRenderPipelineState ( const class RenderPipelineDescriptor * descriptor , MTL :: PipelineOption options , const MTL :: AutoreleasedRenderPipelineReflection * reflection , NS :: Error ** error ) ; 341 342void newRenderPipelineState ( const class RenderPipelineDescriptor * descriptor , const MTL :: NewRenderPipelineStateCompletionHandler completionHandler ) ; 343 344void newRenderPipelineState ( const class RenderPipelineDescriptor * descriptor , MTL :: PipelineOption options , const MTL :: NewRenderPipelineStateWithReflectionCompletionHandler completionHandler ) ; 345 346class ComputePipelineState * newComputePipelineState ( const class Function * computeFunction , NS :: Error ** error ) ; 347 348class ComputePipelineState * newComputePipelineState ( const class Function * computeFunction , MTL :: PipelineOption options , const MTL :: AutoreleasedComputePipelineReflection * reflection , NS :: Error ** error ) ; 349 350void newComputePipelineState ( const class Function * computeFunction , const MTL :: NewComputePipelineStateCompletionHandler completionHandler ) ; 351 352void newComputePipelineState ( const class Function * computeFunction , MTL :: PipelineOption options , const MTL :: NewComputePipelineStateWithReflectionCompletionHandler completionHandler ) ; 353 354class ComputePipelineState * newComputePipelineState ( const class ComputePipelineDescriptor * descriptor , MTL :: PipelineOption options , const MTL :: AutoreleasedComputePipelineReflection * reflection , NS :: Error ** error ) ; 355 356void newComputePipelineState ( const class ComputePipelineDescriptor * descriptor , MTL :: PipelineOption options , const MTL :: NewComputePipelineStateWithReflectionCompletionHandler completionHandler ) ; 357 358class Fence * newFence () ; 359 360bool supportsFeatureSet ( MTL :: FeatureSet featureSet ) ; 361 362bool supportsFamily ( MTL :: GPUFamily gpuFamily ) ; 363 364bool supportsTextureSampleCount ( NS :: UInteger sampleCount ) ; 365 366NS :: UInteger minimumLinearTextureAlignmentForPixelFormat ( MTL :: PixelFormat format ) ; 367 368NS :: UInteger minimumTextureBufferAlignmentForPixelFormat ( MTL :: PixelFormat format ) ; 369 370class RenderPipelineState * newRenderPipelineState ( const class TileRenderPipelineDescriptor * descriptor , MTL :: PipelineOption options , const MTL :: AutoreleasedRenderPipelineReflection * reflection , NS :: Error ** error ) ; 371 372void newRenderPipelineState ( const class TileRenderPipelineDescriptor * descriptor , MTL :: PipelineOption options , const MTL :: NewRenderPipelineStateWithReflectionCompletionHandler completionHandler ) ; 373 374NS :: UInteger maxThreadgroupMemoryLength () const ; 375 376NS :: UInteger maxArgumentBufferSamplerCount () const ; 377 378bool programmableSamplePositionsSupported () const ; 379 380void getDefaultSamplePositions ( MTL :: SamplePosition * positions , NS :: UInteger count ) ; 381 382class ArgumentEncoder * newArgumentEncoder ( const NS :: Array * arguments ) ; 383 384bool supportsRasterizationRateMap ( NS :: UInteger layerCount ) ; 385 386class RasterizationRateMap * newRasterizationRateMap ( const class RasterizationRateMapDescriptor * descriptor ) ; 387 388class IndirectCommandBuffer * newIndirectCommandBuffer ( const class IndirectCommandBufferDescriptor * descriptor , NS :: UInteger maxCount , MTL :: ResourceOptions options ) ; 389 390class Event * newEvent () ; 391 392class SharedEvent * newSharedEvent () ; 393 394class SharedEvent * newSharedEvent ( const class SharedEventHandle * sharedEventHandle ) ; 395 396uint64_t peerGroupID () const ; 397 398uint32_t peerIndex () const ; 399 400uint32_t peerCount () const ; 401 402MTL :: Size sparseTileSize ( MTL :: TextureType textureType , MTL :: PixelFormat pixelFormat , NS :: UInteger sampleCount ) ; 403 404NS :: UInteger sparseTileSizeInBytes () const ; 405 406void convertSparsePixelRegions ( const MTL :: Region * pixelRegions , MTL :: Region * tileRegions , MTL :: Size tileSize , MTL :: SparseTextureRegionAlignmentMode mode , NS :: UInteger numRegions ) ; 407 408void convertSparseTileRegions ( const MTL :: Region * tileRegions , MTL :: Region * pixelRegions , MTL :: Size tileSize , NS :: UInteger numRegions ) ; 409 410NS :: UInteger maxBufferLength () const ; 411 412NS :: Array * counterSets () const ; 413 414class CounterSampleBuffer * newCounterSampleBuffer ( const class CounterSampleBufferDescriptor * descriptor , NS :: Error ** error ) ; 415 416void sampleTimestamps ( MTL :: Timestamp * cpuTimestamp , MTL :: Timestamp * gpuTimestamp ) ; 417 418bool supportsCounterSampling ( MTL :: CounterSamplingPoint samplingPoint ) ; 419 420bool supportsVertexAmplificationCount ( NS :: UInteger count ) ; 421 422bool supportsDynamicLibraries () const ; 423 424bool supportsRenderDynamicLibraries () const ; 425 426class DynamicLibrary * newDynamicLibrary ( const class Library * library , NS :: Error ** error ) ; 427 428class DynamicLibrary * newDynamicLibrary ( const NS :: URL * url , NS :: Error ** error ) ; 429 430class BinaryArchive * newBinaryArchive ( const class BinaryArchiveDescriptor * descriptor , NS :: Error ** error ) ; 431 432bool supportsRaytracing () const ; 433 434MTL :: AccelerationStructureSizes accelerationStructureSizes ( const class AccelerationStructureDescriptor * descriptor ) ; 435 436class AccelerationStructure * newAccelerationStructure ( NS :: UInteger size ) ; 437 438class AccelerationStructure * newAccelerationStructure ( const class AccelerationStructureDescriptor * descriptor ) ; 439 440bool supportsFunctionPointers () const ; 441 442bool supportsFunctionPointersFromRender () const ; 443 444bool supportsRaytracingFromRender () const ; 445 446bool supportsPrimitiveMotionBlur () const ; 447} ; 448 449} 450 451// static method: alloc 452_MTL_INLINE MTL :: ArgumentDescriptor * MTL :: ArgumentDescriptor :: alloc () 453{ 454return NS :: Object :: alloc < MTL :: ArgumentDescriptor > ( _MTL_PRIVATE_CLS ( MTLArgumentDescriptor )) ; 455} 456 457// method: init 458_MTL_INLINE MTL :: ArgumentDescriptor * MTL :: ArgumentDescriptor :: init () 459{ 460return NS :: Object :: init < MTL :: ArgumentDescriptor > () ; 461} 462 463// static method: argumentDescriptor 464_MTL_INLINE MTL :: ArgumentDescriptor * MTL :: ArgumentDescriptor :: argumentDescriptor () 465{ 466return 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{ 472return Object :: sendMessage < MTL :: DataType > ( this , _MTL_PRIVATE_SEL ( dataType )) ; 473} 474 475_MTL_INLINE void MTL :: ArgumentDescriptor :: setDataType ( MTL :: DataType dataType ) 476{ 477Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setDataType_ ) , dataType ) ; 478} 479 480// property: index 481_MTL_INLINE NS :: UInteger MTL :: ArgumentDescriptor :: index () const 482{ 483return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( index )) ; 484} 485 486_MTL_INLINE void MTL :: ArgumentDescriptor :: setIndex ( NS :: UInteger index ) 487{ 488Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setIndex_ ) , index ) ; 489} 490 491// property: arrayLength 492_MTL_INLINE NS :: UInteger MTL :: ArgumentDescriptor :: arrayLength () const 493{ 494return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( arrayLength )) ; 495} 496 497_MTL_INLINE void MTL :: ArgumentDescriptor :: setArrayLength ( NS :: UInteger arrayLength ) 498{ 499Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setArrayLength_ ) , arrayLength ) ; 500} 501 502// property: access 503_MTL_INLINE MTL :: ArgumentAccess MTL :: ArgumentDescriptor :: access () const 504{ 505return Object :: sendMessage < MTL :: ArgumentAccess > ( this , _MTL_PRIVATE_SEL ( access )) ; 506} 507 508_MTL_INLINE void MTL :: ArgumentDescriptor :: setAccess ( MTL :: ArgumentAccess access ) 509{ 510Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setAccess_ ) , access ) ; 511} 512 513// property: textureType 514_MTL_INLINE MTL :: TextureType MTL :: ArgumentDescriptor :: textureType () const 515{ 516return Object :: sendMessage < MTL :: TextureType > ( this , _MTL_PRIVATE_SEL ( textureType )) ; 517} 518 519_MTL_INLINE void MTL :: ArgumentDescriptor :: setTextureType ( MTL :: TextureType textureType ) 520{ 521Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( setTextureType_ ) , textureType ) ; 522} 523 524// property: constantBlockAlignment 525_MTL_INLINE NS :: UInteger MTL :: ArgumentDescriptor :: constantBlockAlignment () const 526{ 527return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( constantBlockAlignment )) ; 528} 529 530_MTL_INLINE void MTL :: ArgumentDescriptor :: setConstantBlockAlignment ( NS :: UInteger constantBlockAlignment ) 531{ 532Object :: 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{ 549return :: MTLCreateSystemDefaultDevice () ; 550} 551 552NS :: Array * MTL :: CopyAllDevices () 553{ 554#if TARGET_OS_OSX 555return :: MTLCopyAllDevices () ; 556#else 557return nullptr ; 558#endif // TARGET_OS_OSX 559} 560 561NS :: Array * MTL :: CopyAllDevicesWithObserver ( NS :: Object ** pOutObserver , DeviceNotificationHandlerBlock handler ) 562{ 563#if TARGET_OS_OSX 564return :: MTLCopyAllDevicesWithObserver ( pOutObserver , handler ) ; 565#else 566( void ) pOutObserver ; 567( void ) handler ; 568 569return 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 577return 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 593newLibrary ( 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 600newLibrary ( 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 607newRenderPipelineState ( 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 614newRenderPipelineState ( 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 621newRenderPipelineState ( 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 628newComputePipelineState ( 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 635newComputePipelineState ( 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 642newComputePipelineState ( pDescriptor , options , ^ ( ComputePipelineState * pPipelineState , ComputePipelineReflection * pReflection , NS :: Error * pError ) { blockCompletionHandler ( pPipelineState , pReflection , pError ) ; }) ; 643} 644 645_MTL_INLINE bool MTL :: Device :: isHeadless () const 646{ 647return headless () ; 648} 649 650// property: name 651_MTL_INLINE NS :: String * MTL :: Device :: name () const 652{ 653return Object :: sendMessage < NS :: String *> ( this , _MTL_PRIVATE_SEL ( name )) ; 654} 655 656// property: registryID 657_MTL_INLINE uint64_t MTL :: Device :: registryID () const 658{ 659return Object :: sendMessage < uint64_t > ( this , _MTL_PRIVATE_SEL ( registryID )) ; 660} 661 662// property: maxThreadsPerThreadgroup 663_MTL_INLINE MTL :: Size MTL :: Device :: maxThreadsPerThreadgroup () const 664{ 665return Object :: sendMessage < MTL :: Size > ( this , _MTL_PRIVATE_SEL ( maxThreadsPerThreadgroup )) ; 666} 667 668// property: lowPower 669_MTL_INLINE bool MTL :: Device :: lowPower () const 670{ 671return Object :: sendMessage < bool > ( this , _MTL_PRIVATE_SEL ( isLowPower )) ; 672} 673 674// property: headless 675_MTL_INLINE bool MTL :: Device :: headless () const 676{ 677return Object :: sendMessage < bool > ( this , _MTL_PRIVATE_SEL ( isHeadless )) ; 678} 679 680// property: removable 681_MTL_INLINE bool MTL :: Device :: removable () const 682{ 683return Object :: sendMessage < bool > ( this , _MTL_PRIVATE_SEL ( isRemovable )) ; 684} 685 686// property: hasUnifiedMemory 687_MTL_INLINE bool MTL :: Device :: hasUnifiedMemory () const 688{ 689return Object :: sendMessage < bool > ( this , _MTL_PRIVATE_SEL ( hasUnifiedMemory )) ; 690} 691 692// property: recommendedMaxWorkingSetSize 693_MTL_INLINE uint64_t MTL :: Device :: recommendedMaxWorkingSetSize () const 694{ 695return Object :: sendMessage < uint64_t > ( this , _MTL_PRIVATE_SEL ( recommendedMaxWorkingSetSize )) ; 696} 697 698// property: location 699_MTL_INLINE MTL :: DeviceLocation MTL :: Device :: location () const 700{ 701return Object :: sendMessage < MTL :: DeviceLocation > ( this , _MTL_PRIVATE_SEL ( location )) ; 702} 703 704// property: locationNumber 705_MTL_INLINE NS :: UInteger MTL :: Device :: locationNumber () const 706{ 707return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( locationNumber )) ; 708} 709 710// property: maxTransferRate 711_MTL_INLINE uint64_t MTL :: Device :: maxTransferRate () const 712{ 713return Object :: sendMessage < uint64_t > ( this , _MTL_PRIVATE_SEL ( maxTransferRate )) ; 714} 715 716// property: depth24Stencil8PixelFormatSupported 717_MTL_INLINE bool MTL :: Device :: depth24Stencil8PixelFormatSupported () const 718{ 719return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( isDepth24Stencil8PixelFormatSupported )) ; 720} 721 722// property: readWriteTextureSupport 723_MTL_INLINE MTL :: ReadWriteTextureTier MTL :: Device :: readWriteTextureSupport () const 724{ 725return Object :: sendMessage < MTL :: ReadWriteTextureTier > ( this , _MTL_PRIVATE_SEL ( readWriteTextureSupport )) ; 726} 727 728// property: argumentBuffersSupport 729_MTL_INLINE MTL :: ArgumentBuffersTier MTL :: Device :: argumentBuffersSupport () const 730{ 731return Object :: sendMessage < MTL :: ArgumentBuffersTier > ( this , _MTL_PRIVATE_SEL ( argumentBuffersSupport )) ; 732} 733 734// property: rasterOrderGroupsSupported 735_MTL_INLINE bool MTL :: Device :: rasterOrderGroupsSupported () const 736{ 737return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( areRasterOrderGroupsSupported )) ; 738} 739 740// property: supports32BitFloatFiltering 741_MTL_INLINE bool MTL :: Device :: supports32BitFloatFiltering () const 742{ 743return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supports32BitFloatFiltering )) ; 744} 745 746// property: supports32BitMSAA 747_MTL_INLINE bool MTL :: Device :: supports32BitMSAA () const 748{ 749return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supports32BitMSAA )) ; 750} 751 752// property: supportsQueryTextureLOD 753_MTL_INLINE bool MTL :: Device :: supportsQueryTextureLOD () const 754{ 755return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportsQueryTextureLOD )) ; 756} 757 758// property: supportsBCTextureCompression 759_MTL_INLINE bool MTL :: Device :: supportsBCTextureCompression () const 760{ 761return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportsBCTextureCompression )) ; 762} 763 764// property: supportsPullModelInterpolation 765_MTL_INLINE bool MTL :: Device :: supportsPullModelInterpolation () const 766{ 767return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportsPullModelInterpolation )) ; 768} 769 770// property: barycentricCoordsSupported 771_MTL_INLINE bool MTL :: Device :: barycentricCoordsSupported () const 772{ 773return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( areBarycentricCoordsSupported )) ; 774} 775 776// property: supportsShaderBarycentricCoordinates 777_MTL_INLINE bool MTL :: Device :: supportsShaderBarycentricCoordinates () const 778{ 779return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportsShaderBarycentricCoordinates )) ; 780} 781 782// property: currentAllocatedSize 783_MTL_INLINE NS :: UInteger MTL :: Device :: currentAllocatedSize () const 784{ 785return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( currentAllocatedSize )) ; 786} 787 788// method: newCommandQueue 789_MTL_INLINE MTL :: CommandQueue * MTL :: Device :: newCommandQueue () 790{ 791return 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{ 797return 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{ 803return 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{ 809return 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{ 815return 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{ 821return 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{ 827return 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{ 833return 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{ 839return 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{ 845return 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{ 851return 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{ 857return 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{ 863return 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{ 869return Object :: sendMessage < MTL :: SamplerState *> ( this , _MTL_PRIVATE_SEL ( newSamplerStateWithDescriptor_ ) , descriptor ) ; 870} 871 872// method: newDefaultLibrary 873_MTL_INLINE MTL :: Library * MTL :: Device :: newDefaultLibrary () 874{ 875return 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{ 881return 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{ 887return 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{ 893return 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{ 899return 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{ 905return 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{ 911Object :: 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{ 917return 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{ 923Object :: 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{ 929return 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{ 935return 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{ 941Object :: 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{ 947Object :: 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{ 953return 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{ 959return 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{ 965Object :: 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{ 971Object :: 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{ 977return 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{ 983Object :: 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{ 989return 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{ 995return 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{ 1001return 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{ 1007return 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{ 1013return 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{ 1019return 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{ 1025return 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{ 1031Object :: 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{ 1037return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( maxThreadgroupMemoryLength )) ; 1038} 1039 1040// property: maxArgumentBufferSamplerCount 1041_MTL_INLINE NS :: UInteger MTL :: Device :: maxArgumentBufferSamplerCount () const 1042{ 1043return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( maxArgumentBufferSamplerCount )) ; 1044} 1045 1046// property: programmableSamplePositionsSupported 1047_MTL_INLINE bool MTL :: Device :: programmableSamplePositionsSupported () const 1048{ 1049return 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{ 1055Object :: 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{ 1061return 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{ 1067return 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{ 1073return 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{ 1079return 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{ 1085return Object :: sendMessage < MTL :: Event *> ( this , _MTL_PRIVATE_SEL ( newEvent )) ; 1086} 1087 1088// method: newSharedEvent 1089_MTL_INLINE MTL :: SharedEvent * MTL :: Device :: newSharedEvent () 1090{ 1091return 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{ 1097return 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{ 1103return Object :: sendMessage < uint64_t > ( this , _MTL_PRIVATE_SEL ( peerGroupID )) ; 1104} 1105 1106// property: peerIndex 1107_MTL_INLINE uint32_t MTL :: Device :: peerIndex () const 1108{ 1109return Object :: sendMessage < uint32_t > ( this , _MTL_PRIVATE_SEL ( peerIndex )) ; 1110} 1111 1112// property: peerCount 1113_MTL_INLINE uint32_t MTL :: Device :: peerCount () const 1114{ 1115return 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{ 1121return 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{ 1127return 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{ 1133Object :: 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{ 1139Object :: 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{ 1145return Object :: sendMessage < NS :: UInteger > ( this , _MTL_PRIVATE_SEL ( maxBufferLength )) ; 1146} 1147 1148// property: counterSets 1149_MTL_INLINE NS :: Array * MTL :: Device :: counterSets () const 1150{ 1151return 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{ 1157return 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{ 1163Object :: 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{ 1169return 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{ 1175return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportsVertexAmplificationCount_ ) , count ) ; 1176} 1177 1178// property: supportsDynamicLibraries 1179_MTL_INLINE bool MTL :: Device :: supportsDynamicLibraries () const 1180{ 1181return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportsDynamicLibraries )) ; 1182} 1183 1184// property: supportsRenderDynamicLibraries 1185_MTL_INLINE bool MTL :: Device :: supportsRenderDynamicLibraries () const 1186{ 1187return 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{ 1193return 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{ 1199return 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{ 1205return 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{ 1211return 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{ 1217return 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{ 1223return 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{ 1229return Object :: sendMessage < MTL :: AccelerationStructure *> ( this , _MTL_PRIVATE_SEL ( newAccelerationStructureWithDescriptor_ ) , descriptor ) ; 1230} 1231 1232// property: supportsFunctionPointers 1233_MTL_INLINE bool MTL :: Device :: supportsFunctionPointers () const 1234{ 1235return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportsFunctionPointers )) ; 1236} 1237 1238// property: supportsFunctionPointersFromRender 1239_MTL_INLINE bool MTL :: Device :: supportsFunctionPointersFromRender () const 1240{ 1241return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportsFunctionPointersFromRender )) ; 1242} 1243 1244// property: supportsRaytracingFromRender 1245_MTL_INLINE bool MTL :: Device :: supportsRaytracingFromRender () const 1246{ 1247return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportsRaytracingFromRender )) ; 1248} 1249 1250// property: supportsPrimitiveMotionBlur 1251_MTL_INLINE bool MTL :: Device :: supportsPrimitiveMotionBlur () const 1252{ 1253return Object :: sendMessageSafe < bool > ( this , _MTL_PRIVATE_SEL ( supportsPrimitiveMotionBlur )) ; 1254}