Skip to content

refactor(compositor): carry the tilted plane's depth gradient to mode 8 - #689

Closed
EtienneLescot wants to merge 1 commit into
mainfrom
feat/3d-depth-gradient
Closed

EtienneLescot wants to merge 1 commit into
mainfrom
feat/3d-depth-gradient

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Plumbing for depth of field: mode 8 receives the tilted plane depth gradient.

Chantier 3D, PR 5a. Spec complète et branche d intégration : #682.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Tilted-screen rendering now calculates and passes depth and focus information based on the active zoom focus and drawn content area.
    • Focus positioning remains aligned with cropped and cover-scaled content.
  • Bug Fixes

    • Corrected depth-focus calculations for tilted rendering, including non-centered focus points.
  • Tests

    • Added coverage for depth calculations, crop handling, and rendering stability across supported platforms.

TiltedQuad now exposes the closed-form depth coefficients (Kx, Ky) that
project_corner used to compute and discard. The three mode-8 draws fill
mb = [gx, gy, z_focus, 0]: gx/gy are the plane's depth gradient in px,
z_focus is the depth of the resolved zoom focus mapped through the cut
actually drawn (FrameGeometry::focus_plane). Shaders do not read the slot
yet, so output is byte-identical.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 63c08eb1-3654-4ac1-a5de-21ec69042b69

📥 Commits

Reviewing files that changed from the base of the PR and between 0834a66 and 480e98c.

⛔ Files ignored due to path filters (1)
  • crates/compositor/src/shaders.hlsl is excluded by !**/*.hlsl
📒 Files selected for processing (8)
  • crates/compositor/src/compositor_linux.rs
  • crates/compositor/src/compositor_macos.rs
  • crates/compositor/src/compositor_windows.rs
  • crates/compositor/src/frame_geometry.rs
  • crates/compositor/src/regions.rs
  • crates/compositor/src/shaders.metal
  • crates/compositor/src/vk_shaders/layer.wgsl
  • crates/compositor/tests/tilted_depth_slot_inert.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change resolves the zoom focus within the drawn cut, computes tilted-plane depth data, and passes it through all compositor backends. The shader documents the new mb layout but does not read the values yet. Unit and Windows integration tests cover the data and unchanged output.

Changes

Tilted depth focus

Layer / File(s) Summary
Resolve focus in the drawn cut
crates/compositor/src/frame_geometry.rs
FrameGeometry now stores focus_plane. Frame planning maps and clamps the focus within the drawn cut. Tests cover shifted, cover-cropped, out-of-bounds, and non-finite focus values.
Compute tilted-plane depth
crates/compositor/src/regions.rs
TiltedQuad now stores closed-form depth coefficients and provides depth_mb, which returns plane gradients, focus depth, and k = 0. Tests compare the computed depth with rotated geometry across presets and shapes.
Pass depth data to tilted rendering
crates/compositor/src/compositor_linux.rs, crates/compositor/src/compositor_macos.rs, crates/compositor/src/compositor_windows.rs, crates/compositor/src/shaders.metal, crates/compositor/src/vk_shaders/layer.wgsl, crates/compositor/tests/tilted_depth_slot_inert.rs
All platform paths pass focus_plane and depth_mb values through mb. Shader comments document the layout, and a Windows integration test verifies unchanged rendered bytes.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested reviewers: beetix

Merge Risk: ⚪ Minimal · up to 480e9

The change prepares focus-relative tilted-depth data without changing rendered output, and no actionable merge risk is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description briefly states the change and references related work, but it omits the required template sections for related issue, change type, release impact, desktop impact, screenshots or video,… Complete the required template sections. Use an accepted related-issue format such as "Refs #682", select the applicable change type, release impact, and desktop impact, and document screenshots or video and testing details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the compositor refactor that carries the tilted plane depth gradient to mode 8.
Docstring Coverage ✅ Passed Docstring coverage is 80.65% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 6 files. (2 skipped: 2 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description briefly states the change and references related work, but it omits the required template sections for related issue, change type, release impact, desktop impact, screenshots or video, and testing.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.98.0)

Clippy execution failed


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

Comment @coderabbitai help to get the list of available commands.

@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

Intégrée dans integration/chantier-3d (#682) avec ses corrections de revue CodeRabbit ; le chantier avance désormais dans cette seule PR.

EtienneLescot added a commit that referenced this pull request Sep 17, 2026
Carries the tilted plane's depth gradient to mode 8 and blurs by it.
Formerly #689 and #692.
EtienneLescot added a commit that referenced this pull request Sep 17, 2026
Carries the tilted plane's depth gradient to mode 8 and blurs by it.
Formerly #689 and #692.
EtienneLescot added a commit that referenced this pull request Sep 17, 2026
Carries the tilted plane's depth gradient to mode 8 and blurs by it.
Formerly #689 and #692.
EtienneLescot added a commit that referenced this pull request Sep 17, 2026
Carries the tilted plane's depth gradient to mode 8 and blurs by it.
Formerly #689 and #692.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant