[PR #5964] [MERGED] Shader packs: gl_FogFragCoord travels from the vertex stage to the fragment stage #6583

Closed
opened 2026-11-03 06:23:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5964
Author: @TobiasLogic
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: shaderpacks/fog-frag-coord


📝 Commits (1)

  • 9a02a6a Shader packs: gl_FogFragCoord travels from the vertex stage to the fragment stage

📊 Changes

3 files changed (+30 additions, -5 deletions)

View changed files

📝 crates/horizon-shaders/src/translate/mod.rs (+21 -0)
📝 crates/horizon-shaders/src/translate/rewrite.rs (+1 -0)
📝 crates/horizon-shaders/src/translate/scan.rs (+8 -5)

📄 Description

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

What and why

Fixes #5960.

gl_FogFragCoord is GLSL 1.20's built-in fog varying. It's now hz_FogFragCoord, a float output of the vertex stage and input of the fragment stage, declared the way gl_FrontColor and gl_TexCoord[n] already are (scan.rs, rewrite.rs). Stage::builtin_varying takes the varying's type for it. A fragment stage that reads it without the vertex stage writing it still gets it declared, as with the others.

fog_frag_coord_is_a_varying translates a program that writes and reads it, and one that only reads it.

Every pack's programs through load_post, naga's validator and the SPIR-V writer, on main and with this PR (world0):

Pack Programs skipped, main This PR
MakeUp UltraFast 9.6 26 of 34 0 of 21
E-LITE 5.1.3 26 of 33 0 of 19
VanillAA 18 of 22 0 of 14
Potato Shaders v1.0d 2 1 (composite1, fixed by #5701)

The other 24 packs I test with are unchanged. Fewer programs in total after the fix is the pack's own #ifdefs choosing other programs once these load.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Not vanilla: GLSL 1.20's gl_FogFragCoord (GLSL 1.20 §7.6) in shaders/ packs. Iris runs these packs on GL, where it's built in.

Self-check

pr_ready (tools/pr_ready.py --quick on 2a929d23955a, against origin/main at 8c02c0b85, 4 min 52 s)

Check Result
Scope ✅ 3 files, +30 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (1 min 7 s)
rustfmt ✅ (14 s)
clippy ✅ (3 min 2 s)
tests: horizon-shaders ✅ 94 passed (28 s)
doc tests ✅ 0 passed (1 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)

Run on a rented Linux box (Ubuntu 24.04, stable Rust 1.99.1), GPU tests on lavapipe.

🤖 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/5964 **Author:** [@TobiasLogic](https://github.com/TobiasLogic) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shaderpacks/fog-frag-coord` --- ### 📝 Commits (1) - [`9a02a6a`](https://github.com/horizon-rust/horizon/commit/9a02a6a0edcf7f5dd8dd1ab03812b2d18d13cf73) Shader packs: gl_FogFragCoord travels from the vertex stage to the fragment stage ### 📊 Changes **3 files changed** (+30 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-shaders/src/translate/mod.rs` (+21 -0) 📝 `crates/horizon-shaders/src/translate/rewrite.rs` (+1 -0) 📝 `crates/horizon-shaders/src/translate/scan.rs` (+8 -5) </details> ### 📄 Description > 🤖 Opened by TobiasLogic's AI agent (Claude Code, Claude Opus 5.5), not by TobiasLogic personally. ## What and why Fixes #5960. `gl_FogFragCoord` is GLSL 1.20's built-in fog varying. It's now `hz_FogFragCoord`, a `float` output of the vertex stage and input of the fragment stage, declared the way `gl_FrontColor` and `gl_TexCoord[n]` already are (`scan.rs`, `rewrite.rs`). `Stage::builtin_varying` takes the varying's type for it. A fragment stage that reads it without the vertex stage writing it still gets it declared, as with the others. `fog_frag_coord_is_a_varying` translates a program that writes and reads it, and one that only reads it. Every pack's programs through `load_post`, naga's validator and the SPIR-V writer, on main and with this PR (`world0`): | Pack | Programs skipped, main | This PR | | --- | --- | --- | | MakeUp UltraFast 9.6 | 26 of 34 | 0 of 21 | | E-LITE 5.1.3 | 26 of 33 | 0 of 19 | | VanillAA | 18 of 22 | 0 of 14 | | Potato Shaders v1.0d | 2 | 1 (`composite1`, fixed by #5701) | The other 24 packs I test with are unchanged. Fewer programs in total after the fix is the pack's own `#ifdef`s choosing other programs once these load. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Not vanilla: GLSL 1.20's `gl_FogFragCoord` (GLSL 1.20 §7.6) in `shaders/` packs. Iris runs these packs on GL, where it's built in. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on 2a929d23955a, against origin/main at 8c02c0b85, 4 min 52 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +30 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (1 min 7 s) | | rustfmt | ✅ (14 s) | | clippy | ✅ (3 min 2 s) | | tests: horizon-shaders | ✅ 94 passed (28 s) | | doc tests | ✅ 0 passed (1 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) | Run on a rented Linux box (Ubuntu 24.04, stable Rust 1.99.1), GPU tests on lavapipe. 🤖 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 06:23:25 +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#6583
No description provided.