Crate objc2_metal

Crate objc2_metal 

Source
Expand description

§Bindings to the Metal framework

See Apple’s docs and the general docs on framework crates for more information.

Metal has tools for validating that you’re using it correctly, using these is highly recommended! See Apple’s documentation on it, or run man MetalValidation to get information on environment variables.

NOTE: To use MTLCreateSystemDefaultDevice you need to link to CoreGraphics, this can be done by using objc2-core-graphics, or by doing:

#[link(name = "CoreGraphics", kind = "framework")]
extern "C" {}

§Safety considerations

Metal allows running arbitrary code on the GPU. We treat memory safety issues on the GPU as just as unsafe as that which applies to the CPU. A few notes on this below.

§Shaders

Shaders are (often) written in an unsafe C-like language.

Loading them (via MTLLibrary, function stitching etc.) is perfectly safe, it is similar to dynamic linking. The restrictions that e.g. libloading::Library::new labours under do not apply, since there are no ctors in the Metal Shading Language (see section 4.2).

Similarly, getting individual shaders (MTLFunction) is safe, we can model this as the same as calling dlsym (which just returns a pointer).

Calling functions though, is not safe. Even though they can have their parameter and return types checked at runtime, they may have additional restrictions not present in the signature (e.g. __builtin_unreachable() is possible in MSL, so is out-of-bounds accesses). If you view MTLFunction as essentially just an unsafe fn() pointer, this should be apparent.

§Bounds checks

It is yet unclear whether Metal APIs are bounds-checked on the CPU side or not, so APIs that take offsets / lengths are often unsafe.

§Synchronization

MTLResource subclasses such as MTLBuffer and MTLTexture require synchronization between the CPU and the GPU, or between different threads on the GPU itself, so APIs taking these are often unsafe.

§Memory management and lifetimes

Resources used in MTL4CommandBuffers or command buffers with created with one of:

  • MTLCommandBufferDescriptor::setRetainedReferences(false).
  • MTLCommandQueue::commandBufferWithUnretainedReferences().

Must be kept alive for as long as they’re used.

§Type safety

MTLBuffer is untyped (in a similar manner as a [u8] slice), you must ensure that any usage of it is done with valid types.

Structs§

MTL4AccelerationStructureBoundingBoxGeometryDescriptorMTL4AccelerationStructure
Describes bounding-box geometry suitable for ray tracing.
MTL4AccelerationStructureCurveGeometryDescriptorMTL4AccelerationStructure
Describes curve geometry suitable for ray tracing.
MTL4AccelerationStructureDescriptorMTL4AccelerationStructure and MTLAccelerationStructure
Base class for Metal 4 acceleration structure descriptors.
MTL4AccelerationStructureGeometryDescriptorMTL4AccelerationStructure
Base class for all Metal 4 acceleration structure geometry descriptors.
MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorMTL4AccelerationStructure
Describes motion bounding box geometry, suitable for motion ray tracing.
MTL4AccelerationStructureMotionCurveGeometryDescriptorMTL4AccelerationStructure
Describes motion curve geometry, suitable for motion ray tracing.
MTL4AccelerationStructureMotionTriangleGeometryDescriptorMTL4AccelerationStructure
Describes motion triangle geometry, suitable for motion ray tracing.
MTL4AccelerationStructureTriangleGeometryDescriptorMTL4AccelerationStructure
Describes triangle geometry suitable for ray tracing.
MTL4AlphaToCoverageStateMTL4PipelineState
Enumeration for controlling alpha-to-coverage state of a pipeline state object.
MTL4AlphaToOneStateMTL4PipelineState
Enumeration for controlling alpha-to-one state of a pipeline state object.
MTL4ArgumentTableDescriptorMTL4ArgumentTable
Groups parameters for the creation of a Metal argument table.
MTL4BinaryFunctionDescriptorMTL4BinaryFunctionDescriptor
Base interface for other function-derived interfaces.
MTL4BinaryFunctionOptionsMTL4BinaryFunctionDescriptor
Options for configuring the creation of binary functions.
MTL4BlendStateMTL4PipelineState
Enumeration for controlling the blend state of a pipeline state object.
MTL4BufferRangeMTL4BufferRange and MTLGPUAddress
A struct representing a range of a Metal buffer. The offset into the buffer is included in the address. The length is generally optional, which a value of (uint64_t)-1 representing the range from the given address to the end of the buffer. However, providing the length can enable more accurate API validation, especially when sub-allocating ranges of a buffer.
MTL4CommandAllocatorDescriptorMTL4CommandAllocator
Groups together parameters for creating a command allocator.
MTL4CommandBufferOptionsMTL4CommandBuffer
Options to configure a command buffer before encoding work into it.
MTL4CommandQueueDescriptorMTL4CommandQueue
Groups together parameters for the creation of a new command queue.
MTL4CommandQueueErrorMTL4CommandQueue
Enumeration of kinds of errors that committing an array of command buffers instances can produce.
MTL4CommitOptionsMTL4CommandQueue
Represents options to configure a commit operation on a command queue.
MTL4CompilerDescriptorMTL4Compiler
Groups together properties for creating a compiler context.
MTL4CompilerTaskOptionsMTL4Compiler
Apple’s documentation
MTL4CompilerTaskStatusMTL4CompilerTask
Represents the status of a compiler task.
MTL4ComputePipelineDescriptorMTL4ComputePipeline and MTL4PipelineState
Describes a compute pipeline state.
MTL4CopySparseBufferMappingOperationMTL4CommandQueue
Groups together arguments for an operation to copy a sparse buffer mapping.
MTL4CopySparseTextureMappingOperationMTL4CommandQueue and MTLTypes
Groups together arguments for an operation to copy a sparse texture mapping.
MTL4CounterHeapDescriptorMTL4Counters
Groups together parameters for configuring a counter heap object at creation time.
MTL4CounterHeapTypeMTL4Counters
Defines the type of a MTL4CounterHeap and the contents of its entries.
MTL4FunctionDescriptorMTL4FunctionDescriptor
Base interface for describing a Metal 4 shader function.
MTL4IndirectCommandBufferSupportStateMTL4PipelineState
Enumeration for controlling support for MTLIndirectCommandBuffer.
MTL4IndirectInstanceAccelerationStructureDescriptorMTL4AccelerationStructure and MTLAccelerationStructure
Descriptor for an “indirect” instance acceleration structure that allows providing the instance count and motion transform count indirectly, through buffer references.
MTL4InstanceAccelerationStructureDescriptorMTL4AccelerationStructure and MTLAccelerationStructure
Descriptor for an instance acceleration structure.
MTL4LibraryDescriptorMTL4LibraryDescriptor
Serves as the base descriptor for creating a Metal library.
MTL4LibraryFunctionDescriptorMTL4FunctionDescriptor and MTL4LibraryFunctionDescriptor
Describes a shader function from a Metal library.
MTL4LogicalToPhysicalColorAttachmentMappingStateMTL4RenderPipeline
Enumerates possible behaviors of how a pipeline maps its logical outputs to its color attachments.
MTL4MachineLearningPipelineDescriptorMTL4MachineLearningPipeline and MTL4PipelineState
Description for a machine learning pipeline state.
MTL4MachineLearningPipelineReflectionMTL4MachineLearningPipeline
Represents reflection information for a machine learning pipeline state.
MTL4MeshRenderPipelineDescriptorMTL4MeshRenderPipeline and MTL4PipelineState
Groups together properties you use to create a mesh render pipeline state object.
MTL4PipelineDataSetSerializerConfigurationMTL4PipelineDataSetSerializer
Configuration options for pipeline dataset serializer objects.
MTL4PipelineDataSetSerializerDescriptorMTL4PipelineDataSetSerializer
Groups together properties to create a pipeline data set serializer.
MTL4PipelineDescriptorMTL4PipelineState
Base type for descriptors you use for building pipeline state objects.
MTL4PipelineOptionsMTL4PipelineState
Provides options controlling how to compile a pipeline state.
MTL4PipelineStageDynamicLinkingDescriptorMTL4LinkingDescriptor
Groups together properties to drive the dynamic linking process of a pipeline stage.
MTL4PrimitiveAccelerationStructureDescriptorMTL4AccelerationStructure and MTLAccelerationStructure
Descriptor for a primitive acceleration structure that directly references geometric shapes, such as triangles and bounding boxes.
MTL4RenderEncoderOptionsMTL4RenderCommandEncoder
Custom render pass options you specify at encoder creation time.
MTL4RenderPassDescriptorMTL4RenderPass
Describes a render pass.
MTL4RenderPipelineBinaryFunctionsDescriptorMTL4RenderPipeline
Allows you to specify additional binary functions to link to each stage of a render pipeline.
MTL4RenderPipelineColorAttachmentDescriptorMTL4RenderPipeline
Apple’s documentation
MTL4RenderPipelineColorAttachmentDescriptorArrayMTL4RenderPipeline
An array of color attachment descriptions for a render pipeline.
MTL4RenderPipelineDescriptorMTL4PipelineState and MTL4RenderPipeline
Groups together properties to create a render pipeline state object.
MTL4RenderPipelineDynamicLinkingDescriptorMTL4LinkingDescriptor
Groups together properties that provide linking properties for render pipelines.
MTL4ShaderReflectionMTL4PipelineState
Option mask for requesting reflection information at pipeline build time.
MTL4SpecializedFunctionDescriptorMTL4FunctionDescriptor and MTL4SpecializedFunctionDescriptor
Groups together properties to configure and create a specialized function by passing it to a factory method.
MTL4StaticLinkingDescriptorMTL4LinkingDescriptor
Groups together properties to drive a static linking process.
MTL4StitchedFunctionDescriptorMTL4FunctionDescriptor and MTL4StitchedFunctionDescriptor
Groups together properties that describe a shader function suitable for stitching.
MTL4TileRenderPipelineDescriptorMTL4PipelineState and MTL4TileRenderPipeline
Groups together properties you use to create a tile render pipeline state object.
MTL4TimestampGranularityMTL4Counters
Provides a hint to the system about the desired accuracy when writing GPU counter timestamps.
MTL4TimestampHeapEntryMTL4Counters
Represents a timestamp data entry in a counter heap of type MTL4CounterHeapTypeTimestamp.
MTL4UpdateSparseBufferMappingOperationMTL4CommandQueue and MTLResourceStateCommandEncoder
Groups together arguments for an operation to update a sparse buffer mapping.
MTL4UpdateSparseTextureMappingOperationMTL4CommandQueue and MTLResourceStateCommandEncoder and MTLTypes
Groups together arguments for an operation to update a sparse texture mapping.
MTL4VisibilityOptionsMTL4CommandEncoder
Memory consistency options for synchronization commands.
MTLAccelerationStructureBoundingBoxGeometryDescriptorMTLAccelerationStructure
Descriptor for bounding box geometry
MTLAccelerationStructureCurveGeometryDescriptorMTLAccelerationStructure
Acceleration structure geometry descriptor describing geometry made of curve primitives
MTLAccelerationStructureDescriptorMTLAccelerationStructure
Base class for acceleration structure descriptors. Do not use this class directly. Use one of the derived classes instead.
MTLAccelerationStructureGeometryDescriptorMTLAccelerationStructure
Base class for all geometry descriptors. Do not use this class directly. Use one of the derived classes instead.
MTLAccelerationStructureInstanceDescriptorMTLAccelerationStructure and MTLAccelerationStructureTypes
Apple’s documentation
MTLAccelerationStructureInstanceDescriptorTypeMTLAccelerationStructure
Apple’s documentation
MTLAccelerationStructureInstanceOptionsMTLAccelerationStructure
Apple’s documentation
MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorMTLAccelerationStructure
Descriptor for motion bounding box geometry
MTLAccelerationStructureMotionCurveGeometryDescriptorMTLAccelerationStructure
Acceleration structure motion geometry descriptor describing geometry made of curve primitives
MTLAccelerationStructureMotionInstanceDescriptorMTLAccelerationStructure
Apple’s documentation
MTLAccelerationStructureMotionTriangleGeometryDescriptorMTLAccelerationStructure
Descriptor for motion triangle geometry
MTLAccelerationStructurePassDescriptorMTLAccelerationStructureCommandEncoder
MTLAccelerationStructurePassDescriptor represents a collection of attachments to be used to create a concrete acceleration structure encoder.
MTLAccelerationStructurePassSampleBufferAttachmentDescriptorMTLAccelerationStructureCommandEncoder
Apple’s documentation
MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayMTLAccelerationStructureCommandEncoder
Apple’s documentation
MTLAccelerationStructureRefitOptionsMTLAccelerationStructure
Controls the acceleration structure refit operation
MTLAccelerationStructureSizesMTLDevice
Describes the memory requirements for an acceleration structure
MTLAccelerationStructureTriangleGeometryDescriptorMTLAccelerationStructure
Descriptor for triangle geometry
MTLAccelerationStructureUsageMTLAccelerationStructure
Apple’s documentation
MTLAccelerationStructureUserIDInstanceDescriptorMTLAccelerationStructure and MTLAccelerationStructureTypes
Apple’s documentation
MTLArchitectureMTLDevice
Contains information about the device’s architecture
MTLArgumentDeprecatedMTLArgument
MTLArgument
MTLArgumentBuffersTierMTLDevice
MTLArgumentBuffersTier determines support level for argument buffers.
MTLArgumentDescriptorMTLDevice
Represents a member of an argument buffer
MTLArgumentTypeDeprecatedMTLArgument
The type for an input to a MTLRenderPipelineState or a MTLComputePipelineState
MTLArrayTypeMTLArgument
Apple’s documentation
MTLAttributeMTLLibrary
Apple’s documentation
MTLAttributeDescriptorMTLStageInputOutputDescriptor
Apple’s documentation
MTLAttributeDescriptorArrayMTLStageInputOutputDescriptor
Apple’s documentation
MTLAttributeFormatMTLStageInputOutputDescriptor
Apple’s documentation
MTLAxisAlignedBoundingBoxMTLAccelerationStructureTypes
An axis aligned bounding box with a min and max point
MTLBarrierScopeMTLCommandEncoder
Describes the types of resources that the a barrier operates on
MTLBinaryArchiveDescriptorMTLBinaryArchive
A class used to indicate how an archive should be created
MTLBinaryArchiveErrorMTLBinaryArchive
Apple’s documentation
MTLBindingAccessMTLArgument
Apple’s documentation
MTLBindingTypeMTLArgument
The type of a resource binding.
MTLBlendFactorMTLRenderPipeline
Apple’s documentation
MTLBlendOperationMTLRenderPipeline
Apple’s documentation
MTLBlitOptionMTLBlitCommandEncoder
Controls the blit operation
MTLBlitPassDescriptorMTLBlitPass
MTLBlitPassDescriptor represents a collection of attachments to be used to create a concrete blit command encoder
MTLBlitPassSampleBufferAttachmentDescriptorMTLBlitPass
Apple’s documentation
MTLBlitPassSampleBufferAttachmentDescriptorArrayMTLBlitPass
Apple’s documentation
MTLBufferLayoutDescriptorMTLStageInputOutputDescriptor
Apple’s documentation
MTLBufferLayoutDescriptorArrayMTLStageInputOutputDescriptor
Apple’s documentation
MTLBufferSparseTierMTLResource
Enumerates the different support levels for sparse buffers.
MTLCPUCacheModeMTLResource
Describes what CPU cache mode is used for the CPU’s mapping of a texture resource.
MTLCaptureDescriptorMTLCaptureManager
Apple’s documentation
MTLCaptureDestinationMTLCaptureManager
The destination where you want the GPU trace to be captured to.
MTLCaptureErrorMTLCaptureManager
Apple’s documentation
MTLCaptureManagerMTLCaptureManager
Apple’s documentation
MTLClearColorMTLRenderPass
Apple’s documentation
MTLColorWriteMaskMTLRenderPipeline
Apple’s documentation
MTLCommandBufferDescriptorMTLCommandBuffer
An object that you use to configure new Metal command buffer objects.
MTLCommandBufferErrorMTLCommandBuffer
Error codes that can be found in MTLCommandBuffer.error
MTLCommandBufferErrorOptionMTLCommandBuffer
Options for controlling the error reporting for Metal command buffer objects.
MTLCommandBufferStatusMTLCommandBuffer
MTLCommandBufferStatus reports the current stage in the lifetime of MTLCommandBuffer, as it proceeds to enqueued, committed, scheduled, and completed.
MTLCommandEncoderErrorStateMTLCommandBuffer
The error states for a Metal command encoder after command buffer execution.
MTLCommandQueueDescriptorMTLCommandQueue
Apple’s documentation
MTLCompareFunctionMTLDepthStencil
Apple’s documentation
MTLCompileOptionsMTLLibrary
Apple’s documentation
MTLCompileSymbolVisibilityMTLLibrary
Apple’s documentation
MTLComponentTransformMTLAccelerationStructureTypes
A transformation represented by individual components such as translation and rotation. The rotation is represented by a quaternion, allowing for correct motion interpolation.
MTLComputePassDescriptorMTLComputePass
MTLComputePassDescriptor represents a collection of attachments to be used to create a concrete compute command encoder
MTLComputePassSampleBufferAttachmentDescriptorMTLComputePass
Apple’s documentation
MTLComputePassSampleBufferAttachmentDescriptorArrayMTLComputePass
Apple’s documentation
MTLComputePipelineDescriptorMTLComputePipeline
Apple’s documentation
MTLComputePipelineReflectionMTLComputePipeline
Apple’s documentation
MTLCounterResultStageUtilizationMTLCounters
Apple’s documentation
MTLCounterResultStatisticMTLCounters
Apple’s documentation
MTLCounterResultTimestampMTLCounters
Apple’s documentation
MTLCounterSampleBufferDescriptorMTLCounters
Object to represent the counter state.
MTLCounterSampleBufferErrorMTLCounters
There wasn’t enough memory available to allocate the counter sample buffer.
MTLCounterSamplingPointMTLDevice
MTLCounterSamplingPoint determines type of sampling points that are supported on given device.
MTLCullModeMTLRenderCommandEncoder
Apple’s documentation
MTLCurveBasisMTLAccelerationStructure
Basis function to use to interpolate curve control points
MTLCurveEndCapsMTLAccelerationStructure
Type of end cap to insert at the beginning and end of each connected sequence of curve segments.
MTLCurveTypeMTLAccelerationStructure
Curve types
MTLDataTypeMTLDataType
An enumeration of the different data types in Metal.
MTLDepthClipModeMTLRenderCommandEncoder
Apple’s documentation
MTLDepthStencilDescriptorMTLDepthStencil
Apple’s documentation
MTLDeviceLocationMTLDevice
Specifies the location of the GPU on macOS
MTLDispatchThreadgroupsIndirectArgumentsMTLComputeCommandEncoder
Apple’s documentation
MTLDispatchThreadsIndirectArgumentsMTLComputeCommandEncoder
Apple’s documentation
MTLDispatchTypeMTLCommandBuffer
MTLDispatchType Describes how a command encoder will execute dispatched work.
MTLDrawIndexedPrimitivesIndirectArgumentsMTLRenderCommandEncoder
Apple’s documentation
MTLDrawPatchIndirectArgumentsMTLRenderCommandEncoder
Apple’s documentation
MTLDrawPrimitivesIndirectArgumentsMTLRenderCommandEncoder
Apple’s documentation
MTLDynamicLibraryErrorMTLDynamicLibrary
Apple’s documentation
MTLFeatureSetDeprecatedMTLDevice
Apple’s documentation
MTLFunctionConstantMTLLibrary
describe an uberShader constant used by the function
MTLFunctionConstantValuesMTLFunctionConstantValues
Apple’s documentation
MTLFunctionDescriptorMTLFunctionDescriptor
Apple’s documentation
MTLFunctionLogTypeMTLFunctionLog
Apple’s documentation
MTLFunctionOptionsMTLFunctionDescriptor
Apple’s documentation
MTLFunctionReflectionMTLLibrary
Represents a reflection object containing information about a function in a Metal library.
MTLFunctionStitchingAttributeAlwaysInlineMTLFunctionStitching
Applies the __attribute__((always_inline)) attribute to the produced stitched function.
MTLFunctionStitchingFunctionNodeMTLFunctionStitching
A function node that calls the specified function with arguments and ordering determined by data and control dependencies.
MTLFunctionStitchingGraphMTLFunctionStitching
A function graph that describes a directed acyclic graph.
MTLFunctionStitchingInputNodeMTLFunctionStitching
An indexed input node of the produced stitched function.
MTLFunctionTypeMTLLibrary
An identifier for a top-level Metal function.
MTLGPUFamilyMTLDevice
Apple’s documentation
MTLHazardTrackingModeMTLResource
Describes how hazard tracking is performed.
MTLHeapDescriptorMTLHeap
Apple’s documentation
MTLHeapTypeMTLHeap
Describes the mode of operation for an MTLHeap.
MTLIOCommandQueueDescriptorMTLIOCommandQueue
Represents a descriptor to create a MTLIOCommandQueue.
MTLIOCommandQueueTypeMTLIOCommandQueue
Apple’s documentation
MTLIOCompressionMethodMTLDevice
Apple’s documentation
MTLIOCompressionStatusMTLIOCompressor
Apple’s documentation
MTLIOErrorMTLIOCommandQueue
Apple’s documentation
MTLIOPriorityMTLIOCommandQueue
Apple’s documentation
MTLIOStatusMTLIOCommandBuffer
Apple’s documentation
MTLIndexTypeMTLArgument
Apple’s documentation
MTLIndirectAccelerationStructureInstanceDescriptorMTLAccelerationStructure and MTLAccelerationStructureTypes and MTLTypes
Apple’s documentation
MTLIndirectAccelerationStructureMotionInstanceDescriptorMTLAccelerationStructure and MTLTypes
Apple’s documentation
MTLIndirectCommandBufferDescriptorMTLIndirectCommandBuffer
Describes the limits and features that can be used in an indirect command
MTLIndirectCommandBufferExecutionRangeMTLIndirectCommandBuffer
The data layout required for specifying an indirect command buffer execution range.
MTLIndirectCommandTypeMTLIndirectCommandBuffer
A bitfield of commands that may be performed indirectly.
MTLIndirectInstanceAccelerationStructureDescriptorMTLAccelerationStructure
Descriptor for an instance acceleration structure built with an indirected buffer of instances.
MTLInstanceAccelerationStructureDescriptorMTLAccelerationStructure
Descriptor for an instance acceleration structure
MTLIntersectionFunctionBufferArgumentsMTLIntersectionFunctionTable
struct containing arguments for intersection function buffers.
MTLIntersectionFunctionDescriptorMTLFunctionDescriptor
Apple’s documentation
MTLIntersectionFunctionSignatureMTLIntersectionFunctionTable
Signature defining what data is provided to an intersection function. The signature must match across the shading language declaration of the intersection function table, intersection functions in the table, and the intersector using the table.
MTLIntersectionFunctionTableDescriptorMTLIntersectionFunctionTable
Apple’s documentation
MTLLanguageVersionMTLLibrary
Apple’s documentation
MTLLibraryErrorMTLLibrary
NSErrors raised when creating a library.
MTLLibraryOptimizationLevelMTLLibrary
Optimization level for the Metal compiler.
MTLLibraryTypeMTLLibrary
Apple’s documentation
MTLLinkedFunctionsMTLLinkedFunctions
A class to set functions to be linked.
MTLLoadActionMTLRenderPass
Apple’s documentation
MTLLogLevelMTLLogState
The level of the log entry.
MTLLogStateDescriptorMTLLogState
Apple’s documentation
MTLLogStateErrorMTLLogState
NSErrors raised when creating a logstate.
MTLLogicalToPhysicalColorAttachmentMapMTLRenderPipeline
Allows you to easily specify color attachment remapping from logical to physical indices.
MTLMapIndirectArgumentsMTLResourceStateCommandEncoder
Structure describing indirect mapping region. This structure is used to populate a buffer for the method ‘MTLResourceStateCommandEncoder updateTextureMapping:indirectBuffer:indirectBufferOffset:’
MTLMathFloatingPointFunctionsMTLLibrary
An enum to indicate the default math functions for single precision floating-point
MTLMathModeMTLLibrary
An enum to indicate if the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard
MTLMatrixLayoutMTLAccelerationStructure
Apple’s documentation
MTLMeshRenderPipelineDescriptorMTLRenderPipeline
As an alternative to a vertex + fragment shader render pipeline, this render pipeline uses a (object +) mesh + fragment shader for rendering geometry.
MTLMotionBorderModeMTLAccelerationStructure
Describes what happens to the object before the first motion key and after the last motion key.
MTLMotionKeyframeDataMTLAccelerationStructure
MTLbuffer and description how the data is stored in it.
MTLMultisampleDepthResolveFilterMTLRenderPass
Controls the MSAA depth resolve operation. Supported on iOS GPU Family 3 and later.
MTLMultisampleStencilResolveFilterMTLRenderPass
Controls the MSAA stencil resolve operation.
MTLMutabilityMTLPipeline
Specifies whether a buffer will be modified between the time it is bound and a compute or render pipeline is executed in a draw or dispatch.
MTLOriginMTLTypes
Identify a pixel in an image. MTLOrigin is ususally used as the upper-left corner of a region of a texture.
MTLPackedFloat3MTLAccelerationStructureTypes
MTLPackedFloat4x3MTLAccelerationStructureTypes
Apple’s documentation
MTLPackedFloatQuaternionMTLAccelerationStructureTypes
Apple’s documentation
MTLPatchTypeMTLLibrary
Apple’s documentation
MTLPipelineBufferDescriptorMTLPipeline
Apple’s documentation
MTLPipelineBufferDescriptorArrayMTLPipeline
Apple’s documentation
MTLPipelineOptionMTLDevice
Controls the creation of the pipeline
MTLPixelFormatMTLPixelFormat
Apple’s documentation
MTLPointerTypeMTLArgument
Apple’s documentation
MTLPrimitiveAccelerationStructureDescriptorMTLAccelerationStructure
Descriptor for a primitive acceleration structure
MTLPrimitiveTopologyClassMTLRenderPipeline
Apple’s documentation
MTLPrimitiveTypeMTLRenderCommandEncoder
Apple’s documentation
MTLPurgeableStateMTLResource
Options for setPurgeable call.
MTLQuadTessellationFactorsHalfMTLRenderCommandEncoder
Apple’s documentation
MTLRasterizationRateLayerArrayMTLRasterizationRate
Mutable array of MTLRasterizationRateLayerDescriptor
MTLRasterizationRateLayerDescriptorMTLRasterizationRate
Describes the minimum rasterization rate screen space using two piecewise linear functions.
MTLRasterizationRateMapDescriptorMTLRasterizationRate
Describes a MTLRasterizationRateMap containing an arbitrary number of MTLRasterizationRateLayerDescriptor instances.
MTLRasterizationRateSampleArrayMTLRasterizationRate
A helper object for convient access to samples stored in an array.
MTLReadWriteTextureTierMTLDevice
MTLReadWriteTextureTier determines support level for read-write texture formats.
MTLRegionMTLTypes
Identify a region in an image or texture.
MTLRenderPassAttachmentDescriptorMTLRenderPass
Apple’s documentation
MTLRenderPassColorAttachmentDescriptorMTLRenderPass
Apple’s documentation
MTLRenderPassColorAttachmentDescriptorArrayMTLRenderPass
Apple’s documentation
MTLRenderPassDepthAttachmentDescriptorMTLRenderPass
Apple’s documentation
MTLRenderPassDescriptorMTLRenderPass
MTLRenderPassDescriptor represents a collection of attachments to be used to create a concrete render command encoder
MTLRenderPassSampleBufferAttachmentDescriptorMTLRenderPass
Apple’s documentation
MTLRenderPassSampleBufferAttachmentDescriptorArrayMTLRenderPass
Apple’s documentation
MTLRenderPassStencilAttachmentDescriptorMTLRenderPass
Apple’s documentation
MTLRenderPipelineColorAttachmentDescriptorMTLRenderPipeline
Apple’s documentation
MTLRenderPipelineColorAttachmentDescriptorArrayMTLRenderPipeline
Apple’s documentation
MTLRenderPipelineDescriptorMTLRenderPipeline
Apple’s documentation
MTLRenderPipelineFunctionsDescriptorMTLRenderPipeline
Apple’s documentation
MTLRenderPipelineReflectionMTLRenderPipeline
Apple’s documentation
MTLRenderStagesMTLRenderCommandEncoder
Generic render stage enum
MTLResidencySetDescriptorMTLResidencySet
Specifies the parameters for MTLResidencySet creation.
MTLResourceIDMTLTypes
Handle of the GPU resource used for binding resources to argument tables, navigating resource view pools and storing resources in an argument buffer
MTLResourceOptionsMTLResource
Apple’s documentation
MTLResourceStatePassDescriptorMTLResourceStatePass
MTLResourceStatePassDescriptor represents a collection of attachments to be used to create a concrete resourceState command encoder
MTLResourceStatePassSampleBufferAttachmentDescriptorMTLResourceStatePass
Apple’s documentation
MTLResourceStatePassSampleBufferAttachmentDescriptorArrayMTLResourceStatePass
Apple’s documentation
MTLResourceUsageMTLCommandEncoder
Describes how a resource will be used by a shader through an argument buffer
MTLResourceViewPoolDescriptorMTLResourceViewPool
Provides parameters for creating a resource view pool.
MTLSamplePositionMTLTypes
Identify a sample within a pixel. Origin is top-left with a range [0,1) for both x and y.
MTLSamplerAddressModeMTLSampler
Options for what value is returned when a fetch falls outside the bounds of a texture.
MTLSamplerBorderColorMTLSampler
Specify the color value that will be clamped to when the sampler address mode is MTLSamplerAddressModeClampToBorderColor.
MTLSamplerDescriptorMTLSampler
A mutable descriptor used to configure a sampler. When complete, this can be used to create an immutable MTLSamplerState.
MTLSamplerMinMagFilterMTLSampler
Options for filtering texels within a mip level.
MTLSamplerMipFilterMTLSampler
Options for selecting and filtering between mipmap levels
MTLSamplerReductionModeMTLSampler
Configures how the sampler aggregates contributing samples to a final value.
MTLScissorRectMTLRenderCommandEncoder
Apple’s documentation
MTLShaderValidationMTLPipeline
Apple’s documentation
MTLSharedEventHandleMTLEvent
Apple’s documentation
MTLSharedEventListenerMTLEvent
This class provides a simple interface for handling the dispatching of MTLSharedEvent notifications from Metal.
MTLSharedTextureHandleMTLTexture
Apple’s documentation
MTLSizeMTLTypes
A set of dimensions to declare the size of an object, such as an image, texture, threadgroup, or grid.
MTLSizeAndAlignMTLDevice
Represent a memory size and alignment in bytes.
MTLSparsePageSizeMTLResource
Physical size of sparse resource page in KBs.
MTLSparseTextureMappingModeMTLResourceStateCommandEncoder
Type of mapping operation for sparse texture
MTLSparseTextureRegionAlignmentModeMTLDevice
MTLSparseTextureRegionAlignmentMode determines type of alignment used when converting from pixel region to tile region.
MTLStageInRegionIndirectArgumentsMTLComputeCommandEncoder
Apple’s documentation
MTLStageInputOutputDescriptorMTLStageInputOutputDescriptor
Apple’s documentation
MTLStagesMTLCommandEncoder
Describes stages of GPU work.
MTLStencilDescriptorMTLDepthStencil
Apple’s documentation
MTLStencilOperationMTLDepthStencil
Apple’s documentation
MTLStepFunctionMTLStageInputOutputDescriptor
Apple’s documentation
MTLStitchedLibraryDescriptorMTLFunctionStitching
A container for the graphs and functions needed to create the stitched functions described by the graphs.
MTLStitchedLibraryOptionsMTLFunctionStitching
A bitfield of options to create a stitched library
MTLStorageModeMTLResource
Describes location and CPU mapping of MTLTexture.
MTLStoreActionMTLRenderPass
Apple’s documentation
MTLStoreActionOptionsMTLRenderPass
Apple’s documentation
MTLStructMemberMTLArgument
Apple’s documentation
MTLStructTypeMTLArgument
Apple’s documentation
MTLTensorDataTypeMTLTensor
The possible data types for the elements of a tensor.
MTLTensorDescriptorMTLTensor
A configuration type for creating new tensor instances.
MTLTensorErrorMTLTensor
The error codes that Metal can raise when you create a tensor.
MTLTensorExtentsMTLTensor
An array of length matching the rank, holding the dimensions of a tensor.
MTLTensorReferenceTypeMTLArgument
An object that represents a tensor in the shading language in a struct or array.
MTLTensorUsageMTLTensor
The type that represents the different contexts for a tensor.
MTLTessellationControlPointIndexTypeMTLRenderPipeline
Apple’s documentation
MTLTessellationFactorFormatMTLRenderPipeline
Apple’s documentation
MTLTessellationFactorStepFunctionMTLRenderPipeline
Apple’s documentation
MTLTessellationPartitionModeMTLRenderPipeline
Apple’s documentation
MTLTextureCompressionTypeMTLTexture
Apple’s documentation
MTLTextureDescriptorMTLTexture
Apple’s documentation
MTLTextureReferenceTypeMTLArgument
Apple’s documentation
MTLTextureSparseTierMTLResource
Enumerates the different support levels for sparse textures.
MTLTextureSwizzleMTLTexture
Apple’s documentation
MTLTextureSwizzleChannelsMTLTexture
Apple’s documentation
MTLTextureTypeMTLTexture
MTLTextureType describes the dimensionality of each image, and if multiple images are arranged into an array or cube.
MTLTextureUsageMTLTexture
MTLTextureUsage declares how the texture will be used over its lifetime (bitwise OR for multiple uses).
MTLTextureViewDescriptorMTLTexture
Apple’s documentation
MTLTileRenderPipelineColorAttachmentDescriptorMTLRenderPipeline
Apple’s documentation
MTLTileRenderPipelineColorAttachmentDescriptorArrayMTLRenderPipeline
Apple’s documentation
MTLTileRenderPipelineDescriptorMTLRenderPipeline
Apple’s documentation
MTLTransformTypeMTLAccelerationStructure
Apple’s documentation
MTLTriangleFillModeMTLRenderCommandEncoder
Apple’s documentation
MTLTriangleTessellationFactorsHalfMTLRenderCommandEncoder
Apple’s documentation
MTLTypeMTLArgument
Apple’s documentation
MTLVertexAmplificationViewMappingMTLRenderCommandEncoder
Apple’s documentation
MTLVertexAttributeMTLLibrary
Apple’s documentation
MTLVertexAttributeDescriptorMTLVertexDescriptor
Apple’s documentation
MTLVertexAttributeDescriptorArrayMTLVertexDescriptor
Apple’s documentation
MTLVertexBufferLayoutDescriptorMTLVertexDescriptor
Apple’s documentation
MTLVertexBufferLayoutDescriptorArrayMTLVertexDescriptor
Apple’s documentation
MTLVertexDescriptorMTLVertexDescriptor
Apple’s documentation
MTLVertexFormatMTLVertexDescriptor
specifies how the vertex attribute data is laid out in memory.
MTLVertexStepFunctionMTLVertexDescriptor
Apple’s documentation
MTLViewportMTLRenderCommandEncoder
Apple’s documentation
MTLVisibilityResultModeMTLRenderCommandEncoder
Apple’s documentation
MTLVisibilityResultTypeMTLRenderPass
This enumeration controls if Metal accumulates visibility results between render encoders or resets them.
MTLVisibleFunctionTableDescriptorMTLVisibleFunctionTable
Apple’s documentation
MTLWindingMTLRenderCommandEncoder
Apple’s documentation

Constants§

MTLCounterDontSampleMTLCounters
MTLCounterErrorValueMTLCounters
MTLResourceCPUCacheModeMaskMTLResource
MTLResourceCPUCacheModeShiftMTLResource
MTLResourceHazardTrackingModeMaskMTLResource
MTLResourceHazardTrackingModeShiftMTLResource
MTLResourceStorageModeMaskMTLResource
MTLResourceStorageModeShiftMTLResource
MTLTextureSwizzleChannelsDefaultMTLTexture

Statics§

MTL4CommandQueueErrorDomainMTL4CommandQueue
Apple’s documentation
MTLAttributeStrideStaticMTLArgumentEncoder
Apple’s documentation
MTLBinaryArchiveDomainMTLBinaryArchive
Apple’s documentation
MTLBufferLayoutStrideDynamicMTLVertexDescriptor
when a MTLVertexBufferLayoutDescriptor has its stride set to this value, the stride will be dynamic and must be set explicitly when binding a buffer to a render command encoder.
MTLCaptureErrorDomainMTLCaptureManager
Apple’s documentation
MTLCommandBufferEncoderInfoErrorKeyMTLCommandBuffer
Key in the userInfo for MTLCommandBufferError NSErrors. Value is an NSArray of MTLCommandBufferEncoderInfo objects in recorded order if an appropriate MTLCommandBufferErrorOption was set, otherwise the key will not exist in the userInfo dictionary.
MTLCommandBufferErrorDomainMTLCommandBuffer
An error domain for NSError objects produced by MTLCommandBuffer
MTLCommonCounterClipperInvocationsMTLCounters
Apple’s documentation
MTLCommonCounterClipperPrimitivesOutMTLCounters
Apple’s documentation
MTLCommonCounterComputeKernelInvocationsMTLCounters
Apple’s documentation
MTLCommonCounterFragmentCyclesMTLCounters
Apple’s documentation
MTLCommonCounterFragmentInvocationsMTLCounters
Apple’s documentation
MTLCommonCounterFragmentsPassedMTLCounters
Apple’s documentation
MTLCommonCounterPostTessellationVertexCyclesMTLCounters
Apple’s documentation
MTLCommonCounterPostTessellationVertexInvocationsMTLCounters
Apple’s documentation
MTLCommonCounterRenderTargetWriteCyclesMTLCounters
Apple’s documentation
MTLCommonCounterSetStageUtilizationMTLCounters
Apple’s documentation
MTLCommonCounterSetStatisticMTLCounters
Apple’s documentation
MTLCommonCounterSetTimestampMTLCounters
Apple’s documentation
MTLCommonCounterTessellationCyclesMTLCounters
Apple’s documentation
MTLCommonCounterTessellationInputPatchesMTLCounters
Apple’s documentation
MTLCommonCounterTimestampMTLCounters
Apple’s documentation
MTLCommonCounterTotalCyclesMTLCounters
Apple’s documentation
MTLCommonCounterVertexCyclesMTLCounters
Apple’s documentation
MTLCommonCounterVertexInvocationsMTLCounters
Apple’s documentation
MTLCounterErrorDomainMTLCounters
NSErrors raised when creating a counter sample buffer.
MTLDeviceRemovalRequestedNotificationMTLDevice
This notification is posted when the user has requested that applications cease using a particular device. Applications should assume that the device will be removed (terminated) imminently. Additionally, the device will be removed from the internal device array prior to this notification being posted. Applications should immediately begin the process of releasing all resources created on the given device, as well as any references to the device itself.
MTLDeviceWasAddedNotificationMTLDevice
This notification is posted when a new Metal device is added to the system
MTLDeviceWasRemovedNotificationMTLDevice
This notification is posted if the device is removed while there are still outstanding references to it, due to either a surprise or forced disconnect by the user. Applications must expect that any attempt to use the device after this point will fail.
MTLDynamicLibraryDomainMTLDynamicLibrary
Apple’s documentation
MTLIOErrorDomainMTLIOCommandQueue
Apple’s documentation
MTLLibraryErrorDomainMTLLibrary
NSErrors raised when creating a library.
MTLLogStateErrorDomainMTLLogState
Apple’s documentation
MTLTensorDomainMTLTensor
An error domain for errors that pertain to creating a tensor.
NSDeviceCertificationiPhonePerformanceGamingMTLDeviceCertification
Apple’s documentation
NSProcessInfoPerformanceProfileDidChangeNotificationMTLDeviceCertification
Apple’s documentation
NSProcessPerformanceProfileDefaultMTLDeviceCertification
Apple’s documentation
NSProcessPerformanceProfileSustainedMTLDeviceCertification
Apple’s documentation

Traits§

MTL4ArchiveMTL4Archive
A read-only container that stores pipeline states from a shader compiler.
MTL4ArgumentTableMTL4ArgumentTable
Provides a mechanism to manage and provide resource bindings for buffers, textures, sampler states and other Metal resources.
MTL4BinaryFunctionMTL4BinaryFunction
Represents a binary function.
MTL4CommandAllocatorMTL4CommandAllocator
Manages the memory backing the encoding of GPU commands into command buffers.
MTL4CommandBufferMTL4CommandBuffer
Records a sequence of GPU commands.
MTL4CommandEncoderMTL4CommandEncoder
An encoder that writes GPU commands into a command buffer.
MTL4CommandQueueMTL4CommandQueue
An abstraction representing a command queue that you use commit and synchronize command buffers and to perform other GPU operations.
MTL4CommitFeedbackMTL4CommitFeedback
Describes an object containing debug information from Metal to your app after completing a workload.
MTL4CompilerMTL4Compiler
A abstraction for a pipeline state and shader function compiler.
MTL4CompilerTaskMTL4CompilerTask
A reference to an asynchronous compilation task that you initiate from a compiler instance.
MTL4ComputeCommandEncoderMTL4CommandEncoder and MTL4ComputeCommandEncoder
Encodes a compute pass and other memory operations into a command buffer.
MTL4CounterHeapMTL4Counters
Represents an opaque, driver-controlled section of memory that can store GPU counter data.
MTL4MachineLearningCommandEncoderMTL4CommandEncoder and MTL4MachineLearningCommandEncoder
Encodes commands for dispatching machine learning networks on Apple silicon.
MTL4MachineLearningPipelineStateMTL4MachineLearningPipeline and MTLAllocation
A pipeline state that you can use with machine-learning encoder instances.
MTL4PipelineDataSetSerializerMTL4PipelineDataSetSerializer
A fast-addition container for collecting data during pipeline state creation.
MTL4RenderCommandEncoderMTL4CommandEncoder and MTL4RenderCommandEncoder
Encodes a render pass into a command buffer, including all its draw calls and configuration.
MTLAccelerationStructureMTLAccelerationStructure and MTLAllocation and MTLResource
Apple’s documentation
MTLAccelerationStructureCommandEncoderMTLAccelerationStructureCommandEncoder and MTLCommandEncoder
Apple’s documentation
MTLAllocationMTLAllocation
Base class for Metal allocations.
MTLArgumentEncoderMTLArgumentEncoder
MTLArgumentEncoder encodes buffer, texture, sampler, and constant data into a buffer.
MTLBinaryArchiveMTLBinaryArchive
A container of pipeline state descriptors and their associated compiled code.
MTLBindingMTLArgument
Apple’s documentation
MTLBlitCommandEncoderMTLBlitCommandEncoder and MTLCommandEncoder
A command encoder that performs basic copies and blits between buffers and textures.
MTLBufferMTLAllocation and MTLBuffer and MTLResource
A typeless allocation accessible by both the CPU and the GPU (MTLDevice) or by only the GPU when the storage mode is MTLResourceStorageModePrivate.
MTLBufferBindingMTLArgument
Apple’s documentation
MTLCaptureScopeMTLCaptureScope
Apple’s documentation
MTLCommandBufferMTLCommandBuffer
A serial list of commands for the device to execute.
MTLCommandBufferEncoderInfoMTLCommandBuffer
Provides execution status information for a Metal command encoder.
MTLCommandEncoderMTLCommandEncoder
MTLCommandEncoder is the common interface for objects that write commands into MTLCommandBuffers.
MTLCommandQueueMTLCommandQueue
A serial queue of command buffers to be executed by the device.
MTLComputeCommandEncoderMTLCommandEncoder and MTLComputeCommandEncoder
A command encoder that writes data parallel compute commands.
MTLComputePipelineStateMTLAllocation and MTLComputePipeline
A handle to compiled code for a compute function.
MTLCounterMTLCounters
A descriptor for a single counter.
MTLCounterSampleBufferMTLCounters
The Counter Sample Buffer contains opaque counter samples as well as state needed to request a sample from the API.
MTLCounterSetMTLCounters
A collection of MTLCounters that the device can capture in a single pass.
MTLDepthStencilStateMTLDepthStencil
Apple’s documentation
MTLDeviceMTLDevice
MTLDevice represents a processor capable of data parallel computations
MTLDrawableMTLDrawable
All “drawable” objects (such as those coming from CAMetalLayer) are expected to conform to this protocol
MTLDynamicLibraryMTLDynamicLibrary
A container for the binary representation of code compiled for a MTLDevice.
MTLEventMTLEvent
Apple’s documentation
MTLFenceMTLFence
Apple’s documentation
MTLFunctionMTLLibrary
A handle to intermediate code used as inputs for either a MTLComputePipelineState or a MTLRenderPipelineState.
MTLFunctionHandleMTLFunctionHandle
Apple’s documentation
MTLFunctionLogMTLFunctionLog
Apple’s documentation
MTLFunctionLogDebugLocationMTLFunctionLog
Apple’s documentation
MTLFunctionStitchingAttributeMTLFunctionStitching
An attribute to be applied to the produced stitched function.
MTLFunctionStitchingNodeMTLFunctionStitching
A node used in a graph for stitching.
MTLHeapMTLAllocation and MTLHeap
Apple’s documentation
MTLIOCommandBufferMTLIOCommandBuffer
represents a list of IO commands for a queue to execute
MTLIOCommandQueueMTLIOCommandQueue
Represents a queue that schedules command buffers containing command that read from handle objects and write to MTLResource objects.
MTLIOFileHandleMTLIOCommandQueue
Represents a file (raw or compressed) that can be used as a source for load commands encoded in a MTLIOCommandBuffer.
MTLIOScratchBufferMTLIOCommandQueue
An extendible protocol that can be used to wrap the buffers vended by a custom allocator. The underlying buffer is used as scratch space for IO commands that need it.
MTLIOScratchBufferAllocatorMTLIOCommandQueue
An extendible protocol that can implement a custom allocator passed to the queue descriptor.
MTLIndirectCommandBufferMTLAllocation and MTLIndirectCommandBuffer and MTLResource
Apple’s documentation
MTLIndirectComputeCommandMTLIndirectCommandEncoder
Apple’s documentation
MTLIndirectRenderCommandMTLIndirectCommandEncoder
Apple’s documentation
MTLIntersectionFunctionTableMTLAllocation and MTLIntersectionFunctionTable and MTLResource
Apple’s documentation
MTLLibraryMTLLibrary
Apple’s documentation
MTLLogContainerMTLFunctionLog
Apple’s documentation
MTLLogStateMTLLogState
Apple’s documentation
MTLObjectPayloadBindingMTLArgument
Apple’s documentation
MTLParallelRenderCommandEncoderMTLCommandEncoder and MTLParallelRenderCommandEncoder
The MTLParallelRenderCommandEncoder protocol is designed to allow a single render to texture operation to be efficiently (and safely) broken up across multiple threads.
MTLRasterizationRateMapMTLRasterizationRate
Compiled read-only object that determines how variable rasterization rate is applied when rendering.
MTLRenderCommandEncoderMTLCommandEncoder and MTLRenderCommandEncoder
MTLRenderCommandEncoder is a container for graphics rendering state and the code to translate the state into a command format that the device can execute.
MTLRenderCommandEncoderSliceExtMTLRenderCommandEncoder and MTLCommandEncoder
MTLRenderPipelineStateMTLAllocation and MTLRenderPipeline
MTLRenderPipelineState represents a compiled render pipeline
MTLResidencySetMTLResidencySet
A residency set is responsible for managing resource and heap residency and is referenced by a command buffer or command queue in order to ensure that resources and heaps are resident. Resources and heaps are added and removed uncommitted and a subsequent commit call applies all of the changes in bulk.
MTLResourceMTLAllocation and MTLResource
Common APIs available for MTLBuffer and MTLTexture instances
MTLResourceStateCommandEncoderMTLCommandEncoder and MTLResourceStateCommandEncoder
Apple’s documentation
MTLResourceViewPoolMTLResourceViewPool
Contains views over resources of a specific type, and allows you to manage those views.
MTLSamplerStateMTLSampler
An immutable collection of sampler state compiled for a single device.
MTLSharedEventMTLEvent
Apple’s documentation
MTLTensorMTLAllocation and MTLResource and MTLTensor
A resource representing a multi-dimensional array that you can use with machine learning workloads.
MTLTensorBindingMTLArgument
An object that represents a tensor bound to a graphics or compute function or a machine learning function.
MTLTextureMTLAllocation and MTLResource and MTLTexture
MTLTexture represents a collection of 1D, 2D, or 3D images.
MTLTextureBindingMTLArgument
Apple’s documentation
MTLTextureViewPoolMTLResourceViewPool and MTLTextureViewPool
A pool of lightweight texture views.
MTLThreadgroupBindingMTLArgument
Apple’s documentation
MTLVisibleFunctionTableMTLAllocation and MTLResource and MTLVisibleFunctionTable
Apple’s documentation
NSProcessInfoNSDeviceCertificationMTLDeviceCertification
Category “NSDeviceCertification” on NSProcessInfo.

Functions§

MTLCopyAllDevicesMTLDevice
Returns all Metal devices in the system.
MTLCopyAllDevicesWithObserverMTLDevice and block2
Returns an NSArray of the current set of available Metal devices and installs a notification handler to be notified of any further changes (additions, removals, etc.). The observer return value is retained by Metal and may be passed to MTLRemoveDeviceObserver() if the application no longer wishes to receive notifications.
MTLCreateSystemDefaultDeviceMTLDevice
Returns a reference to the preferred system default Metal device.
MTLIOCompressionContextAppendDataMTLIOCompressor
Safety
MTLIOCompressionContextDefaultChunkSizeMTLIOCompressor
MTLIOCreateCompressionContextMTLDevice and MTLIOCompressor
Safety
MTLIOFlushAndDestroyCompressionContextMTLIOCompressor
Safety
MTLRemoveDeviceObserverMTLDevice
Removes a previously installed observer for device change notifications.

Type Aliases§

MTL4CommitFeedbackHandlerMTL4CommitFeedback and block2
Defines the block signature for a callback Metal invokes to provide your app feedback after completing a workload.
MTL4NewBinaryFunctionCompletionHandlerMTL4BinaryFunction and MTL4Compiler and block2
Provides a signature for a callback block that Metal calls when the compiler finishes a build task for a binary function.
MTL4NewMachineLearningPipelineStateCompletionHandlerMTL4Compiler and MTL4MachineLearningPipeline and MTLAllocation and block2
Provides a signature for a callback block that Metal calls when the compiler finishes a build task for a machine learning pipeline state.
MTLArgumentAccessDeprecatedMTLArgument
Apple’s documentation
MTLAutoreleasedArgumentDeprecatedMTLArgument and MTLLibrary
Apple’s documentation
MTLAutoreleasedComputePipelineReflectionMTLComputePipeline and MTLLibrary
Apple’s documentation
MTLAutoreleasedRenderPipelineReflectionMTLLibrary and MTLRenderPipeline
Apple’s documentation
MTLCommandBufferHandlerMTLCommandBuffer and block2
Apple’s documentation
MTLCommonCounterMTLCounters
Common counters that, when present, are expected to have similar meanings across different implementations.
MTLCommonCounterSetMTLCounters
Common counter set names.
MTLCoordinate2DMTLTypes
A floating point coordinate in an abstract 2D space. Refer to location of use for concrete information on the space in which the coordinate exists.
MTLDeviceNotificationHandlerMTLDevice and block2
Block signature for device notifications
MTLDeviceNotificationNameMTLDevice
Type for device notifications
MTLDrawablePresentedHandlerMTLDrawable and block2
The presented callback function protocol
MTLGPUAddressMTLGPUAddress
A 64-bit unsigned integer type appropriate for storing GPU addresses.
MTLIOCommandBufferHandlerMTLIOCommandBuffer and block2
Apple’s documentation
MTLIOCompressionContextMTLIOCompressor
Apple’s documentation
MTLNewComputePipelineStateCompletionHandlerMTLAllocation and MTLComputePipeline and MTLLibrary and block2
Apple’s documentation
MTLNewComputePipelineStateWithReflectionCompletionHandlerMTLAllocation and MTLComputePipeline and MTLLibrary and block2
Apple’s documentation
MTLNewDynamicLibraryCompletionHandlerMTLDynamicLibrary and MTLLibrary and block2
Apple’s documentation
MTLNewLibraryCompletionHandlerMTLLibrary and block2
Apple’s documentation
MTLNewRenderPipelineStateCompletionHandlerMTLAllocation and MTLLibrary and MTLRenderPipeline and block2
Apple’s documentation
MTLNewRenderPipelineStateWithReflectionCompletionHandlerMTLAllocation and MTLLibrary and MTLRenderPipeline and block2
Apple’s documentation
MTLSharedEventNotificationBlockMTLEvent and block2
Apple’s documentation
MTLTimestampMTLDevice
Apple’s documentation
NSDeviceCertificationMTLDeviceCertification
Apple’s documentation
NSProcessPerformanceProfileMTLDeviceCertification
Apple’s documentation