[PR #1769] [MERGED] Shader packs, clean room 29: entity spans #3749

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

📋 Pull Request Information

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

Base: main ← Head: feat/shader-packs-entity-spans


📝 Commits (10+)

  • 6c8880f Shader packs, clean room 15: globals initialized at run time, switch options
  • 505e8e9 Shader packs, clean room 16: custom uniforms
  • a2ec3fc Shader packs, clean room 17: real packs' buffers and samplers
  • 3e2c30a Shader packs, clean room 18: translucent terrain drawn by the pack
  • b6345fc Shader packs, clean room 19: GPU time of each pass (developers' aid)
  • 5e348aa Shader packs, clean room 20: buffer mipmaps
  • b9b47f1 Shader packs, clean room 21: per-draw uniforms (renderStage)
  • 7d6583d Shader packs, clean room 22: the sky (gbuffers_skybasic)
  • 230730d Shader packs, clean room 23: the sun and moon (gbuffers_skytextured)
  • b940754 Terrain vertex arena readable as storage where flat draws run

📊 Changes

32 files changed (+3602 additions, -238 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+42 -3)
📝 crates/horizon-client/src/game/creatures.rs (+1 -0)
📝 crates/horizon-client/src/game/shader_packs.rs (+196 -5)
📝 crates/horizon-client/src/gfx.rs (+113 -31)
📝 crates/horizon-client/src/gfx/arena.rs (+16 -4)
📝 crates/horizon-client/src/gfx/flat.rs (+12 -0)
📝 crates/horizon-client/src/gfx/pack_atlas.rs (+45 -4)
➕ crates/horizon-client/src/gfx/pack_draw.rs (+81 -0)
📝 crates/horizon-client/src/gfx/pack_post.rs (+851 -128)
📝 crates/horizon-client/src/gfx/pack_post.wgsl (+8 -0)
➕ crates/horizon-client/src/gfx/pack_sky.rs (+319 -0)
➕ crates/horizon-client/src/gfx/pack_timing.rs (+147 -0)
📝 crates/horizon-client/src/gfx/pack_uniforms.rs (+84 -5)
➕ crates/horizon-shaders/src/biomes.rs (+159 -0)
➕ crates/horizon-shaders/src/block_ids.rs (+151 -0)
➕ crates/horizon-shaders/src/custom.rs (+611 -0)
📝 crates/horizon-shaders/src/lib.rs (+15 -4)
📝 crates/horizon-shaders/src/macros.rs (+8 -0)
➕ crates/horizon-shaders/src/options.rs (+103 -0)
📝 crates/horizon-shaders/src/pack.rs (+33 -0)

...and 12 more files

📄 Description

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

Shader packs, clean room 29: entity spans. Stacked on #1756. This is the first part of slice 7 (entities).

What

  • While a shader pack is loaded, building the entity geometry (Game::entity_geometry) records where each entity's or block entity's vertices begin (EntitySpan), with:
    • its render stage: ENTITIES, BLOCK_ENTITIES, PARTICLES or DESTROY;
    • its entityId or blockEntityId, from the pack's entity.properties and block.properties (65535 for a name the file lacks, 0 without the file, spec 5.3).
  • The spans reach the renderer in Frame::entity_spans. Nothing draws per span yet; #1771 does.
  • Without a shader pack, nothing is recorded and Horizon's entity draw is unchanged: still one call.
  • block_ids reads entity.properties with the same parser (parse_kind).

About 250 lines.

Clean room

Clean-room: implemented from cleanroom/shader-packs-spec.md revision 1, §4.2, §5.3, §5.4; no other loader's code read.

How tested

  • Unit test: entity lines read by name (entity_lines_by_name).
  • A/B without a pack (the coordinator's condition): village scene, RD 16, 8 alternating rounds, Mac mini (busy, so the samples are bimodal).
    • CPU p50 medians: 0.422 ms before, 0.446 ms after. Minimums: 0.328 ms before, 0.322 ms after. The paired differences are within noise (about ±0.06 ms).
    • GPU work is identical without a pack.
  • Screenshots without a pack: unchanged within run-to-run noise. The same binary twice differs by 15–26k bytes; before vs after differs by 9–34k bytes. They look identical.
  • Parity: the 30 harnesses game.rs selects all pass (17.8 min).
  • lan_e2e (host in-frame and on its server thread): self, nametags, chest, hurt, objects, cracks and looks pass. These were run on #1771's top, which includes this PR.

Needs Ludovic

Nothing. Label skip-release: players see no change.

🤖 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/1769 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/shader-packs-entity-spans` --- ### 📝 Commits (10+) - [`6c8880f`](https://github.com/horizon-rust/horizon/commit/6c8880fbd887a69af1f12acc5f2f9c3b64cbec85) Shader packs, clean room 15: globals initialized at run time, switch options - [`505e8e9`](https://github.com/horizon-rust/horizon/commit/505e8e960f9956a51bde92a52b737d4f7f413c69) Shader packs, clean room 16: custom uniforms - [`a2ec3fc`](https://github.com/horizon-rust/horizon/commit/a2ec3fc791e773c69b852922ca53af1be298cd47) Shader packs, clean room 17: real packs' buffers and samplers - [`3e2c30a`](https://github.com/horizon-rust/horizon/commit/3e2c30a852452a3ee0a4cf778d85aee55b98c205) Shader packs, clean room 18: translucent terrain drawn by the pack - [`b6345fc`](https://github.com/horizon-rust/horizon/commit/b6345fc61d640de07afc9a2f3695039e02ac3201) Shader packs, clean room 19: GPU time of each pass (developers' aid) - [`5e348aa`](https://github.com/horizon-rust/horizon/commit/5e348aa479aafa0ab2f03320fb637a5596f00900) Shader packs, clean room 20: buffer mipmaps - [`b9b47f1`](https://github.com/horizon-rust/horizon/commit/b9b47f12dabd79ba8c48998d9aa98974e26a3eb4) Shader packs, clean room 21: per-draw uniforms (renderStage) - [`7d6583d`](https://github.com/horizon-rust/horizon/commit/7d6583dc4d088d794398391aad4c0ced94009883) Shader packs, clean room 22: the sky (gbuffers_skybasic) - [`230730d`](https://github.com/horizon-rust/horizon/commit/230730d1f5324ed3fc7a658e384767f6d706e713) Shader packs, clean room 23: the sun and moon (gbuffers_skytextured) - [`b940754`](https://github.com/horizon-rust/horizon/commit/b940754555666ba25fa8541e537b7b9a83aa0449) Terrain vertex arena readable as storage where flat draws run ### 📊 Changes **32 files changed** (+3602 additions, -238 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+42 -3) 📝 `crates/horizon-client/src/game/creatures.rs` (+1 -0) 📝 `crates/horizon-client/src/game/shader_packs.rs` (+196 -5) 📝 `crates/horizon-client/src/gfx.rs` (+113 -31) 📝 `crates/horizon-client/src/gfx/arena.rs` (+16 -4) 📝 `crates/horizon-client/src/gfx/flat.rs` (+12 -0) 📝 `crates/horizon-client/src/gfx/pack_atlas.rs` (+45 -4) ➕ `crates/horizon-client/src/gfx/pack_draw.rs` (+81 -0) 📝 `crates/horizon-client/src/gfx/pack_post.rs` (+851 -128) 📝 `crates/horizon-client/src/gfx/pack_post.wgsl` (+8 -0) ➕ `crates/horizon-client/src/gfx/pack_sky.rs` (+319 -0) ➕ `crates/horizon-client/src/gfx/pack_timing.rs` (+147 -0) 📝 `crates/horizon-client/src/gfx/pack_uniforms.rs` (+84 -5) ➕ `crates/horizon-shaders/src/biomes.rs` (+159 -0) ➕ `crates/horizon-shaders/src/block_ids.rs` (+151 -0) ➕ `crates/horizon-shaders/src/custom.rs` (+611 -0) 📝 `crates/horizon-shaders/src/lib.rs` (+15 -4) 📝 `crates/horizon-shaders/src/macros.rs` (+8 -0) ➕ `crates/horizon-shaders/src/options.rs` (+103 -0) 📝 `crates/horizon-shaders/src/pack.rs` (+33 -0) _...and 12 more files_ </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 29:** entity spans. Stacked on #1756. This is the first part of slice 7 (entities). ## What - While a shader pack is loaded, building the entity geometry (`Game::entity_geometry`) records where each entity's or block entity's vertices begin (`EntitySpan`), with: - its render stage: `ENTITIES`, `BLOCK_ENTITIES`, `PARTICLES` or `DESTROY`; - its `entityId` or `blockEntityId`, from the pack's `entity.properties` and `block.properties` (65535 for a name the file lacks, 0 without the file, spec 5.3). - The spans reach the renderer in `Frame::entity_spans`. Nothing draws per span yet; #1771 does. - Without a shader pack, nothing is recorded and Horizon's entity draw is unchanged: still one call. - `block_ids` reads `entity.properties` with the same parser (`parse_kind`). About 250 lines. ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §4.2, §5.3, §5.4; no other loader's code read. ## How tested - Unit test: entity lines read by name (`entity_lines_by_name`). - **A/B without a pack** (the coordinator's condition): village scene, RD 16, 8 alternating rounds, Mac mini (busy, so the samples are bimodal). - CPU p50 medians: 0.422 ms before, 0.446 ms after. Minimums: 0.328 ms before, 0.322 ms after. The paired differences are within noise (about ±0.06 ms). - GPU work is identical without a pack. - **Screenshots without a pack:** unchanged within run-to-run noise. The same binary twice differs by 15–26k bytes; before vs after differs by 9–34k bytes. They look identical. - **Parity:** the 30 harnesses `game.rs` selects all pass (17.8 min). - **lan_e2e** (host in-frame and on its server thread): `self`, `nametags`, `chest`, `hurt`, `objects`, `cracks` and `looks` pass. These were run on #1771's top, which includes this PR. ## Needs Ludovic Nothing. Label `skip-release`: players see no change. 🤖 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:12:02 +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#3749
No description provided.