[PR #7287] [MERGED] Pose mobs with glowing eyes on the GPU skin path #7464

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

📋 Pull Request Information

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

Base: main ← Head: perf/eyes-gpu


📝 Commits (1)

  • 7e00efe Pose mobs with glowing eyes on the GPU skin path

📊 Changes

9 files changed (+197 additions, -81 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+8 -0)
📝 crates/horizon-client-render/src/gfx/entity_skin.rs (+35 -7)
📝 crates/horizon-client-render/src/gfx/entity_skin.wgsl (+8 -5)
📝 crates/horizon-client/src/game/creatures.rs (+7 -10)
📝 crates/horizon-client/src/item_render.rs (+1 -1)
📝 crates/horizon-client/src/mobs/render.rs (+38 -2)
📝 crates/horizon-client/src/mobs/skin.rs (+82 -56)
📝 tests/test_perf_bench.py (+1 -0)
📝 tools/stress_scenes.py (+17 -0)

📄 Description

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

Spiders, cave spiders, endermen, phantoms, the copper golem and a creaking with lit eyes used to go to the CPU path whole, body included. Their eyes layer (RenderTypes.eyes) is translucent, and the GPU skin path (#6757) only took plain opaque and cutout draws. #6758 tried to fix this and was closed: EntityBatch routes OIT quads by scanning the CPU vertices, so eyes written by the GPU would never reach the improved-transparency stages.

This PR takes the case where that routing does not apply. With improved transparency off (the default), the eyes quads are ordinary entity quads, and they now join the mob's skinned draw:

  • No normal. SkinJob::mode (was item) gains FLAT: a normal of all zeros, which is what the CPU path writes for the eyes layer.
  • Same bits. The OIT tag and the eyes' HDR tier go into the job's overlay word, the same bits the CPU path ORs into each vertex.
  • OIT on. With improved transparency on, these mobs stay on the CPU path, as before (Renderer::skins_eyes → SkinModels::eyes).

Exactness

  • Every-mob test. posed_on_the_gpu_every_mob_draws_what_the_cpu_draws now runs every vanilla mob twice, eyes off and on, at 3 ages and turns. With eyes on, 5 mobs move to the GPU path (cave_spider, copper_golem, enderman, phantom, spider); their vertices equal the CPU's byte for byte, in the same order, and stay inside the culling bounds. Over both passes: 465 mob draws posed, 75 kept on the CPU.
  • Shader test. the_shader_writes_what_the_cpu_reference_computes covers a FLAT job on a culled model, with the tier and OIT bits set.
  • Draw order. As in #7056, the posed vertices come before the CPU entities. The eyes lie on the mob's own head, which is drawn just before them in the same job order, so what is behind them is unchanged.

A/B: new stress_eyes scene

1000 spiders, cave spiders and endermen (NoAI). Mac mini M4 Pro, RD 16, 1280×720 offscreen, 10 s, 3 alternating pairs; base main 4956321f71.

Metric main this PR change
avg fps 133.3 / 138.7 / 134.9 231.6 / 234.6 / 225.3 +70 % (136 → 230)
1 % low fps 102.5 / 108.7 / 111.0 180.5 / 181.8 / 166.2 +64 % (107 → 176)
0.1 % low fps 94.4 / 92.7 / 103.2 141.1 / 171.2 / 150.3 +59 % (97 → 154)
frame CPU p50 7.16 ms 4.21 ms −41 %
steady RSS 1471 MB 1193 MB −278 MB

Checks (playhorizon, head 56e37f164; the head only rewords the commit)

cargo fmt --all -- --check                                              ok
cargo clippy --profile fast -p horizon-client -p horizon-client-lib -p horizon-client-render --lib --bins --tests -- -D warnings   ok, 0 diagnostics
cargo test -p horizon-client-lib --lib mobs::skin                       3 passed
cargo test -p horizon-client-render --lib entity_skin                   1 passed (lavapipe)
cargo test -p horizon-client-lib --lib mobs::render                     27 passed
cargo test -p horizon-client --lib creatures                            7 passed
python3 -m unittest tests.test_perf_bench                               24 passed

🤖 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/7287 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/eyes-gpu` --- ### 📝 Commits (1) - [`7e00efe`](https://github.com/horizon-rust/horizon/commit/7e00efefc35dc19519563a75c50db6eef9b5dc34) Pose mobs with glowing eyes on the GPU skin path ### 📊 Changes **9 files changed** (+197 additions, -81 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+8 -0) 📝 `crates/horizon-client-render/src/gfx/entity_skin.rs` (+35 -7) 📝 `crates/horizon-client-render/src/gfx/entity_skin.wgsl` (+8 -5) 📝 `crates/horizon-client/src/game/creatures.rs` (+7 -10) 📝 `crates/horizon-client/src/item_render.rs` (+1 -1) 📝 `crates/horizon-client/src/mobs/render.rs` (+38 -2) 📝 `crates/horizon-client/src/mobs/skin.rs` (+82 -56) 📝 `tests/test_perf_bench.py` (+1 -0) 📝 `tools/stress_scenes.py` (+17 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Spiders, cave spiders, endermen, phantoms, the copper golem and a creaking with lit eyes used to go to the CPU path whole, body included. Their eyes layer (`RenderTypes.eyes`) is translucent, and the GPU skin path (#6757) only took plain opaque and cutout draws. #6758 tried to fix this and was closed: `EntityBatch` routes OIT quads by scanning the CPU vertices, so eyes written by the GPU would never reach the improved-transparency stages. This PR takes the case where that routing does not apply. With improved transparency off (the default), the eyes quads are ordinary entity quads, and they now join the mob's skinned draw: - **No normal.** `SkinJob::mode` (was `item`) gains `FLAT`: a normal of all zeros, which is what the CPU path writes for the eyes layer. - **Same bits.** The OIT tag and the eyes' HDR tier go into the job's overlay word, the same bits the CPU path ORs into each vertex. - **OIT on.** With improved transparency on, these mobs stay on the CPU path, as before (`Renderer::skins_eyes` → `SkinModels::eyes`). ### Exactness - **Every-mob test.** `posed_on_the_gpu_every_mob_draws_what_the_cpu_draws` now runs every vanilla mob twice, eyes off and on, at 3 ages and turns. With eyes on, 5 mobs move to the GPU path (cave_spider, copper_golem, enderman, phantom, spider); their vertices equal the CPU's byte for byte, in the same order, and stay inside the culling bounds. Over both passes: 465 mob draws posed, 75 kept on the CPU. - **Shader test.** `the_shader_writes_what_the_cpu_reference_computes` covers a FLAT job on a culled model, with the tier and OIT bits set. - **Draw order.** As in #7056, the posed vertices come before the CPU entities. The eyes lie on the mob's own head, which is drawn just before them in the same job order, so what is behind them is unchanged. ### A/B: new `stress_eyes` scene 1000 spiders, cave spiders and endermen (NoAI). Mac mini M4 Pro, RD 16, 1280×720 offscreen, 10 s, 3 alternating pairs; base `main` 4956321f71. | Metric | main | this PR | change | |---|---|---|---| | avg fps | 133.3 / 138.7 / 134.9 | 231.6 / 234.6 / 225.3 | **+70 %** (136 → 230) | | 1 % low fps | 102.5 / 108.7 / 111.0 | 180.5 / 181.8 / 166.2 | **+64 %** (107 → 176) | | 0.1 % low fps | 94.4 / 92.7 / 103.2 | 141.1 / 171.2 / 150.3 | +59 % (97 → 154) | | frame CPU p50 | 7.16 ms | 4.21 ms | **−41 %** | | steady RSS | 1471 MB | 1193 MB | −278 MB | ### Checks (playhorizon, head 56e37f164; the head only rewords the commit) ``` cargo fmt --all -- --check ok cargo clippy --profile fast -p horizon-client -p horizon-client-lib -p horizon-client-render --lib --bins --tests -- -D warnings ok, 0 diagnostics cargo test -p horizon-client-lib --lib mobs::skin 3 passed cargo test -p horizon-client-render --lib entity_skin 1 passed (lavapipe) cargo test -p horizon-client-lib --lib mobs::render 27 passed cargo test -p horizon-client --lib creatures 7 passed python3 -m unittest tests.test_perf_bench 24 passed ``` 🤖 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:51 +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#7464
No description provided.