Repository navigation
perf(gpui): fuse playback frame conversion passes - #2478
Closed
viralcodex wants to merge 2 commits into
Closed
viralcodex wants to merge 2 commits into
viralcodex wants to merge 2 commits into
Conversation
Author
|
@greptileai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GPUI's CPU playback-frame path converted
RenderedFrameoutput in two full-frame passes:This doubled the memory traversal for every frame shown through the CPU fallback used on Windows, Linux, and when macOS surface presentation is unavailable.
flowchart LR subgraph Before A["Padded RGBA frame"] --> B["Copy and unpad rows"] B --> C["Second pass: RGBA to BGRA"] C --> D["GPUI RenderImage"] end subgraph After E["Padded RGBA frame"] --> F["Unpad and convert in one pass"] F --> G["GPUI RenderImage"] endSolution
frame.rs:Benchmark
Release-mode kernel benchmark on an Apple M4 Pro. Each result is the median of three runs; every run uses 12 alternating baseline/candidate pairs, discards the first two warmups, and verifies byte-identical output:
1248×702, padded rows)282.6 µs183.0 µs1920×1080)656.9 µs418.8 µs3840×2160)2,790.2 µs1,675.2 µsAll frame-kernel tests pass and each benchmark reports
pixels_equal=true.please lmk if I missed something

Confidence Score: 5/5
The PR appears safe to merge; the previous empty-frame issue is fixed.Summary
The PR combines row copying and RGBA-to-BGRA conversion into one pass.
No new actionable issues were found. Tests were inspected, not run.
Reviews (2) · Last reviewed commit: "review comments addressed" · Reviewed by Greptile