Contents

pipelineIndependent

An option that generates the same function handle across all pipeline states that link a function, which lets you share function tables across pipeline states.

Declaration

static var pipelineIndependent: MTLFunctionOptions { get }

Discussion

By default, when you link an MTLFunction into a pipeline state, Metal generates a function handle that points to that function’s location in the pipeline’s executable code. Because different pipeline states place functions at different memory addresses, Metal generates different function handles for the same function in each pipeline state. You insert function handles into an MTLIntersectionFunctionTable or MTLVisibleFunctionTable instance, which means you need separate function tables for each pipeline state by default.

When you compile a function with this option, Metal generates the same function handle for the function across all pipeline states that link it. This consistency lets you create a single function table and use it with multiple pipeline states, which reduces memory overhead and simplifies function table management.

See Also

Function compilation options