Skip to content

fix(gpui): blur backdrops with a gaussian pyramid and real content past the window edge - #57

Merged
zxsleebu merged 7 commits into
masterfrom
fix/blur-edge-weights
Nov 24, 2026
Merged

zxsleebu merged 7 commits into
masterfrom
fix/blur-edge-weights

Conversation

@zxsleebu

@zxsleebu zxsleebu commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

  • replace the dual kawase blur with a gaussian pyramid, so a large blur is round and smooth instead of square, diamond-shaped or pixelated
  • weigh every blur tap by how much of it falls inside the frame, so blurs no longer darken or smear at the window edge
  • render real content into an overscan past the right and bottom edges while a backdrop blur reaches there, so a blurred bar along the edge blurs what would be past it instead of a repeated edge
  • port the pyramid and edge weights to metal and directx (overscan is wgpu and metal only)

Proved with a probe window on wgpu built from master and from this branch (a wide blur comes out round instead of a grid of soft squares, bars on the right and bottom edges blur the content past the edge instead of a stretched border row, nothing past an edge leaks into a scaled layer), a test that a pointer past the edge reaches no hitbox in the overscan, and by running sonora against it; clippy is clean, cargo test -p gpui_wgpu passes, metal and hlsl compile in CI.

Reviewed with neon-loop: 3 rounds with Gemini 4 Neon on high. Neon verdict: approved

🤖 Generated with Claude Code

…st the window edge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added macos changes the macOS backend windows changes the Windows backend rendering changes the scene, shaders or a renderer labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Summary

The change replaces the dual Kawase backdrop blur with a Gaussian pyramid blur in the wgpu, Metal, and DirectX renderers and their shaders. Blur taps outside the frame are excluded and renormalized, and the wgpu and Metal renderers draw real content past the window's right and bottom edges when backdrop blur reaches them.

Wide blur now uses a Gaussian pyramid instead of dual-Kawase passes across the Metal, WGPU, and DirectX renderers. Blur shaders weight samples by their overlap with the frame. Window and scene code track overscan for backdrops and extend eligible drawing beyond the viewport. Metal and non-WebGL WGPU render overscanned frames through offscreen targets.

Merge Risk: Low · previous review 5722e

The blur and overscan changes are mostly sound, and the earlier edge-case fixes landed. Some minor edge behaviors remain: a blur can sample content painted after it, list rows past the edge can take keyboard focus, and pointer hit testing can reach invisible overscan during drags. These are low impact and could be addressed before or shortly after merge.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (2)

Major · Order backdrop reads against the overscan they sample. · scene.rs:275-287

crates/gpui/src/scene.rs:275-287
Major · Functional Correctness · Heavy lift

Order backdrop reads against the overscan they sample.

In an 800px-wide window, paint a background that ends at x=800, an edge backdrop, then a red quad at x=801..820. Before this change, the viewport mask culled the red quad. With overscan, the quad survives but does not intersect the backdrop's visible bounds. The bounds tree gives the background and red quad order 1 and the backdrop order 2. The blur then picks up red from a quad painted after it. (raw.githubusercontent.com)

Keep the visible mask for compositing, but account for the backdrop's source footprint when establishing draw dependencies. Test the same quad on both sides of the backdrop in paint order: it should contribute only when painted first. Preserve batching for adjacent backdrop strips that have no intervening dependency.

Minor · Include spread targets in idle release. · directx_renderer.rs:220-224

crates/gpui_windows/src/directx_renderer.rs:220-224
Minor · Performance & Scalability · Quick win

Include spread targets in idle release.

After a pyramid blur allocates Spread(level), this iterator never visits that texture. The texture remains allocated after IDLE_RELEASE, even when later frames need no blur. Add .chain(self.spreads.iter_mut()) so the existing timestamp guard also releases spread targets.

Comment thread crates/gpui_apple/src/metal_renderer.rs Resolved
Comment thread crates/gpui_apple/src/shaders.metal Resolved
Comment thread crates/gpui/src/window.rs Resolved
Comment thread crates/gpui/src/window.rs Resolved
Comment thread crates/gpui/src/window.rs Resolved
zxsleebu and others added 5 commits November 24, 2026 18:38
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ayer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zxsleebu

Copy link
Copy Markdown
Member Author

Note

🤖 Claude Opus 5.5 responding on behalf of zxsleebu

On the two findings outside the diff:

  • Order backdrop reads against the overscan they sample (scene.rs): leaving it. Dilating a backdrop's order bounds by its blur reach is what the earlier attempt on fix/backdrop-blur-edge (bd113e7) did, and it split a stack of thin backdrop strips, such as sonora's veil, into separate batches. Keeping master's bounds-based ordering is deliberate. Inside the window, a quad painted after a backdrop, outside its bounds but within its blur reach, already orders this way on master. The overscan extends that to content that is never shown directly.
  • Include spread targets in idle release (directx_renderer.rs): fixed in 5722e15.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Comment thread crates/gpui/src/window.rs Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zxsleebu
zxsleebu merged commit b472839 into master Nov 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macos changes the macOS backend rendering changes the scene, shaders or a renderer windows changes the Windows backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant