Repository navigation
fix(webgpu): Let the browser swapchain keep last frame's pixels - #25714
Merged
ramezgerges merged 1 commit intoOct 27, 2026
Merged
Conversation
The browser WebGPU context renders into an offscreen recreated only on resize and blits it to the canvas, so last frame's pixels are there when the next frame starts, but it never reported PreservesContents. Every WebAssembly frame repainted the whole window; on a software adapter that made frames slow enough to fail the animation and scroll tests on timing. It now reports it, so the compositor repaints only the damage. Fixes unoplatform#25713 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
1 of 5 tasks
ramezgerges
force-pushed
the
dev/rara/wasm-webgpu-damage
branch
from
October 26, 2026 17:41
c36753c to
650267a
Compare
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
The build 241472 found UI Test snapshots differences: Details
|
2 of 5 tasks
Xiaoy312
approved these changes
Oct 27, 2026
Contributor
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
This was referenced Oct 29, 2026
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.
GitHub Issue: closes #25713
PR Type:
🐞 Bugfix
What changed? 🚀
The bug: on WebAssembly with WebGPU, every frame repainted the whole window. The compositor only repaints the damaged region when the swapchain reports
PreservesContents.WebGpuSwapChainContext(desktop, iOS, Android) reports it; the browser context,WebGpuBrowserGraphicsContext, never did.The fix: it now reports
PreservesContents => true. That's safe because it keeps last frame's pixels, exactly like the desktop swapchain:_presentTex, whichConfigurerecreates only when the size changes;Present()then blits all of_presentTexto the canvas.Why it matters
The full-window repaint costs per pixel. On CI's WebAssembly WebGPU lane (Chrome with
--use-webgpu-adapter=swiftshader, so WebGPU on the CPU), frames are slow enough that animation and scroll tests fail on timing. That's why the lane has failed 2 to 8 of its 12 shards on every master build since it was added, on 7 October. Examples:Validation
Locally, in a CI-equivalent lane: Ubuntu 24.04 in Docker, Google Chrome stable with the lane's exact flags, Xvfb and fluxbox, a 1280×800 window, 8 cores, and the SamplesApp published with CI's command.
Given_InteractionTrackerinertia tests, see below)The after-runs had no other failures, so partial repaint left no stale pixels in the shard. The two
Given_InteractionTrackerinertia tests compare positions sampled mid-animation, so they still depend on the frame rate; they're tracked as timing-sensitive, not as rendering bugs.Left to CI: the full WebAssembly WebGPU lane, all 12 shards. That lane is skipped on pull requests until the job-condition fix in #25664 or #25669 merges, so it will first run here after a rebase onto either.
PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code