<!--
{
  "availability" : [
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CompositorServices",
  "identifier" : "/documentation/CompositorServices/LayerRenderer/Drawable/encodePresent()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Compositor Services",
      "CompositorServices"
    ],
    "preciseIdentifier" : "c:@F@cp_drawable_mtl4_encode_present"
  },
  "title" : "encodePresent()"
}
-->

# encodePresent()

Encodes a notification event to the specified command buffer to present
the drawable’s content onscreen.

```
func encodePresent()
```

## Discussion> Note: Commit the command buffer to the layer queue before calling present.

Call this function as the last step before committing the specified
command buffer. Specifically, call it after you finish encoding all
the work required to render the frame, and immediately before you
call the command buffer’s <doc://com.apple.documentation/documentation/Metal/MTLCommandBuffer/commit()>
method. The function adds a presentation event to the buffer that
causes the compositor to display your frame.

---

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)