Repository navigation
Conversation
…dow is disabled Default CompositeVideoFrameUniforms border_width to 0.0 and zero it when border is disabled or delegated to frame chrome so inactive borders do not inflate edge_padding_uv. Guard custom smoothstep and shadow evaluation against zero shadow span, use textureSampleLevel(..., 0.0) in sample_texture, and avoid calling fwidth inside apply_rounded_corners after non-uniform apron returns. Fixes CapSoftware#2026
|
@melcheikh is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
| .render_immediate(frames, uniforms, &cursor, true, &mut layers) | ||
| .await | ||
| .expect("preview"); | ||
| assert!(!preview.data.is_empty()); |
There was a problem hiding this comment.
The new render check only asserts that preview.data is nonempty. A frame with the unwanted outline, wrong alpha, or broken shadow still passes. Keep the uniform assertions, but add pixel checks around a window with borders and shadows disabled, including a moving or zooming case. That would cover the shader changes rather than only successful rendering.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/rendering/src/lib.rs
Line: 6133
Comment:
**Outline can escape the test**
The new render check only asserts that `preview.data` is nonempty. A frame with the unwanted outline, wrong alpha, or broken shadow still passes. Keep the uniform assertions, but add pixel checks around a window with borders and shadows disabled, including a moving or zooming case. That would cover the shader changes rather than only successful rendering.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks for this! Before we can review it further it needs a Greptile confidence score of 5/5. Could you address Greptile's remaining comments and push an update? Once it's at 5/5 we'll run the full CI and regression suites on it. |
Summary
Fixes #2026
Resolves the thin rectangular outline artifact visible just outside recorded windows (most noticeable on Windows D3D11/D3D12 when window borders or shadows are disabled, or when motion/zoom blur is active):
Zero inactive
border_widthinCompositeVideoFrameUniformsand shader:CompositeVideoFrameUniforms::default()previously initializedborder_widthto5.0even withborder_enabled: 0.0, andProjectUniformspassed the configuredborder.widthinto display/frame uniforms whenborder_onwas false or delegated toframe_chrome. This inflatededge_paddingto7.0px (5.0 + 2.0) around unbordered windows, matching the 7px apron perimeter seen in the Thin line visible just outside recorded window #2026 screenshots.CompositeVideoFrameUniforms::default()now defaultsborder_widthto0.0,ProjectUniformszeroesborder_widthwhenever the border is disabled on that pass, andcomposite-video-frame.wgslclampsborder_wto0.0unlessuniforms.border_enabled > 0.0.Eliminate remaining non-uniform implicit derivatives (
fwidth/textureSample) after early returns:apply_rounded_cornersis called inside the directional and zoom blur loops after the non-uniform apron and border early returns (and on per-pixel dithered UVs in zoom blur). It now callsrounded_rect_coverage_with_aa(..., 1.0)instead ofrounded_rect_coveragesofwidthis never evaluated across exited helper lanes or dithered UVs.sample_texturenow usestextureSampleLevel(frame_texture, frame_sampler, ..., 0.0)consistently across all branches instead oftextureSample(...)inside non-uniform control flow (frame_textureis single-mip).Guard zero-span shadow evaluation and custom
smoothstep:0.0 / 0.0(NaN) in the customsmoothstepfunction and skips shadow evaluation whenshadow == 0.0orshadow_opacity <= 0.0001.Verification
crates/rendering/src/composite_frame.rsandcrates/rendering/src/lib.rs(default_uniforms_have_zero_border_width_and_disabled_border,uniforms_zero_border_width_when_border_disabled_or_delegated_to_frame).cargo clippy -p cap-rendering --all-targets -- -D warningsandcargo test -p cap-rendering.cc @richiemcilroy: if you find this fix helpful, a maintainer tip via
@algora-pbcwould be greatly appreciated!The PR appears safe to merge, with a non-blocking request to check rendered edge pixels.
Findings
Fix with agent prompt
Summary
Prevents the window-edge outline by zeroing inactive border widths and avoiding shader operations that depend on neighboring pixels after early returns.
Review was based on source inspection; no tests or visual captures were run.
Reviews (1) · Last reviewed commit: "fix(rendering): prevent edge apron artif..." · Reviewed by Greptile