[PR #7204] [MERGED] Shader packs: Iris's SEPARATE_HARDWARE_SAMPLERS feature #7410

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7204
Author: @arslanarm
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: shaderpacks/separate-hardware-samplers


📝 Commits (1)

  • 0f44ec6 Shader packs: Iris's SEPARATE_HARDWARE_SAMPLERS feature

📊 Changes

1 file changed (+9 additions, -4 deletions)

View changed files

📝 crates/horizon-shaders/src/macros.rs (+9 -4)

📄 Description

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

What and why

Fixes #7179.

iris.features.required/optional may name SEPARATE_HARDWARE_SAMPLERS (Iris ShaderDoc, "Feature Flags" and "Separate Hardware Shadow Samplers"). With hardware filtering on, shadowtex0 and shadowtex1 stay plain depth samplers, and shadowtex0HW and shadowtex1HW compare. RenderPearl v2.7.2 and Visual Vibrance v0.3.5a require it, and Horizon logged "the pack requires SEPARATE_HARDWARE_SAMPLERS, which is not supported yet". An optional listing got no IRIS_FEATURE_SEPARATE_HARDWARE_SAMPLERS.

Horizon already had the behaviour: gfx/pack_post.rs binds the HW names to the shadow depth buffers and picks a comparison sampler from the declared type (sampler2DShadow). So this PR only adds the flag to FEATURES, with a comment on why that's enough.

Checked against Iris 1.11.7 with a probe pack written for this. It sets iris.features.required and optional to the flag, sets shadowHardwareFiltering = true, and draws a trivial shadow pass. Its final paints one stripe per check:

Stripe Iris 1.11.7 main (with #7178's fix) this branch (with #7178's fix)
IRIS_FEATURE_SEPARATE_HARDWARE_SAMPLERS defined yes no yes
shadowtex0 / shadowtex1 read as plain depth 101 / 101 of 255 98 / 102 98 / 102
shadowtex0HW with reference 1.0 / 0.0 0 / 1 0 / 1 0 / 1
shadowtex1HW with reference 1.0 0 0 0
shadowtex0's depth strictly between 0 and 1 yes yes yes
shadowtex0HW at that depth + 0.001 0.50 0.23 0.23
  • The comparison works as in Iris (GL's LEQUAL: a reference above the stored depth fails).
  • The plain samplers read about the same depths (98 / 102 against 101); the cause of the small difference isn't checked.
  • The last stripe (hardware filtering at the stored depth + 0.001) differs: 0.23 against Iris's 0.50. It isn't diagnosed here; the flag doesn't change it (0.23 on both Horizon builds).
  • With this branch the game no longer logs the "not supported yet" note for the probe.

The game runs used a build with #7178's fix too, which RenderPearl and Visual Vibrance need to render at all. The flag doesn't depend on it: this branch is based on main, and its own test runs without it.

real_packs over Modrinth's 40 most-downloaded packs, main fbb17c980 vs this branch, SHOW_ERRORS=1: apart from timings, the only difference is that the note "the pack requires SEPARATE_HARDWARE_SAMPLERS, which is not supported yet" is gone, three times each for RenderPearl and Visual Vibrance (one per dimension). Nothing translates differently.

Test: macros::tests::iris_features_are_defined_or_noted now lists the flag in both optional (defined) and required (no note). Its new assertion needs the FEATURES entry this PR adds.

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

Horizon-only (shader packs; vanilla has no such feature). Sources: Iris ShaderDoc ("Feature Flags", "Separate Hardware Shadow Samplers"), and black-box runs of Iris 1.11.7 with a probe pack of our own.

Other projects' code

none. No Iris, OptiFine or pack code read.

Self-check

pr_ready (tools/pr_ready.py --quick on plony-pc, against origin/main at fbb17c980, 2 min 58 s)

Check Result
Scope ✅ 1 files, +9 −4
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 612 passed (34 s)
rustfmt ✅ (7 s)
clippy ✅ (2 min 13 s)
tests: horizon-shaders ✅ 142 passed (3 s)
doc tests ✅ 0 passed
content root tests ➖ content root untouched
mod API up to date ➖ native hooks 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/7204 **Author:** [@arslanarm](https://github.com/arslanarm) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shaderpacks/separate-hardware-samplers` --- ### 📝 Commits (1) - [`0f44ec6`](https://github.com/horizon-rust/horizon/commit/0f44ec6a9516abedf727c24a1f9dc492f35fa609) Shader packs: Iris's SEPARATE_HARDWARE_SAMPLERS feature ### 📊 Changes **1 file changed** (+9 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-shaders/src/macros.rs` (+9 -4) </details> ### 📄 Description > 🤖 Opened by arslanarm's AI agent (Claude Code, Claude Opus 5.5), not by arslanarm personally. ## What and why Fixes #7179. `iris.features.required`/`optional` may name `SEPARATE_HARDWARE_SAMPLERS` (Iris ShaderDoc, "Feature Flags" and "Separate Hardware Shadow Samplers"). With hardware filtering on, `shadowtex0` and `shadowtex1` stay plain depth samplers, and `shadowtex0HW` and `shadowtex1HW` compare. RenderPearl v2.7.2 and Visual Vibrance v0.3.5a require it, and Horizon logged "the pack requires `SEPARATE_HARDWARE_SAMPLERS`, which is not supported yet". An `optional` listing got no `IRIS_FEATURE_SEPARATE_HARDWARE_SAMPLERS`. Horizon already had the behaviour: `gfx/pack_post.rs` binds the `HW` names to the shadow depth buffers and picks a comparison sampler from the declared type (`sampler2DShadow`). So this PR only adds the flag to `FEATURES`, with a comment on why that's enough. **Checked against Iris 1.11.7** with a probe pack written for this. It sets `iris.features.required` and `optional` to the flag, sets `shadowHardwareFiltering = true`, and draws a trivial shadow pass. Its `final` paints one stripe per check: | Stripe | Iris 1.11.7 | main (with #7178's fix) | this branch (with #7178's fix) | | --- | --- | --- | --- | | `IRIS_FEATURE_SEPARATE_HARDWARE_SAMPLERS` defined | yes | no | yes | | `shadowtex0` / `shadowtex1` read as plain depth | 101 / 101 of 255 | 98 / 102 | 98 / 102 | | `shadowtex0HW` with reference 1.0 / 0.0 | 0 / 1 | 0 / 1 | 0 / 1 | | `shadowtex1HW` with reference 1.0 | 0 | 0 | 0 | | `shadowtex0`'s depth strictly between 0 and 1 | yes | yes | yes | | `shadowtex0HW` at that depth + 0.001 | 0.50 | 0.23 | 0.23 | - The comparison works as in Iris (GL's `LEQUAL`: a reference above the stored depth fails). - The plain samplers read about the same depths (98 / 102 against 101); the cause of the small difference isn't checked. - The last stripe (hardware filtering at the stored depth + 0.001) differs: 0.23 against Iris's 0.50. It isn't diagnosed here; the flag doesn't change it (0.23 on both Horizon builds). - With this branch the game no longer logs the "not supported yet" note for the probe. The game runs used a build with #7178's fix too, which RenderPearl and Visual Vibrance need to render at all. The flag doesn't depend on it: this branch is based on main, and its own test runs without it. `real_packs` over Modrinth's 40 most-downloaded packs, main fbb17c980 vs this branch, `SHOW_ERRORS=1`: apart from timings, the only difference is that the note "the pack requires `SEPARATE_HARDWARE_SAMPLERS`, which is not supported yet" is gone, three times each for RenderPearl and Visual Vibrance (one per dimension). Nothing translates differently. Test: `macros::tests::iris_features_are_defined_or_noted` now lists the flag in both `optional` (defined) and `required` (no note). Its new assertion needs the `FEATURES` entry this PR adds. ## 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 Horizon-only (shader packs; vanilla has no such feature). Sources: Iris ShaderDoc ("Feature Flags", "Separate Hardware Shadow Samplers"), and black-box runs of Iris 1.11.7 with a probe pack of our own. ## Other projects' code none. No Iris, OptiFine or pack code read. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on plony-pc, against origin/main at fbb17c980, 2 min 58 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +9 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 612 passed (34 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (2 min 13 s) | | tests: horizon-shaders | ✅ 142 passed (3 s) | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks 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 06:39:08 +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#7410
No description provided.