---
title: Customizing shaders using function pointers and stitching
framework: metal
role: sampleCode
role_heading: Sample Code
path: sample-code/metal/customizing-shaders-using-function-pointers-and-stitching
---

# Customizing shaders using function pointers and stitching

Define custom shader behavior at runtime by creating functions from existing ones and preferentially linking to others in a dynamic library.

## Overview

Overview note: This sample code project is associated with WWDC2021 session 10229: Discover compilation workflows in Metal and WWDC2022 session 6596: Target and optimize GPU binaries with Metal 3.

## See Also

### Stitched function libraries

- [MTLStitchedLibraryDescriptor](metal/mtlstitchedlibrarydescriptor.md)
- [MTLFunctionStitchingGraph](metal/mtlfunctionstitchinggraph.md)
- [MTLFunctionStitchingInputNode](metal/mtlfunctionstitchinginputnode.md)
- [MTLFunctionStitchingFunctionNode](metal/mtlfunctionstitchingfunctionnode.md)
- [MTLFunctionStitchingNode](metal/mtlfunctionstitchingnode.md)
- [MTLFunctionStitchingAttributeAlwaysInline](metal/mtlfunctionstitchingattributealwaysinline.md)
- [MTLFunctionStitchingAttribute](metal/mtlfunctionstitchingattribute.md)
