<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "macOS: 14.0.0 -",
    "Xcode: 26.3.0 -"
  ],
  "documentType" : "article",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/customizing-shaders-using-function-pointers-and-stitching",
  "metadataVersion" : "0.1.0",
  "role" : "sampleCode",
  "title" : "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.

## Discussion> Note: This sample code project is associated with WWDC2021 session [10229: Discover compilation workflows in Metal](https://developer.apple.com/wwdc21/10229/) and WWDC2022 session [6596: Target and optimize GPU binaries with Metal 3](https://developer.apple.com/wwdc22/6596).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)