Last updated: 2026-09-07
Metal Runtime
Metal Pipeline
Metal compute pipeline wrapper — MSL source or precompiled metallib.
It compiles or loads Metal kernels, exposes the threadgroup capabilities that dispatch code needs for tuning, and keeps pipeline lifecycle handling out of the higher-level runtime and benchmark paths.
4 exports shown
struct
MetalPipeline
pub const MetalPipeline = struct A compiled Metal compute pipeline state ready for dispatch.
function
createPipeline
pub fn createPipeline(ctx: ?*shim.MetalCtx, msl_source: [*:0]const u8, fn_name: [*:0]const u8) !MetalPipeline Compile an MSL source string into a compute pipeline for the given function name.
function
createPipelineFromLib
pub fn createPipelineFromLib(ctx: ?*shim.MetalCtx, lib_data: [*]const u8, lib_size: usize, fn_name: [*:0]const u8) !MetalPipeline Create a compute pipeline from a precompiled metallib binary blob.
function
freePipeline
pub fn freePipeline(pipe: *MetalPipeline) void Release the pipeline handle.
Safe to call with a null handle.