---
title: "encode(to:sourceTexture:previousTexture:destinationTexture:motionVectorTexture:depthTexture:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpstemporalaa/encode(to:sourcetexture:previoustexture:destinationtexture:motionvectortexture:depthtexture:)"
---

# encode(to:sourceTexture:previousTexture:destinationTexture:motionVectorTexture:depthTexture:)

## Declaration

```swift
func encode(to commandBuffer: any MTLCommandBuffer, sourceTexture: any MTLTexture, previousTexture: any MTLTexture, destinationTexture: any MTLTexture, motionVectorTexture: (any MTLTexture)?, depthTexture: (any MTLTexture)?)
```
