Module Metal

module CG = CoreGraphics
val debug_msg_send : (select:string -> unit) option Stdlib.ref

A debug callback function that will be called for each Objective-C message send. The callback receives the selector name. Set to None to disable debugging.

val init_debug_log_to_file : string -> unit

Initialize debug logging to a file. This sets a debug callback that logs timestamps and selectors to the specified file.

module Objc : sig ... end

Basic Structures

module Size : sig ... end

Represents the dimensions of a grid, region, or threadgroup. See MTLSize.

module Origin : sig ... end

Represents the origin of a region in 3D space. See MTLOrigin.

module Region : sig ... end

Represents a 3D region. See MTLRegion.

module Range : sig ... end

Represents a range with location and length. See NSRange.

module Device : sig ... end

Represents the GPU device capable of executing Metal commands. See MTLDevice.

Resource Configuration

module ResourceOptions : sig ... end

Options for configuring Metal resources like buffers and textures. See MTLResourceOptions.

module PipelineOption : sig ... end

Options controlling pipeline state creation. See MTLPipelineOption.

module CompileOptions : sig ... end

Options for compiling Metal Shading Language (MSL) source code. See MTLCompileOptions.

Resources

module Resource : sig ... end

Common interface for Metal resources like buffers and textures. See MTLResource.

module Buffer : sig ... end

Represents a block of untyped memory accessible by the GPU. See MTLBuffer.

Libraries and Functions

module FunctionType : sig ... end

Identifies the type of a Metal function. See MTLFunctionType.

module Function : sig ... end

Represents a single, named function (shader or kernel) within a Metal library. See MTLFunction.

module Library : sig ... end

Represents a compiled Metal library containing one or more functions. See MTLLibrary.

Compute Pipeline

module ComputePipelineDescriptor : sig ... end

Describes the configuration for creating a compute pipeline state. See MTLComputePipelineDescriptor.

module ComputePipelineState : sig ... end

Represents a compiled compute pipeline state object. See MTLComputePipelineState.

module LogLevel : sig ... end

Log levels for shader debugging. See MTLLogLevel.

module LogStateDescriptor : sig ... end

Descriptor for configuring shader logging. See MTLLogStateDescriptor.

module LogState : sig ... end

Container for shader log messages. See MTLLogState.

module CommandQueueDescriptor : sig ... end

Configuration for creating command queues. See MTLCommandQueueDescriptor.

Command Infrastructure

module CommandQueue : sig ... end

A queue for submitting command buffers to a device. See MTLCommandQueue.

module Event : sig ... end

An object used for GPU-GPU synchronization within a single device. See MTLEvent.

module CommandBuffer : sig ... end

A container for encoded commands that the GPU executes. See MTLCommandBuffer.

module CommandEncoder : sig ... end

Base protocol for objects that encode commands into a command buffer. See MTLCommandEncoder.

module ResourceUsage : sig ... end

Usage flags for resources within a command encoder. See MTLResourceUsage.

Indirect Command Buffers

module IndirectCommandType : sig ... end

Types of commands that can be encoded into an indirect command buffer. See MTLIndirectCommandType.

module IndirectCommandBufferDescriptor : sig ... end

Describes the configuration for an indirect command buffer. See MTLIndirectCommandBufferDescriptor.

module IndirectComputeCommand : sig ... end

Represents a command within an indirect command buffer specific to compute operations. See MTLIndirectComputeCommand.

module IndirectCommandBuffer : sig ... end

A buffer containing pre-encoded commands that can be executed efficiently by the GPU. See MTLIndirectCommandBuffer.

module ComputeCommandEncoder : sig ... end

Encodes compute commands. See MTLComputeCommandEncoder.

module Fence : sig ... end

An object used for fine-grained resource synchronization within a command encoder. See MTLFence.

module BlitCommandEncoder : sig ... end

Encodes resource copy and synchronization commands. See MTLBlitCommandEncoder.

Synchronization

module SharedEvent : sig ... end

An object used for GPU-GPU or CPU-GPU synchronization, potentially across multiple devices or processes. See MTLSharedEvent.

Dynamic Library Placeholder

module DynamicLibrary : sig ... end

Represents a dynamically linkable Metal library. Bindings are complex and omitted for now. See MTLDynamicLibrary.