---
title: "encodeBatch(commandBuffer:sourceMatrix:destinationImages:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsmatrixcopytoimage/encodebatch(commandbuffer:sourcematrix:destinationimages:)"
---

# encodeBatch(commandBuffer:sourceMatrix:destinationImages:)

## Declaration

```swift
func encodeBatch(commandBuffer: any MTLCommandBuffer, sourceMatrix: MPSMatrix, destinationImages: [MPSImage])
```
