---
title: "encode(to:sourceTexture:destinationTexture:endpointBuffer:endpointOffset:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsimageedlines/encode(to:sourcetexture:destinationtexture:endpointbuffer:endpointoffset:)"
---

# encode(to:sourceTexture:destinationTexture:endpointBuffer:endpointOffset:)

## Declaration

```swift
func encode(to commandBuffer: any MTLCommandBuffer, sourceTexture source: any MTLTexture, destinationTexture dest: (any MTLTexture)?, endpointBuffer: any MTLBuffer, endpointOffset: Int)
```
