MTLDevice

The main Metal interface to a GPU that apps use to draw graphics and run computations in parallel.

Members

Functions

argumentBuffersSupport
MTLArgumentBuffersTier argumentBuffersSupport()

Returns the GPU device’s support tier for argument buffers.

minimumTextureBufferAlignmentForPixelFormat
NSUInteger minimumTextureBufferAlignmentForPixelFormat(MTLPixelFormat )

Returns the minimum alignment the GPU device requires to create a texture buffer from a buffer.

name
NSString name()

The full name of the GPU device.

newBuffer
MTLBuffer newBuffer(NSUInteger length, MTLResourceOptions options)

Creates a buffer the method clears with zero values, length is size in bytes.

newBuffer
MTLBuffer newBuffer(const(void)* pointer, NSUInteger length, MTLResourceOptions options)

Allocates a new buffer of a given length and initializes its contents by copying existing data into it.

newCommandQueue
MTLCommandQueue newCommandQueue()

Creates a queue you use to submit rendering and computation commands to a GPU.

newCommandQueue
MTLCommandQueue newCommandQueue(NSUInteger maxCommandBufferCount)

Creates a queue you use to submit rendering and computation commands to a GPU that has a fixed number of uncompleted command buffers.

newDefaultLibrary
MTLLibrary newDefaultLibrary()

Creates a Metal library instance that contains the functions from your app’s default Metal library.

newDepthStencilStateWithDescriptor
MTLDepthStencilState newDepthStencilStateWithDescriptor(MTLDepthStencilDescriptor )

Creates a depth-stencil state instance.

newFence
MTLFence newFence()

Creates a new memory fence instance.

newIOCommandQueueWithDescriptor
MTLIOCommandQueue newIOCommandQueueWithDescriptor(MTLIOCommandQueueDescriptor descriptor, NSError* error)

Creates an input/output command queue you use to submit commands that load assets from the file system into GPU resources or system memory.

newLibraryWithSource
MTLLibrary newLibraryWithSource(NSString source, MTLCompileOptions options, NSError* error)

Synchronously creates a Metal library instance by compiling the functions in a source string.

newRenderPipelineStateWithDescriptor
MTLRenderPipelineState newRenderPipelineStateWithDescriptor(MTLRenderPipelineDescriptor descriptor, NSError* error)

Synchronously creates a render pipeline state.

newSamplerStateWithDescriptor
MTLSamplerState newSamplerStateWithDescriptor(MTLSamplerDescriptor descriptor)

Creates a sampler state instance.

newTextureWithDescriptor
MTLTexture newTextureWithDescriptor(MTLTextureDescriptor descriptor)

Creates a new texture instance.

supportsFamily
BOOL supportsFamily(MTLGPUFamily )

Returns a Boolean value that indicates whether the GPU device supports the feature set of a specific GPU family.

supportsTextureSampleCount
BOOL supportsTextureSampleCount(NSUInteger sampleCount)

Returns a Boolean value that indicates whether the GPU can sample a texture with a specific number of sample points.

Meta