[PR #4349] [CLOSED] Shader API: the post stage's history, last frame's input to the last pass #5577

Closed
opened 2026-11-03 05:13:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4349
Author: @Teiwazik
Created: 10/30/2026
Status: ❌ Closed

Base: main ← Head: shader/s3-post-history


📝 Commits (10+)

  • 951c7d5 Shader API: the frame's motion since the last one, and the eye's light eased
  • 07d3026 Shader API: the post stage's history, last frame's input to the last pass
  • 252ac76 Merge branch 'pr4335' into pr4345
  • ff2bf4e Merge branch 'shader/s2-frame-motion' into shader/s3-post-history
  • 9e867ea Merge branch 'shader/s2-frame-motion' into shader/s3-post-history
  • 07cd25f Shader API: a gap between frames forgets the frame before
  • 0a7c5e6 Reset native post history after frame gaps
  • 9452f0a Merge branch 'shader/s1-material-behind' into shader/s2-frame-motion
  • 00af468 Merge branch 'shader/s2-frame-motion' into shader/s3-post-history
  • 7264523 Merge #4335's updated branch (main with #4186) into shader/s2-frame-motion

📊 Changes

6 files changed (+306 additions, -13 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+2 -0)
📝 crates/horizon-client-render/src/gfx/native_post.rs (+266 -10)
📝 crates/horizon-shader-api/src/inputs.rs (+19 -2)
📝 crates/horizon-shader-api/src/stages.rs (+7 -1)
📝 docs/api/shaders-reference.md (+7 -0)
📝 docs/api/shaders.md (+5 -0)

📄 Description

🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally.

Fixes #4348

Builds on #4345 (and #4335 under it); this PR's own change is the last commit.

What and why

  • The post prelude gains var history: texture_2d<f32> (group 3, binding 8): last frame's input to the last pass. A temporal pass placed second to last therefore reads its own previous output; Frame.previous_view_projection and camera_motion (#4345) reproject it.
  • NativePost makes the history target with its two chain targets (which become COPY_SRC) and binds a black 1×1 until then; after all passes have run, the last pass's input is copied into it, so the last pass reads last frame's, never this one's.
  • Black on the first frame and with a single pass (no chain target to keep).
  • Binding 8 leaves 6 and 7 free for the shadow map.

A GPU test runs two frames of a two-pass pack whose last pass outputs history: black on the first, the first pass's output on the second.

pr_ready

pr_ready (tools/pr_ready.py --quick on Teiwazik, against origin/main at 68f036059, 3 min 16 s)

Check Result
Scope ✅ 8 files, +426 −24
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (1 min 6 s)
rustfmt ✅ (11 s)
clippy ✅ (1 min 10 s)
tests: horizon-client-render, horizon-shader-api ✅ 589 passed (25 s)
doc tests ✅ 0 passed (21 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4349 **Author:** [@Teiwazik](https://github.com/Teiwazik) **Created:** 10/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `shader/s3-post-history` --- ### 📝 Commits (10+) - [`951c7d5`](https://github.com/horizon-rust/horizon/commit/951c7d5165d02d68f47d89fb1f2033efd5b9b6c0) Shader API: the frame's motion since the last one, and the eye's light eased - [`07d3026`](https://github.com/horizon-rust/horizon/commit/07d302639ecb87e90e0127669cdc54adaff8d98f) Shader API: the post stage's history, last frame's input to the last pass - [`252ac76`](https://github.com/horizon-rust/horizon/commit/252ac76369990b6ef98615f6a125d769ec407707) Merge branch 'pr4335' into pr4345 - [`ff2bf4e`](https://github.com/horizon-rust/horizon/commit/ff2bf4e6706e9f107da0fb8c2c2587216c985356) Merge branch 'shader/s2-frame-motion' into shader/s3-post-history - [`9e867ea`](https://github.com/horizon-rust/horizon/commit/9e867eacf6260535e2bd3057c83b333c89f4a643) Merge branch 'shader/s2-frame-motion' into shader/s3-post-history - [`07cd25f`](https://github.com/horizon-rust/horizon/commit/07cd25f8192cba96c10092165f1db1943d7580a6) Shader API: a gap between frames forgets the frame before - [`0a7c5e6`](https://github.com/horizon-rust/horizon/commit/0a7c5e6ced7c3ad6c240cf805d12bf69d0f0b520) Reset native post history after frame gaps - [`9452f0a`](https://github.com/horizon-rust/horizon/commit/9452f0ac11e98e7ac8ee741072312ea251ed3bf8) Merge branch 'shader/s1-material-behind' into shader/s2-frame-motion - [`00af468`](https://github.com/horizon-rust/horizon/commit/00af46812346638f5a8c57905754d76e83ca8b83) Merge branch 'shader/s2-frame-motion' into shader/s3-post-history - [`7264523`](https://github.com/horizon-rust/horizon/commit/72645234c5b2b75840c7d7f281200473c7774e9a) Merge #4335's updated branch (main with #4186) into shader/s2-frame-motion ### 📊 Changes **6 files changed** (+306 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+2 -0) 📝 `crates/horizon-client-render/src/gfx/native_post.rs` (+266 -10) 📝 `crates/horizon-shader-api/src/inputs.rs` (+19 -2) 📝 `crates/horizon-shader-api/src/stages.rs` (+7 -1) 📝 `docs/api/shaders-reference.md` (+7 -0) 📝 `docs/api/shaders.md` (+5 -0) </details> ### 📄 Description > 🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally. Fixes #4348 Builds on #4345 (and #4335 under it); this PR's own change is the last commit. ## What and why - The post prelude gains `var history: texture_2d<f32>` (group 3, binding 8): last frame's input to the last pass. A temporal pass placed second to last therefore reads its own previous output; `Frame.previous_view_projection` and `camera_motion` (#4345) reproject it. - `NativePost` makes the history target with its two chain targets (which become `COPY_SRC`) and binds a black 1×1 until then; after all passes have run, the last pass's input is copied into it, so the last pass reads last frame's, never this one's. - Black on the first frame and with a single pass (no chain target to keep). - Binding 8 leaves 6 and 7 free for the shadow map. A GPU test runs two frames of a two-pass pack whose last pass outputs `history`: black on the first, the first pass's output on the second. ## pr_ready **pr_ready** (`tools/pr_ready.py --quick` on Teiwazik, against origin/main at 68f036059, 3 min 16 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +426 −24 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (1 min 6 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (1 min 10 s) | | tests: horizon-client-render, horizon-shader-api | ✅ 589 passed (25 s) | | doc tests | ✅ 0 passed (21 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5577
No description provided.