<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "Xcode: 12.0.0 -"
  ],
  "documentType" : "article",
  "framework" : "MetalPerformanceShadersGraph",
  "identifier" : "/documentation/MetalPerformanceShadersGraph/adding-custom-functions-to-a-shader-graph",
  "metadataVersion" : "0.1.0",
  "role" : "sampleCode",
  "title" : "Adding custom functions to a shader graph"
}
-->

# Adding custom functions to a shader graph

Run your own graph functions on the GPU by building the function programmatically.

## Discussion> Note: This sample code project is associated with WWDC20 session [10677: Build Customized ML Models with the Metal Performance Shaders Graph](https://developer.apple.com/wwdc20/10677/).

### Configure the sample code project

This sample requires the following system and software configuration:

- macOS 11 or later
- iOS 14 or later
- Xcode 12 or later

---

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)