---
title: "functionHandle(function:stage:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrenderpipelinestate/functionhandle(function:stage:)-7uvul"
---

# functionHandle(function:stage:)

Creates a function handle for a shader.

## Declaration

```swift
func functionHandle(function: any MTLFunction, stage: MTLRenderStages) -> (any MTLFunctionHandle)?
```

## Parameters

- `function`: An doc://com.apple.metal/documentation/Metal/MTLFunction instance that represents the shader the method creates a handle for.
- `stage`: An doc://com.apple.metal/documentation/Metal/MTLRenderStages instance that represents the rendering stage that invokes the shader that function represents.

## See Also

### Creating function handles and tables

- [makeVisibleFunctionTable(descriptor:stage:)](metal/mtlrenderpipelinestate/makevisiblefunctiontable(descriptor:stage:).md)
- [makeIntersectionFunctionTable(descriptor:stage:)](metal/mtlrenderpipelinestate/makeintersectionfunctiontable(descriptor:stage:).md)
