Repository navigation
Conversation
Present the first new size before growing the buffers. Keep subsequent frames at the client size, fill exposed edges, and release the headroom after resizing settles. A different scale or monitor, larger or unknown dimensions, or a refused growth uses exact-size buffers for the rest of the window's lifetime.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Member
Author
|
Closing (owner's decision): this predates the window/surface rewrite (6 conflicts); if live-resize lag is measured on Windows, redo it on the new window/surface code. Branch kept. |
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.
Windows: each step of a live resize called
ResizeBuffers, which waits for every frame the GPU has in flight and then makes new buffers. On a single display in the measured envelope, the window now keeps swap-chain buffers the size of its display while it's resized, draws each step at its own size into the renderer's kept frame, and copies that frame into the top-left. One second after the last step, outside the system's size loop, the buffers go back to the window's size.stateDiagram-v2 [*] --> Exact Exact --> Growing: resize, display measured Growing --> Filled: exact-size frame presented Filled --> Larger: grow to display size Larger --> Larger: resize on same display Larger --> Exact: 1 s after last step, outside size loop Exact --> Fallback: unmeasured display or size, alpha, no COPY_DST Growing --> Fallback: display changed Filled --> Fallback: growth refused (OOM or configure error) Larger --> Fallback: ScaleFactorChanged, moved to another display, drawable size mismatch Fallback --> Fallback: today's exact-size path for the window's lifetimewindow/buffer.rs,Display::measured): one active monitor (SM_CMONITORS == 1), scale 1.5, a monitor up to 2560×1440, a client up to 2180×1420 (grow) or 2488×1406 (maximised). Anything else takesFallback, which isdev's path.Filled), so no empty, larger buffer is ever shown.WM_DPICHANGED(ScaleFactorChanged), a move to another monitor, a drawable whose size doesn't match, or a refused growth (anOutOfMemoryerror scope around the configure) reconfigures at the exact size and resets the slot and damage history.Blade, Iris Xe, 2560×1440 at 240 Hz, with the OpenCode desktop drawing beside it (about 18% GPU). Benchmark-release apps (not shipping PGO), measured on
b2b3cea5, which is this diff onbc05f817:dev(bc05f817)SetWindowPosanswered, p50 of 40 steps, 5 runshello, 1440×960 client)SetWindowPosp50dev's. The bound:Display::measuredcaps the display at 2560×1440, so this is the largest it can be.SETTLE(1 s after the last step, outside the size loop) configures the exact size, drops the kept frame and polls the device's frees. One second after the last step, GPU memory is 2.6–3.8 MB belowdev's. Memory at rest is unchanged.Fallbacktoday.Fallback.