---
title: ShaderFunction
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/shaderfunction
---

# ShaderFunction

A reference to a function in a Metal shader library.

## Declaration

```swift
@dynamicCallable struct ShaderFunction
```

## Topics

### Creating a shader function

- [init(library:name:)](swiftui/shaderfunction/init(library:name:).md)

### Configuring a function

- [library](swiftui/shaderfunction/library.md)
- [name](swiftui/shaderfunction/name.md)
- [dynamicallyCall(withArguments:)](swiftui/shaderfunction/dynamicallycall(witharguments:).md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Accessing Metal shaders

- [colorEffect(_:isEnabled:)](swiftui/view/coloreffect(_:isenabled:).md)
- [distortionEffect(_:maxSampleOffset:isEnabled:)](swiftui/view/distortioneffect(_:maxsampleoffset:isenabled:).md)
- [layerEffect(_:maxSampleOffset:isEnabled:)](swiftui/view/layereffect(_:maxsampleoffset:isenabled:).md)
- [Shader](swiftui/shader.md)
- [ShaderLibrary](swiftui/shaderlibrary.md)
