---
title: "encode(into:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowleveldeformation/encode(into:)"
---

# encode(into:)

Encodes the configured deformation passes into the given command encoder.

## Declaration

```swift
final func encode(into encoder: any MTLComputeCommandEncoder) throws(LowLevelDeformation.Error)
```

## Parameters

- `encoder`: A serial Metal compute command encoder.

## Discussion

Discussion Call input.setVertices(_:offset:semantic:) and output.setVertices(_:offset:semantic:) before calling this method each frame. note: If any required buffer has not been set, or if encoder uses concurrent dispatch.

## See Also

### Encoding deformation work

- [LowLevelDeformation.Pipeline](realitykit/lowleveldeformation/pipeline.md)
- [LowLevelDeformation.Error](realitykit/lowleveldeformation/error.md)
