[PR #1653] [MERGED] Shader packs, clean room 7: buffer settings and output lists from stage files #3661

Closed
opened 2026-11-03 04:11:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1653
Author: @ludovic111
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: feat/shader-packs-post-load


📝 Commits (1)

  • d064dba Shader packs, clean room 7: buffer settings and output lists from stage files

📊 Changes

2 files changed (+434 additions, -0 deletions)

View changed files

➕ crates/horizon-shaders/src/config.rs (+431 -0)
📝 crates/horizon-shaders/src/lib.rs (+3 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Shader packs, clean room 7 (slice 5a): buffer settings and output lists from stage files. Stacked on #1601.

What

The configuration packs write into their stage files, read from live code only (false #if branches are already gone, so an option's choice is the one in effect):

  • draw_buffers: the buffers a fragment shader writes, from the last live /* DRAWBUFFERS:… */ or /* RENDERTARGETS: … */ comment, at most 8; None without one (then buffers 0–7).
  • Config: per colortex buffer (names and aliases gcolor…gaux4), <buffer>Format in block comments with every format name of §6.7 in any case (as channels × bits × kind), <buffer>Clear, ClearColor, MipmapEnabled. A later file changing a setting, an unknown format and a value of the wrong type are reported with file and line. Buffer 1 becomes RGBA32F when a program declares gdepth and the pack set no format.

Nothing uses it yet: players see no change (skip-release).

Clean room

Clean-room: implemented from cleanroom/shader-packs-spec.md revision 1, §1.7, §6.1.1, §6.1.3–6.1.5, §6.1.7, §6.7 and OQ-17; no other loader's code read. OQ-17 decision (every stage file of the programs that run is read, a later one overrides with a note) is in the clean room's impl-plan.md.

How tested

Unit tests: format names; output lists and settings from live code only (an #ifdef choosing between two lists, settings inside a false branch ignored, aliases, vec4(x) and vec4(r,g,b,a), the gdepth rule); conflicts and bad values reported with their line. The black box over the public packs runs in the next PR, which loads every dimension's programs.

Self-check (whole stack, on its top branch feat/shader-packs-post)

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 16d49fe66, 33 min 27 s)

Check Result
Scope ⚠️ 35 files, +5328 −13; 5068 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅ (1 s)
Python tests ➖ no Python change
rustfmt ✅ (18 s)
clippy ✅ (2 min 38 s)
tests: workspace ✅ 1965 passed (26 min 23 s)
doc tests ✅ 1 passed (4 min 7 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 326 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 314 more
Label skip-release: players see nothing without HORIZON_SHADER_PACK

Parity: 326 harnesses selected (the root Cargo.toml, then gfx.rs and game.rs in the last PR); CI runs them. The renderer changes only act when a pack is loaded: without HORIZON_SHADER_PACK the world target, depth stores and passes are as before.

Needs Ludovic

Nothing for this PR. Label skip-release: it runs only behind HORIZON_SHADER_PACK; the first visible slice is the Shader Packs page (slice 9).

🤖 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/1653 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/shader-packs-post-load` --- ### 📝 Commits (1) - [`d064dba`](https://github.com/horizon-rust/horizon/commit/d064dba945969f26b74231e34e2010b1523dc946) Shader packs, clean room 7: buffer settings and output lists from stage files ### 📊 Changes **2 files changed** (+434 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-shaders/src/config.rs` (+431 -0) 📝 `crates/horizon-shaders/src/lib.rs` (+3 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 7 (slice 5a):** buffer settings and output lists from stage files. Stacked on #1601. ## What The configuration packs write into their stage files, read from live code only (false `#if` branches are already gone, so an option's choice is the one in effect): - `draw_buffers`: the buffers a fragment shader writes, from the last live `/* DRAWBUFFERS:… */` or `/* RENDERTARGETS: … */` comment, at most 8; `None` without one (then buffers 0–7). - `Config`: per colortex buffer (names and aliases `gcolor`…`gaux4`), `<buffer>Format` in block comments with every format name of §6.7 in any case (as channels × bits × kind), `<buffer>Clear`, `ClearColor`, `MipmapEnabled`. A later file changing a setting, an unknown format and a value of the wrong type are reported with file and line. Buffer 1 becomes RGBA32F when a program declares `gdepth` and the pack set no format. Nothing uses it yet: players see no change (`skip-release`). ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §1.7, §6.1.1, §6.1.3–6.1.5, §6.1.7, §6.7 and OQ-17; no other loader's code read. OQ-17 decision (every stage file of the programs that run is read, a later one overrides with a note) is in the clean room's `impl-plan.md`. ## How tested Unit tests: format names; output lists and settings from live code only (an `#ifdef` choosing between two lists, settings inside a false branch ignored, aliases, `vec4(x)` and `vec4(r,g,b,a)`, the `gdepth` rule); conflicts and bad values reported with their line. The black box over the public packs runs in the next PR, which loads every dimension's programs. ## Self-check (whole stack, on its top branch `feat/shader-packs-post`) **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 16d49fe66, 33 min 27 s) | Check | Result | | --- | --- | | Scope | ⚠️ 35 files, +5328 −13; 5068 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ (1 s) | | Python tests | ➖ no Python change | | rustfmt | ✅ (18 s) | | clippy | ✅ (2 min 38 s) | | tests: workspace | ✅ 1965 passed (26 min 23 s) | | doc tests | ✅ 1 passed (4 min 7 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 326 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 314 more | | Label | `skip-release`: players see nothing without `HORIZON_SHADER_PACK` | Parity: 326 harnesses selected (the root `Cargo.toml`, then `gfx.rs` and `game.rs` in the last PR); CI runs them. The renderer changes only act when a pack is loaded: without `HORIZON_SHADER_PACK` the world target, depth stores and passes are as before. ## Needs Ludovic Nothing for this PR. Label `skip-release`: it runs only behind `HORIZON_SHADER_PACK`; the first visible slice is the Shader Packs page (slice 9). 🤖 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 04:11:15 +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#3661
No description provided.