Skip to content

Use async presentation on macOS where possible.#11326

Merged
vorporeal merged 1 commit into
masterfrom
david/use-async-presentation-on-macos-where-possible
May 19, 2026
Merged

Use async presentation on macOS where possible.#11326
vorporeal merged 1 commit into
masterfrom
david/use-async-presentation-on-macos-where-possible

Conversation

@vorporeal
Copy link
Copy Markdown
Contributor

@vorporeal vorporeal commented May 19, 2026

Description

This changes macOS Metal rendering to avoid transaction-backed presentation during normal frames, where it can force unnecessary CPU stalls while waiting on the command buffer.

The CAMetalLayer now defaults to async presentation, and Warp only re-enables presentsWithTransaction during live window resize. The renderer reads the layer's current transaction mode and uses the matching presentation path, preserving smoother live-resize behavior without paying the synchronization cost for ordinary rendering.

Linked Issue

None.

Testing

  • I have manually tested my changes locally with ./script/run.
  • Manually validated live resize behavior: with transactions disabled, I noticed jitter while resizing; with this patch, which re-enables transactions only during live resize, I did not notice that jitter.
  • Ran cargo fmt --package warpui.
  • Ran ./script/run-clang-format.py -i --extensions h,m crates/warpui/src/platform/mac/objc/host_view.h crates/warpui/src/platform/mac/objc/host_view.m crates/warpui/src/platform/mac/objc/window.m.
  • Ran cargo check -p warpui.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-NONE

Co-Authored-By: Oz oz-agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label May 19, 2026
@vorporeal vorporeal requested a review from alokedesai May 19, 2026 18:02
@vorporeal vorporeal marked this pull request as ready for review May 19, 2026 18:02
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 19, 2026

@vorporeal

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR changes macOS Metal rendering so ordinary frames use asynchronous presentation while live resize temporarily restores transaction-backed presentation.

Concerns

  • For this user-facing rendering/live-resize behavior change, please include screenshots or a short screen recording demonstrating normal rendering and live resize behavior end to end. The PR description currently includes textual manual testing, but no visual evidence.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@vorporeal vorporeal merged commit 62f2668 into master May 19, 2026
48 checks passed
@vorporeal vorporeal deleted the david/use-async-presentation-on-macos-where-possible branch May 19, 2026 20:02
JMrtzsn pushed a commit to JMrtzsn/warpdrive that referenced this pull request May 20, 2026
## Description
This changes macOS Metal rendering to avoid transaction-backed
presentation during normal frames, where it can force unnecessary CPU
stalls while waiting on the command buffer.

The `CAMetalLayer` now defaults to async presentation, and Warp only
re-enables `presentsWithTransaction` during live window resize. The
renderer reads the layer's current transaction mode and uses the
matching presentation path, preserving smoother live-resize behavior
without paying the synchronization cost for ordinary rendering.

## Linked Issue
None.

## Testing
- [x] I have manually tested my changes locally with `./script/run`.
- Manually validated live resize behavior: with transactions disabled, I
noticed jitter while resizing; with this patch, which re-enables
transactions only during live resize, I did not notice that jitter.
- Ran `cargo fmt --package warpui`.
- Ran `./script/run-clang-format.py -i --extensions h,m
crates/warpui/src/platform/mac/objc/host_view.h
crates/warpui/src/platform/mac/objc/host_view.m
crates/warpui/src/platform/mac/objc/window.m`.
- Ran `cargo check -p warpui`.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-NONE

Co-Authored-By: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants