<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LowLevelDeformation/encode(into:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:22RealityCoreDeformation08LowLevelC0C6encode4intoySo24MTLComputeCommandEncoder_p_tKF"
  },
  "title" : "encode(into:)"
}
-->

# encode(into:)

Encodes the configured deformation passes into the given command encoder.

```
final func encode(into encoder: any MTLComputeCommandEncoder) throws
```

## Parameters

`encoder`

A serial Metal compute command encoder.

## Discussion

Call `input.setVertices(_:offset:semantic:)` and
`output.setVertices(_:offset:semantic:)` before calling this method each frame.

> Throws: If any required buffer has not been set, or if `encoder` uses
> concurrent dispatch.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)