Interface MTLDevice


  • public interface MTLDevice
    [@protocol] MTLDevice MTLDevice represents a processor capable of data parallel computations API-Since: 8.0
    • Method Detail

      • heapBufferSizeAndAlignWithLengthOptions

        MTLSizeAndAlign heapBufferSizeAndAlignWithLengthOptions​(long length,
                                                                long options)
        heapBufferSizeAndAlignWithLength:options: Determine the byte size of buffers when sub-allocated from a heap. This method can be used to help determine the required heap size. API-Since: 10.0
      • heapTextureSizeAndAlignWithDescriptor

        MTLSizeAndAlign heapTextureSizeAndAlignWithDescriptor​(@NotNull
                                                              @NotNull MTLTextureDescriptor desc)
        heapTextureSizeAndAlignWithDescriptor: Determine the byte size of textures when sub-allocated from a heap. This method can be used to help determine the required heap size. API-Since: 10.0
      • maxThreadsPerThreadgroup

        MTLSize maxThreadsPerThreadgroup()
        [@property] maxThreadsPerThreadgroup The maximum number of threads along each dimension. API-Since: 9.0
      • name

        @NotNull
        @NotNull java.lang.String name()
        [@property] name The full name of the vendor device.
      • newBufferWithBytesLengthOptions

        @Nullable
        @Nullable MTLBuffer newBufferWithBytesLengthOptions​(@NotNull
                                                            @NotNull org.moe.natj.general.ptr.ConstVoidPtr pointer,
                                                            long length,
                                                            long options)
        newBufferWithBytes:length:options: Create a buffer by allocating new memory and specifing the initial contents to be copied into it.
      • newBufferWithBytesNoCopyLengthOptionsDeallocator

        @Nullable
        @Nullable MTLBuffer newBufferWithBytesNoCopyLengthOptionsDeallocator​(@NotNull
                                                                             @NotNull org.moe.natj.general.ptr.VoidPtr pointer,
                                                                             long length,
                                                                             long options,
                                                                             @Nullable
                                                                             @Nullable MTLDevice.Block_newBufferWithBytesNoCopyLengthOptionsDeallocator deallocator)
        newBufferWithBytesNoCopy:length:options:deallocator: Create a buffer by wrapping an existing part of the address space.
      • newBufferWithLengthOptions

        @Nullable
        @Nullable MTLBuffer newBufferWithLengthOptions​(long length,
                                                       long options)
        newBufferWithLength:options: Create a buffer by allocating new memory.
      • newCommandQueue

        @Nullable
        @Nullable MTLCommandQueue newCommandQueue()
        newCommandQueue Create and return a new command queue. Command Queues created via this method will only allow up to 64 non-completed command buffers.
        Returns:
        The new command queue object
      • newCommandQueueWithMaxCommandBufferCount

        @Nullable
        @Nullable MTLCommandQueue newCommandQueueWithMaxCommandBufferCount​(long maxCommandBufferCount)
        newCommandQueueWithMaxCommandBufferCount Create and return a new command queue with a given upper bound on non-completed command buffers.
        Returns:
        The new command queue object
      • newComputePipelineStateWithDescriptorOptionsReflectionError

        @Nullable
        @Nullable MTLComputePipelineState newComputePipelineStateWithDescriptorOptionsReflectionError​(@NotNull
                                                                                                      @NotNull MTLComputePipelineDescriptor descriptor,
                                                                                                      long options,
                                                                                                      @Nullable
                                                                                                      @Nullable org.moe.natj.general.ptr.Ptr<MTLComputePipelineReflection> reflection,
                                                                                                      @Nullable
                                                                                                      @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newComputePipelineStateWithDescriptor:options:reflection:error: Create and compile a new MTLComputePipelineState object synchronously. API-Since: 9.0
      • newComputePipelineStateWithFunctionCompletionHandler

        void newComputePipelineStateWithFunctionCompletionHandler​(@NotNull
                                                                  @NotNull MTLFunction computeFunction,
                                                                  @NotNull
                                                                  @NotNull MTLDevice.Block_newComputePipelineStateWithFunctionCompletionHandler completionHandler)
        newComputePipelineStateWithDescriptor:completionHandler: Create and compile a new MTLComputePipelineState object asynchronously.
      • newComputePipelineStateWithFunctionError

        @Nullable
        @Nullable MTLComputePipelineState newComputePipelineStateWithFunctionError​(@NotNull
                                                                                   @NotNull MTLFunction computeFunction,
                                                                                   @Nullable
                                                                                   @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newComputePipelineStateWithDescriptor:error: Create and compile a new MTLComputePipelineState object synchronously.
      • newComputePipelineStateWithFunctionOptionsCompletionHandler

        void newComputePipelineStateWithFunctionOptionsCompletionHandler​(@NotNull
                                                                         @NotNull MTLFunction computeFunction,
                                                                         long options,
                                                                         @NotNull
                                                                         @NotNull MTLDevice.Block_newComputePipelineStateWithFunctionOptionsCompletionHandler completionHandler)
        newComputePipelineStateWithDescriptor:options:completionHandler: Create and compile a new MTLComputePipelineState object asynchronously.
      • newComputePipelineStateWithFunctionOptionsReflectionError

        @Nullable
        @Nullable MTLComputePipelineState newComputePipelineStateWithFunctionOptionsReflectionError​(@NotNull
                                                                                                    @NotNull MTLFunction computeFunction,
                                                                                                    long options,
                                                                                                    @Nullable
                                                                                                    @Nullable org.moe.natj.general.ptr.Ptr<MTLComputePipelineReflection> reflection,
                                                                                                    @Nullable
                                                                                                    @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newComputePipelineStateWithDescriptor:options:reflection:error: Create and compile a new MTLComputePipelineState object synchronously.
      • newDefaultLibrary

        @Nullable
        @Nullable MTLLibrary newDefaultLibrary()
        newDefaultLibrary Returns the default library for the main bundle. use newDefaultLibraryWithBundle:error: to get an NSError in case of failure.
      • newDefaultLibraryWithBundleError

        @Nullable
        @Nullable MTLLibrary newDefaultLibraryWithBundleError​(@NotNull
                                                              @NotNull NSBundle bundle,
                                                              @Nullable
                                                              @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newDefaultLibraryWithBundle:error: Returns the default library for a given bundle.
        Returns:
        A pointer to the library, nil if an error occurs. API-Since: 10.0
      • newDepthStencilStateWithDescriptor

        @Nullable
        @Nullable MTLDepthStencilState newDepthStencilStateWithDescriptor​(@NotNull
                                                                          @NotNull MTLDepthStencilDescriptor descriptor)
        newDepthStencilStateWithDescriptor: Create a depth/stencil test state object.
      • newFence

        @Nullable
        @Nullable MTLFence newFence()
        newFence Create a new MTLFence object API-Since: 10.0
      • newHeapWithDescriptor

        @Nullable
        @Nullable MTLHeap newHeapWithDescriptor​(@NotNull
                                                @NotNull MTLHeapDescriptor descriptor)
        newHeapWithDescriptor: Create a new heap with the given descriptor. API-Since: 10.0
      • newLibraryWithDataError

        @Nullable
        @Nullable MTLLibrary newLibraryWithDataError​(@NotNull
                                                     @NotNull dispatch_data_t data,
                                                     @Nullable
                                                     @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newLibraryWithData: Load a MTLLibrary from a dispatch_data_t
        Parameters:
        data - A metallib file already loaded as data in the form of dispatch_data_t.
        error - An error if we fail to open the metallib data.
      • newLibraryWithFileError

        @Nullable
        @Deprecated
        @Nullable MTLLibrary newLibraryWithFileError​(@NotNull
                                                     @NotNull java.lang.String filepath,
                                                     @Nullable
                                                     @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        newLibraryWithFile: Load a MTLLibrary from a metallib file. API-Since: 8.0 Deprecated-Since: 16.0 Deprecated-Message: Use -newLibraryWithURL:error: instead
      • newLibraryWithSourceOptionsError

        @Nullable
        @Nullable MTLLibrary newLibraryWithSourceOptionsError​(@NotNull
                                                              @NotNull java.lang.String source,
                                                              @Nullable
                                                              @Nullable MTLCompileOptions options,
                                                              @Nullable
                                                              @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newLibraryWithSource:options:error: Load a MTLLibrary from source.
      • newRenderPipelineStateWithDescriptorError

        @Nullable
        @Nullable MTLRenderPipelineState newRenderPipelineStateWithDescriptorError​(@NotNull
                                                                                   @NotNull MTLRenderPipelineDescriptor descriptor,
                                                                                   @Nullable
                                                                                   @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newRenderPipelineStateWithDescriptor:error: Create and compile a new MTLRenderPipelineState object synchronously.
      • newRenderPipelineStateWithDescriptorOptionsReflectionError

        @Nullable
        @Nullable MTLRenderPipelineState newRenderPipelineStateWithDescriptorOptionsReflectionError​(@NotNull
                                                                                                    @NotNull MTLRenderPipelineDescriptor descriptor,
                                                                                                    long options,
                                                                                                    @Nullable
                                                                                                    @Nullable org.moe.natj.general.ptr.Ptr<MTLRenderPipelineReflection> reflection,
                                                                                                    @Nullable
                                                                                                    @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newRenderPipelineStateWithDescriptor:options:reflection:error: Create and compile a new MTLRenderPipelineState object synchronously and returns additional reflection information.
      • newSamplerStateWithDescriptor

        @Nullable
        @Nullable MTLSamplerState newSamplerStateWithDescriptor​(@NotNull
                                                                @NotNull MTLSamplerDescriptor descriptor)
        newSamplerStateWithDescriptor: Create a new sampler.
      • newTextureWithDescriptor

        @Nullable
        @Nullable MTLTexture newTextureWithDescriptor​(@NotNull
                                                      @NotNull MTLTextureDescriptor descriptor)
        newTextureWithDescriptor: Allocate a new texture with privately owned storage.
      • supportsFeatureSet

        @Deprecated
        boolean supportsFeatureSet​(long featureSet)
        Deprecated.
        supportsFeatureSet: Returns TRUE if the feature set is supported by this MTLDevice. API-Since: 8.0 Deprecated-Since: 16.0 Deprecated-Message: Use supportsFamily instead
      • supportsTextureSampleCount

        boolean supportsTextureSampleCount​(long sampleCount)
        supportsTextureSampleCount: Query device if it support textures with a given sampleCount.
        Returns:
        BOOL value. If YES, device supports the given sampleCount for textures. If NO, device does not support the given sampleCount. API-Since: 9.0
      • areProgrammableSamplePositionsSupported

        boolean areProgrammableSamplePositionsSupported()
        [@property] programmableSaplePositionsSupported Query device for programmable sample position support.
        Returns:
        BOOL value. If YES, the device supports programmable sample positions. If NO, the device does not. API-Since: 11.0
      • areRasterOrderGroupsSupported

        boolean areRasterOrderGroupsSupported()
        [@property] rasterOrderGroupsSupported Query device for raster order groups support.
        Returns:
        BOOL value. If YES, the device supports raster order groups. If NO, the device does not. API-Since: 11.0
      • argumentBuffersSupport

        long argumentBuffersSupport()
        [@property] argumentBuffersSupport Query support tier for Argument Buffers.
        Returns:
        MTLArgumentBuffersTier enum value. API-Since: 11.0
      • currentAllocatedSize

        long currentAllocatedSize()
        [@property] currentAllocatedSize The current size in bytes of all resources allocated by this device API-Since: 11.0
      • getDefaultSamplePositionsCount

        void getDefaultSamplePositionsCount​(@NotNull
                                            @NotNull MTLSamplePosition positions,
                                            long count)
        getDefaultSamplePositions:count: Retrieve the default sample positions.
        Parameters:
        positions - The destination array for default sample position data.
        count - Specifies the sample count for which to retrieve the default positions, the length of the positions array, and must be set to a valid sample count. API-Since: 11.0
      • maxThreadgroupMemoryLength

        long maxThreadgroupMemoryLength()
        [@property] maxThreadgroupMemoryLength The maximum threadgroup memory available, in bytes. API-Since: 11.0
      • minimumLinearTextureAlignmentForPixelFormat

        long minimumLinearTextureAlignmentForPixelFormat​(long format)
        minimumLinearTextureAlignmentForPixelFormat: Returns the minimum alignment required for offset and rowBytes when creating a linear texture. An error is thrown for queries with invalid pixel formats (depth, stencil, or compressed formats). API-Since: 11.0
      • newArgumentEncoderWithArguments

        @Nullable
        @Nullable MTLArgumentEncoder newArgumentEncoderWithArguments​(@NotNull
                                                                     @NotNull NSArray<? extends MTLArgumentDescriptor> arguments)
        newArgumentEncoderWithArguments:count: Creates an argument encoder for an array of argument descriptors which will be encoded sequentially. API-Since: 11.0
      • newLibraryWithURLError

        @Nullable
        @Nullable MTLLibrary newLibraryWithURLError​(@NotNull
                                                    @NotNull NSURL url,
                                                    @Nullable
                                                    @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newLibraryWithURL: Load a MTLLibrary from a metallib file. API-Since: 11.0
      • newRenderPipelineStateWithTileDescriptorOptionsReflectionError

        @Nullable
        @Nullable MTLRenderPipelineState newRenderPipelineStateWithTileDescriptorOptionsReflectionError​(@NotNull
                                                                                                        @NotNull MTLTileRenderPipelineDescriptor descriptor,
                                                                                                        long options,
                                                                                                        @Nullable
                                                                                                        @Nullable org.moe.natj.general.ptr.Ptr<MTLRenderPipelineReflection> reflection,
                                                                                                        @Nullable
                                                                                                        @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newRenderPipelineStateWithTileDescriptor:options:reflection:error: Create and compile a new MTLRenderPipelineState object synchronously given a MTLTileRenderPipelineDescriptor. API-Since: 11.0
      • newTextureWithDescriptorIosurfacePlane

        @Nullable
        @Nullable MTLTexture newTextureWithDescriptorIosurfacePlane​(@NotNull
                                                                    @NotNull MTLTextureDescriptor descriptor,
                                                                    @NotNull
                                                                    @NotNull IOSurfaceRef iosurface,
                                                                    long plane)
        newTextureWithDescriptor:iosurface:plane Create a new texture from an IOSurface.
        Parameters:
        descriptor - A description of the properties for the new texture.
        iosurface - The IOSurface to use as storage for the new texture.
        plane - The plane within the IOSurface to use.
        Returns:
        A new texture object. API-Since: 11.0
      • readWriteTextureSupport

        long readWriteTextureSupport()
        [@property] readWriteTextureSupport Query support tier for read-write texture formats.
        Returns:
        MTLReadWriteTextureTier enum value. API-Since: 11.0
      • registryID

        long registryID()
        [@property] registryID Returns the IORegistry ID for the Metal device The registryID value for a Metal device is global to all tasks, and may be used to identify the GPU across task boundaries. API-Since: 11.0
      • convertSparsePixelRegionsToTileRegionsWithTileSizeAlignmentModeNumRegions

        default void convertSparsePixelRegionsToTileRegionsWithTileSizeAlignmentModeNumRegions​(@NotNull
                                                                                               @NotNull MTLRegion pixelRegions,
                                                                                               @NotNull
                                                                                               @NotNull MTLRegion tileRegions,
                                                                                               MTLSize tileSize,
                                                                                               long mode,
                                                                                               long numRegions)
        * @method convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions: * @abstract Converts regions in pixels to regions in sparse tiles using specified alignment mode. Tile size can be obtained from tileSizeWithTextureType:pixelFormat:sampleCount: method. API-Since: 13.0
      • convertSparseTileRegionsToPixelRegionsWithTileSizeNumRegions

        default void convertSparseTileRegionsToPixelRegionsWithTileSizeNumRegions​(@NotNull
                                                                                  @NotNull MTLRegion tileRegions,
                                                                                  @NotNull
                                                                                  @NotNull MTLRegion pixelRegions,
                                                                                  MTLSize tileSize,
                                                                                  long numRegions)
        * @method convertSparseTileRegions:toPixelRegions:withTileSize:numRegions: * @abstract Convertes region in sparse tiles to region in pixels Tile size can be obtained from tileSizeWithTextureType:pixelFormat:sampleCount: method. API-Since: 13.0
      • hasUnifiedMemory

        boolean hasUnifiedMemory()
        [@property] hasUnifiedMemory Returns YES if this GPU shares its memory with the rest of the machine (CPU, etc.) Some GPU architectures do not have dedicated local memory and instead only use the same memory shared with the rest of the machine. This property will return YES for GPUs that fall into that category. API-Since: 13.0
      • maxArgumentBufferSamplerCount

        long maxArgumentBufferSamplerCount()
        [@property] maxArgumentBufferSamplerCount The maximum number of unique argument buffer samplers per app. This limit is only applicable to samplers that have their supportArgumentBuffers property set to true. A MTLSamplerState object is considered unique if the configuration of its originating MTLSamplerDescriptor properties is unique. For example, two samplers with equal minFilter values but different magFilter values are considered unique. API-Since: 12.0
      • maxBufferLength

        long maxBufferLength()
        API-Since: 12.0
      • minimumTextureBufferAlignmentForPixelFormat

        long minimumTextureBufferAlignmentForPixelFormat​(long format)
        minimumTextureBufferAlignmentForPixelFormat: Returns the minimum alignment required for offset and rowBytes when creating a texture buffer from a buffer. API-Since: 12.0
      • newEvent

        @Nullable
        @Nullable MTLEvent newEvent()
        newEvent Returns a new single-device non-shareable Metal event object API-Since: 12.0
      • newIndirectCommandBufferWithDescriptorMaxCommandCountOptions

        @Nullable
        @Nullable MTLIndirectCommandBuffer newIndirectCommandBufferWithDescriptorMaxCommandCountOptions​(@NotNull
                                                                                                        @NotNull MTLIndirectCommandBufferDescriptor descriptor,
                                                                                                        long maxCount,
                                                                                                        long options)
        newIndirectCommandBufferWithDescriptor:maxCommandCount:options Creates a new indirect command buffer with the given descriptor and count. The returned buffer can be safely executed without first encoding into (but is wasteful). API-Since: 12.0
        Parameters:
        descriptor - The descriptor encodes the maximum logical stride of each command.
        maxCount - The maximum number of commands that this buffer can contain.
        options - The options for the indirect command buffer.
      • newRasterizationRateMapWithDescriptor

        @Nullable
        @Nullable MTLRasterizationRateMap newRasterizationRateMapWithDescriptor​(@NotNull
                                                                                @NotNull MTLRasterizationRateMapDescriptor descriptor)
        newRasterizationRateMapWithDescriptor: Creates a new variable rasterization rate map with the given descriptor. If '[self supportsRasterizationRateMapWithLayerCount:descriptor.layerCount]' returns NO, or descriptor.screenSize describes an empty region, the result will always be nil.
        Returns:
        A MTLRasterizationRateMap instance that can be used for rendering on this MTLDevice, or nil if the device does not support the combination of parameters stored in the descriptor. API-Since: 13.0
      • newSharedEvent

        @Nullable
        @Nullable MTLSharedEvent newSharedEvent()
        newSharedEvent Returns a shareable multi-device event. API-Since: 12.0
      • newSharedEventWithHandle

        @Nullable
        @Nullable MTLSharedEvent newSharedEventWithHandle​(@NotNull
                                                          @NotNull MTLSharedEventHandle sharedEventHandle)
        newSharedEventWithHandle Creates a shareable multi-device event from an existing shared event handle. API-Since: 12.0
      • newSharedTextureWithDescriptor

        @Nullable
        @Nullable MTLTexture newSharedTextureWithDescriptor​(@NotNull
                                                            @NotNull MTLTextureDescriptor descriptor)
        newSharedTextureWithDescriptor Create a new texture that can be shared across process boundaries. This texture can be shared between process boundaries but not between different GPUs, by passing its MTLSharedTextureHandle.
        Parameters:
        descriptor - A description of the properties for the new texture.
        Returns:
        A new texture object. API-Since: 13.0
      • newSharedTextureWithHandle

        @Nullable
        @Nullable MTLTexture newSharedTextureWithHandle​(@NotNull
                                                        @NotNull MTLSharedTextureHandle sharedHandle)
        newSharedTextureWithHandle Recreate shared texture from received texture handle. This texture was shared between process boundaries by other process using MTLSharedTextureHandle. Current process will now share it with other processes and will be able to interact with it (but still in scope of the same GPUs).
        Parameters:
        sharedHandle - Handle to shared texture in this process space.
        Returns:
        A new texture object. API-Since: 13.0
      • sparseTileSizeInBytes

        long sparseTileSizeInBytes()
        [@property] sparseTileSizeInBytes Returns the number of bytes required to map one sparse texture tile. API-Since: 13.0
      • sparseTileSizeWithTextureTypePixelFormatSampleCount

        MTLSize sparseTileSizeWithTextureTypePixelFormatSampleCount​(long textureType,
                                                                    long pixelFormat,
                                                                    long sampleCount)
        sparseTileSizeWithTextureType:pixelFormat:sampleCount: Returns tile size for sparse texture with given type, pixel format and sample count. API-Since: 13.0
      • supportsFamily

        boolean supportsFamily​(long gpuFamily)
        supportsFamily: Returns TRUE if the GPU Family is supported by this MTLDevice. API-Since: 13.0
      • supportsRasterizationRateMapWithLayerCount

        boolean supportsRasterizationRateMapWithLayerCount​(long layerCount)
        supportsRasterizationRateMapWithLayerCount: Query device for variable rasterization rate support with the given number of layers.
        Parameters:
        layerCount - The number of layers for which to query device support.
        Returns:
        YES if the device supports creation of rendering using a MTLRasterizationRateMap with the given number of layers. API-Since: 13.0
      • supportsVertexAmplificationCount

        boolean supportsVertexAmplificationCount​(long count)
        [@property] supportsVertexAmplificationCount: Query device for vertex amplification support.
        Parameters:
        count - The amplification count to check
        Returns:
        BOOL value. If YES, the device supports vertex amplification with the given count. If NO, the device does not. API-Since: 13.0
      • areBarycentricCoordsSupported

        @Deprecated
        boolean areBarycentricCoordsSupported()
        Deprecated.
        [@property] barycentricsSupported Query device for Barycentric coordinates support; deprecated, use supportsShaderBarycentricCoordinates
        Returns:
        BOOL value. If YES, the device barycentric coordinates API-Since: 14.0 Deprecated-Since: 16.0
      • counterSets

        @Nullable
        @Nullable NSArray<?> counterSets()
        [@property] counterSets Returns the set of Counter Sets exposed by the device. API-Since: 14.0
      • newAccelerationStructureWithSize

        @Nullable
        @Nullable MTLAccelerationStructure newAccelerationStructureWithSize​(long size)
        API-Since: 14.0
      • newBinaryArchiveWithDescriptorError

        @Nullable
        @Nullable MTLBinaryArchive newBinaryArchiveWithDescriptorError​(@NotNull
                                                                       @NotNull MTLBinaryArchiveDescriptor descriptor,
                                                                       @Nullable
                                                                       @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newBinaryArchiveWithDescriptor:error: Creates a MTLBinaryArchive using the configuration in the descriptor.
        Parameters:
        descriptor - The descriptor for the configuration of the binary archive to create.
        error - If an error occurs during creation, this parameter is updated to describe the failure.
        Returns:
        On success, the created MTLBinaryArchive. On failure, nil. API-Since: 14.0
        See Also:
        MTLBinaryArchive
      • newCounterSampleBufferWithDescriptorError

        @Nullable
        @Nullable MTLCounterSampleBuffer newCounterSampleBufferWithDescriptorError​(@NotNull
                                                                                   @NotNull MTLCounterSampleBufferDescriptor descriptor,
                                                                                   @Nullable
                                                                                   @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newCounterSampleBufferWithDescriptor:error: Given a counter sample buffer descriptor, allocate a new counter sample buffer. This may return nil if the counters may not all be collected simultaneously.
        Parameters:
        descriptor - The descriptor to create a sample buffer for
        error - An error return on failure. API-Since: 14.0
      • newDynamicLibraryError

        @Nullable
        @Nullable MTLDynamicLibrary newDynamicLibraryError​(@NotNull
                                                           @NotNull MTLLibrary library,
                                                           @Nullable
                                                           @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newDynamicLibrary:error: Creates a MTLDynamicLibrary by compiling the code in a MTLLibrary.
        Parameters:
        library - The MTLLibrary from which to compile code. This library must have .type set to MTLLibraryTypeDynamic.
        error - If an error occurs during creation, this parameter is updated to describe the failure.
        Returns:
        On success, the MTLDynamicLibrary containing compiled code. On failure, nil. API-Since: 14.0
        See Also:
        MTLDynamicLibrary
      • newDynamicLibraryWithURLError

        @Nullable
        @Nullable MTLDynamicLibrary newDynamicLibraryWithURLError​(@NotNull
                                                                  @NotNull NSURL url,
                                                                  @Nullable
                                                                  @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newDynamicLibraryWithURL:error: Creates a MTLDynamicLibrary by loading compiled code from a file.
        Parameters:
        url - The file URL from which to load. If the file contains no compiled code for this device, compilation is attempted as with newDynamicLibrary:error:
        error - If an error occurs during creation, this parameter is updated to describe the failure.
        Returns:
        On success, the MTLDynamicLibrary containing compiled code (either loaded or compiled). On failure, nil. API-Since: 14.0
        See Also:
        MTLDynamicLibrary
      • sampleTimestampsGpuTimestamp

        void sampleTimestampsGpuTimestamp​(@NotNull
                                          @NotNull org.moe.natj.general.ptr.LongPtr cpuTimestamp,
                                          @NotNull
                                          @NotNull org.moe.natj.general.ptr.LongPtr gpuTimestamp)
        sampleTimestamps:gpuTimestamp: Sample the CPU and GPU timestamps as closely as possible.
        Parameters:
        cpuTimestamp - The timestamp on the CPU
        gpuTimestamp - The timestamp on the GPU API-Since: 14.0
      • supportsCounterSampling

        boolean supportsCounterSampling​(long samplingPoint)
        supportsCounterSampling: Query device for counter sampling points support.
        Parameters:
        samplingPoint - Query index
        Returns:
        BOOL value. If YES, the device supports counter sampling at given point. API-Since: 14.0
      • supportsDynamicLibraries

        boolean supportsDynamicLibraries()
        [@property] supportsDynamicLibraries Query device support for creating and using dynamic libraries in a compute pipeline.
        Returns:
        BOOL value. If YES, the device supports creating and using dynamic libraries in a compute pipeline. If NO, the device does not. API-Since: 14.0
      • supportsFunctionPointers

        boolean supportsFunctionPointers()
        [@property] supportsFunctionPointers Query device support for using function pointers from compute pipelines.
        Returns:
        BOOL value. If YES, the device supports function pointers from compute pipelines. If NO, the device does not. API-Since: 14.0
      • supportsPullModelInterpolation

        boolean supportsPullModelInterpolation()
        [@property] supportsPullModelInterpolation Query device for pull model interpolation support which allows a fragment shader to compute multiple interpolations (at center, at centroid, at offset, at sample) of a fragment input.
        Returns:
        BOOL value. If YES, the device supports pull model interpolation. If NO, the device does not. API-Since: 14.0
      • supportsRaytracing

        boolean supportsRaytracing()
        [@property] supportsRaytracing Query device support for using ray tracing from compute pipelines.
        Returns:
        BOOL value. If YES, the device supports ray tracing from compute pipelines. If NO, the device does not. API-Since: 14.0
      • supportsShaderBarycentricCoordinates

        boolean supportsShaderBarycentricCoordinates()
        [@property] supportsShaderBarycentricCoordinates Query device for Barycentric Coordinates support.
        Returns:
        BOOL value. If YES, the device supports barycentric coordinates. If NO, the device does not. API-Since: 14.0
      • newLibraryWithStitchedDescriptorError

        @Nullable
        @Nullable MTLLibrary newLibraryWithStitchedDescriptorError​(@NotNull
                                                                   @NotNull MTLStitchedLibraryDescriptor descriptor,
                                                                   @Nullable
                                                                   @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newLibraryWithStitchedDescriptor:error: Returns a library generated using the graphs in the descriptor. API-Since: 15.0
      • supports32BitFloatFiltering

        boolean supports32BitFloatFiltering()
        [@property] supports32BitFloatFiltering Query device for 32-bit Float texture filtering support. Specifically, R32Float, RG32Float, and RGBA32Float.
        Returns:
        BOOL value. If YES, the device supports filtering 32-bit Float textures. If NO, the device does not. API-Since: 14.0
      • supports32BitMSAA

        boolean supports32BitMSAA()
        [@property] supports32BitMSAA Query device for 32-bit MSAA texture support. Specifically, added support for allocating 32-bit Integer format textures (R32Uint, R32Sint, RG32Uint, RG32Sint, RGBA32Uint, and RGBA32Sint) and resolving 32-bit Float format textures (R32Float, RG32Float, and RGBA32Float).
        Returns:
        BOOL value. If YES, the device supports these additional 32-bit MSAA texture capabilities. If NO, the devices does not. API-Since: 14.0
      • supportsFunctionPointersFromRender

        boolean supportsFunctionPointersFromRender()
        [@property] supportsFunctionPointersFromRender Query device support for using function pointers from render pipeline stages.
        Returns:
        BOOL value. If YES, the device supports function pointers from render pipeline stages. If NO, the device does not. API-Since: 15.0
      • supportsPrimitiveMotionBlur

        boolean supportsPrimitiveMotionBlur()
        [@property] supportsPrimitiveMotionBlur Query device support for using ray tracing primitive motion blur.
        Returns:
        BOOL value. If YES, the device supports the primitive motion blur api. If NO, the device does not. API-Since: 14.0
      • supportsQueryTextureLOD

        boolean supportsQueryTextureLOD()
        [@property] supportsQueryTextureLOD Query device for whether it supports the `calculate_clampled_lod` and `calculate_unclamped_lod` Metal shading language functionality.
        Returns:
        BOOL value. If YES, the device supports the calculate LOD functionality. If NO, the device does not. API-Since: 14.0
      • supportsRaytracingFromRender

        boolean supportsRaytracingFromRender()
        [@property] supportsRaytracingFromRender Query device support for using ray tracing from render pipeline stages.
        Returns:
        BOOL value. If YES, the device supports ray tracing from render pipeline stages. If NO, the device does not. API-Since: 15.0
      • supportsRenderDynamicLibraries

        boolean supportsRenderDynamicLibraries()
        [@property] supportsRenderDynamicLibraries Query device support for creating and using dynamic libraries in render pipeline stages.
        Returns:
        BOOL value. If YES, the device supports creating and using dynamic libraries in render pipeline stages. If NO, the device does not. API-Since: 15.0
      • heapAccelerationStructureSizeAndAlignWithDescriptor

        MTLSizeAndAlign heapAccelerationStructureSizeAndAlignWithDescriptor​(@NotNull
                                                                            @NotNull MTLAccelerationStructureDescriptor descriptor)
        heapAccelerationStructureSizeAndAlignWithDescriptor: Determine the byte size of acceleration structures when sub-allocated from a heap. This is a convenience method which computes the acceleration structure size based on the descriptor. This method can be used to help determine the required heap size. API-Since: 16.0
      • heapAccelerationStructureSizeAndAlignWithSize

        MTLSizeAndAlign heapAccelerationStructureSizeAndAlignWithSize​(long size)
        heapAccelerationStructureSizeAndAlignWithSize: Determine the byte size of acceleration structures when sub-allocated from a heap. This method can be used to help determine the required heap size. API-Since: 16.0
      • newArgumentEncoderWithBufferBinding

        @NotNull
        @NotNull MTLArgumentEncoder newArgumentEncoderWithBufferBinding​(@NotNull
                                                                        @NotNull MTLBufferBinding bufferBinding)
        API-Since: 16.0
      • newIOCommandQueueWithDescriptorError

        @Nullable
        @Nullable MTLIOCommandQueue newIOCommandQueueWithDescriptorError​(@NotNull
                                                                         @NotNull MTLIOCommandQueueDescriptor descriptor,
                                                                         @Nullable
                                                                         @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newIOCommandQueueWithDescriptor:descriptor:error: Create and return an IO queue. If the creation of the queue fails the return value will be nil and the optional error if passed in will be non-nil with details of the error. API-Since: 16.0
      • newIOHandleWithURLCompressionMethodError

        @Deprecated
        @Nullable
        @Nullable MTLIOFileHandle newIOHandleWithURLCompressionMethodError​(@NotNull
                                                                           @NotNull NSURL url,
                                                                           long compressionMethod,
                                                                           @Nullable
                                                                           @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        newIOHandleWithURL:url:compressionMethod:error: Create and return a handle that points to a compressed file on disk (a file that was created with MTLIOCompressionContext). This object can be used by MTLIOCommandBuffer load commands to source data for MTLResources. If the creation of the handle fails the return value will be nil and the optional error if passed in will be non-nil with details of the error. API-Since: 16.0 Deprecated-Since: 17.0
      • newIOHandleWithURLError

        @Deprecated
        @Nullable
        @Nullable MTLIOFileHandle newIOHandleWithURLError​(@NotNull
                                                          @NotNull NSURL url,
                                                          @Nullable
                                                          @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        newIOHandleWithURL:url:error: Create and return a handle that points to a raw file on disk. This object can be used by MTLIOCommandBuffer load commands to source data for MTLResources. If the creation of the handle fails the return value will be nil and the optional error if passed in will be non-nil with details of the error. API-Since: 16.0 Deprecated-Since: 17.0
      • newRenderPipelineStateWithMeshDescriptorOptionsReflectionError

        @Nullable
        @Nullable MTLRenderPipelineState newRenderPipelineStateWithMeshDescriptorOptionsReflectionError​(@NotNull
                                                                                                        @NotNull MTLMeshRenderPipelineDescriptor descriptor,
                                                                                                        long options,
                                                                                                        @Nullable
                                                                                                        @Nullable org.moe.natj.general.ptr.Ptr<MTLRenderPipelineReflection> reflection,
                                                                                                        @Nullable
                                                                                                        @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newRenderPipelineStateWithMeshDescriptor:options:reflection:error: Create and compile a new MTLRenderPipelineState object synchronously given a MTLMeshRenderPipelineDescriptor. API-Since: 16.0
      • sparseTileSizeInBytesForSparsePageSize

        long sparseTileSizeInBytesForSparsePageSize​(long sparsePageSize)
        [@property] sparseTileSizeInBytesForSparsePageSize Returns the number of bytes required to map one sparse texture tile for a given MTLSparsePageSize API-Since: 16.0
      • sparseTileSizeWithTextureTypePixelFormatSampleCountSparsePageSize

        MTLSize sparseTileSizeWithTextureTypePixelFormatSampleCountSparsePageSize​(long textureType,
                                                                                  long pixelFormat,
                                                                                  long sampleCount,
                                                                                  long sparsePageSize)
        sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize Returns tile size for sparse texture with given type, pixel format and sample count. API-Since: 16.0
      • architecture

        @NotNull
        @NotNull MTLArchitecture architecture()
        [@property] architecture Returns the device's architecture information. API-Since: 17.0
      • newIOFileHandleWithURLCompressionMethodError

        @Nullable
        @Nullable MTLIOFileHandle newIOFileHandleWithURLCompressionMethodError​(@NotNull
                                                                               @NotNull NSURL url,
                                                                               long compressionMethod,
                                                                               @Nullable
                                                                               @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newIOFileHandleWithURL:compressionMethod:error: Create and return a handle that points to a compressed file on disk (a file that was created with MTLIOCompressionContext). This object can be used by MTLIOCommandBuffer load commands to source data for MTLResources. If the creation of the handle fails the return value will be nil and the optional error if passed in will be non-nil with details of the error. API-Since: 17.0
      • newIOFileHandleWithURLError

        @Nullable
        @Nullable MTLIOFileHandle newIOFileHandleWithURLError​(@NotNull
                                                              @NotNull NSURL url,
                                                              @Nullable
                                                              @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        newIOFileHandleWithURL:error: Create and return a handle that points to a raw file on disk. This object can be used by MTLIOCommandBuffer load commands to source data for MTLResources. If the creation of the handle fails the return value will be nil and the optional error if passed in will be non-nil with details of the error. API-Since: 17.0
      • recommendedMaxWorkingSetSize

        long recommendedMaxWorkingSetSize()
        [@property] recommendedMaxWorkingSetSize Returns an approximation of how much memory this device can use with good performance. Performance may be improved by keeping the total size of all resources (texture and buffers) and heaps less than this threshold, beyond which the device is likely to be overcommitted and incur a performance penalty. API-Since: 16.0
      • supportsBCTextureCompression

        boolean supportsBCTextureCompression()
        [@property] supportsBCTextureCompression Query device for BC Texture format support
        Returns:
        BOOL value. If YES, the device supports compressed BC Texture formats. If NO, the device does not. API-Since: 16.4