### MetalKit View and Texture Management Source: https://github.com/metalkit/metal/wiki/Home Endpoints and classes for managing Metal views and loading textures into the GPU. ```APIDOC ## CLASS MTKView ### Description A platform-specific view that renders Metal content into a view-backed drawable. ### Method N/A (Class) ### Parameters - **device** (id) - Required - The Metal device used to render content. - **colorPixelFormat** (MTLPixelFormat) - Required - The pixel format of the color attachment. ## CLASS MTKTextureLoader ### Description A utility class for loading textures from various image formats into Metal textures. ### Method N/A (Class) ### Parameters - **device** (id) - Required - The Metal device to create the texture on. ``` -------------------------------- ### Metal Performance Shaders Ray Tracing Source: https://github.com/metalkit/metal/wiki/Home Classes for accelerating ray tracing operations using hardware-accelerated acceleration structures. ```APIDOC ## CLASS MPSRayIntersector ### Description A kernel that performs ray intersection tests against acceleration structures. ### Method N/A (Class) ### Parameters - **device** (id) - Required - The Metal device used for intersection calculations. ## CLASS MPSTriangleAccelerationStructure ### Description An acceleration structure optimized for triangle-based geometry. ### Method N/A (Class) ### Parameters - **vertexBuffer** (id) - Required - Buffer containing triangle vertex data. ``` -------------------------------- ### GPU Functions & Libraries Source: https://github.com/metalkit/metal/wiki/Home This section details the core components for GPU programming in Metal, including functions, libraries, and how to manage them. ```APIDOC ## GPU Functions & Libraries ### Description Provides an overview of GPU functions and libraries within the Metal framework. This includes information on creating, compiling, and managing shader functions and libraries for GPU execution. ### Related Topics * **Functions:** Details on individual shader functions, their properties, and how to interact with them. * [About the Metal Shading Language Filename Extension](https://developer.apple.com/documentation/metal/gpu_functions_libraries/about_the_metal_shading_language_filename_extension) * [Resolving Shader Issues with the Shader Debugger](https://developer.apple.com/documentation/metal/gpu_functions_libraries/resolving_shader_issues_with_the_shader_debugger) * [Optimizing Performance with the Shader Profiler](https://developer.apple.com/documentation/metal/gpu_functions_libraries/optimizing_performance_with_the_shader_profiler) * [`protocol` MTLFunction](https://developer.apple.com/documentation/metal/mtlfunction) * [`class` MTLFunctionConstant](https://developer.apple.com/documentation/metal/mtlfunctionconstant) * [`class` MTLFunctionConstantValues](https://developer.apple.com/documentation/metal/mtlfunctionconstantvalues) * **Libraries:** Information on building and managing Metal libraries, which group shader functions. * [Building a Library with Metal's Command-Line Tools](https://developer.apple.com/documentation/metal/gpu_functions_libraries/building_a_library_with_metal_s_command-line_tools) * [`protocol` MTLLibrary](https://developer.apple.com/documentation/metal/mtllibrary) * [`class` MTLCompileOptions](https://developer.apple.com/documentation/metal/mtlcompileoptions) * **Input/Output Data:** Describes descriptors for defining the input and output stages of Metal shaders. * [`class` MTLStageInputOutputDescriptor](https://developer.apple.com/documentation/metal/mtlstageinputoutputdescriptor) * [`class` MTLAttribute](https://developer.apple.com/documentation/metal/mtlattribute) * [`class` MTLAttributeDescriptor](https://developer.apple.com/documentation/metal/mtlattributedescriptor) * [`class` MTLAttributeDescriptorArray](https://developer.apple.com/documentation/metal/mtlattributedescriptorarray) * [`class` MTLBufferLayoutDescriptor](https://developer.apple.com/documentation/metal/mtlbufferlayoutdescriptor) * [`class` MTLBufferLayoutDescriptorArray](https://developer.apple.com/documentation/metal/mtlbufferlayoutdescriptorarray) * **Reflection Data:** Details on structures used for reflecting pipeline state and shader arguments. * [`struct` MTLPipelineOption](https://developer.apple.com/documentation/metal/mtlpipelineoption) * [`class` MTLComputePipelineReflection](https://developer.apple.com/documentation/metal/mtlcomputepipelinereflection) * [`class` MTLRenderPipelineReflection](https://developer.apple.com/documentation/metal/mtlrenderpipelinereflection) * [`class` MTLArgument](https://developer.apple.com/documentation/metal/mtlargument) * [`class` MTLType](https://developer.apple.com/documentation/metal/mtltype) * [`class` MTLStructType](https://developer.apple.com/documentation/metal/mtlstructtype) * [`class` MTLStructMember](https://developer.apple.com/documentation/metal/mtlstructmember) * [`class` MTLArrayType](https://developer.apple.com/documentation/metal/mtlarraytype) * [`class` MTLPointerType](https://developer.apple.com/documentation/metal/mtlpointertype) * [`class` MTLTextureReferenceType](https://developer.apple.com/documentation/metal/mtltexturereferencetype) ``` -------------------------------- ### MTLCommandBuffer Interface Source: https://github.com/metalkit/metal/wiki/Home The MTLCommandBuffer protocol represents a container for commands that are encoded for execution by the GPU. ```APIDOC ## [PROTOCOL] MTLCommandBuffer ### Description A container that stores encoded commands that the GPU executes. ### Method N/A (Protocol) ### Endpoint https://developer.apple.com/documentation/metal/mtlcommandbuffer ### Parameters #### Request Body - **status** (MTLCommandBufferStatus) - Read-only - The current execution status of the command buffer. ### Response #### Success Response (200) - **commit** (Void) - Commits the command buffer to the command queue for execution. ``` -------------------------------- ### MTLCommandQueue Interface Source: https://github.com/metalkit/metal/wiki/Home The MTLCommandQueue protocol defines the interface for a queue that organizes the order in which command buffers are executed by the GPU. ```APIDOC ## [PROTOCOL] MTLCommandQueue ### Description An object that manages the execution of command buffers on a specific GPU device. ### Method N/A (Protocol) ### Endpoint https://developer.apple.com/documentation/metal/mtlcommandqueue ### Parameters #### Request Body - **label** (String) - Optional - A string to help identify the command queue in debugging tools. ### Response #### Success Response (200) - **commandBuffer** (MTLCommandBuffer) - Returns a new command buffer for encoding commands. ``` -------------------------------- ### MTLSharedEvent Synchronization Source: https://github.com/metalkit/metal/wiki/Home MTLSharedEvent provides a mechanism for synchronizing access to resources across multiple devices or between the CPU and GPU. ```APIDOC ## [PROTOCOL] MTLSharedEvent ### Description A synchronization object that can be shared across multiple devices and between the CPU and GPU. ### Method N/A (Protocol) ### Endpoint https://developer.apple.com/documentation/metal/mtlsharedevent ### Parameters #### Request Body - **signaledValue** (UInt64) - Required - The value to signal the event with. ### Response #### Success Response (200) - **signaledValue** (UInt64) - The current signaled value of the shared event. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.