---
title: fragmentFunction
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlrenderpipelinedescriptor/fragmentfunction
---

# fragmentFunction

The fragment function the pipeline calls to process fragments.

## Declaration

```swift
var fragmentFunction: (any MTLFunction)? { get set }
```

## Discussion

Discussion The default value is nil. If this value is nil, then there is no fragment function and therefore no writes to the color render target occur. Depth and stencil writes and visibility result counting can still proceed.

## See Also

### Specifying graphics functions and associated data

- [vertexFunction](metal/mtlrenderpipelinedescriptor/vertexfunction.md)
- [maxVertexCallStackDepth](metal/mtlrenderpipelinedescriptor/maxvertexcallstackdepth.md)
- [maxFragmentCallStackDepth](metal/mtlrenderpipelinedescriptor/maxfragmentcallstackdepth.md)
