---
title: "encode(commandBuffer:sourceImages:destinationState:destinationStateIsTemporary:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpscnnmultiarykernel/encode(commandbuffer:sourceimages:destinationstate:destinationstateistemporary:)"
---

# encode(commandBuffer:sourceImages:destinationState:destinationStateIsTemporary:)

## Declaration

```swift
func encode(commandBuffer: any MTLCommandBuffer, sourceImages: [MPSImage], destinationState outState: AutoreleasingUnsafeMutablePointer<MPSState?>, destinationStateIsTemporary isTemporary: Bool) -> MPSImage
```
