[PR #7235] [MERGED] Draw item frames' and armour stands' items on the GPU skin path #7430

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

📋 Pull Request Information

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

Base: main ← Head: perf/frame-stand-items-gpu


📝 Commits (1)

  • f5499ed Draw item frames' and armour stands' items on the GPU skin path

📊 Changes

3 files changed (+51 additions, -18 deletions)

View changed files

📝 crates/horizon-client/src/game/armor_stands.rs (+19 -4)
📝 crates/horizon-client/src/game/frames.rs (+12 -7)
📝 crates/horizon-client/src/game/item_draw.rs (+20 -7)

📄 Description

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

Follows #7215 (held items).

Before this PR, an item frame's item and an armour stand's hand and head items were posed and lit vertex by vertex on the CPU every frame. The stand's body already went through the GPU skin path (#7056). Now items whose baked model fits that path take it too: opaque or cutout, with no glint, emission or translucent quads.

  • Item frame. Its item becomes a skinned draw of its own, culled by its bounds.
  • Armour stand. Its items join the stand's open skin draw (new skin_item, shared with submit_item_skinned). They are culled and truncated with the body.
  • Unchanged. Skulls, maps, special models and glint items keep the CPU path.

Exactness

items_posed_on_the_gpu_draw_what_the_cpu_draws (extended in #7215) already poses every 26.3 item state in the fixed, both third-person hands and head contexts. These are the poses frames and stands use. On the GPU path the vertices equal the CPU's byte for byte.

A/B

Setup: Mac mini M4 Pro, RD 16, 1280×720 offscreen, 10 s; 3 alternating pairs. The base is #7215's head (9598faab), and this PR is the same code on top of it.

Scene Metric base this PR change
stress_frames (512 frames, 8 items) avg fps 539.7 / 513.8 / 536.6 786.8 / 789.0 / 842.2 +52 % (530 → 806)
1 % low fps 386.0 / 352.2 / 380.6 509.3 / 489.5 / 565.5 +40 % (373 → 521)
frame CPU p50 1.83 ms 1.20 ms −34 %
stress_armor_stands (500 stands, sword) avg fps 218.9 / 211.8 / 215.8 299.3 / 309.9 / 303.0 +41 % (215 → 304)
1 % low fps 170.9 / 177.3 / 183.3 237.6 / 256.2 / 235.9 +37 % (177 → 243)
frame CPU p50 4.56 ms 3.22 ms −29 %

Same scenes, other games (Mac, 1 run each): vanilla stress_frames 93.5 fps, vanilla-mods (Sodium, Lithium, FerriteCore, ImmediatelyFast) stress_armor_stands 98.3 fps. So this PR puts frames at ×8.6 vanilla and stands at ×3.1 vanilla-mods.

Steady RSS moves by up to about 150 MB between runs on the shared Mac, in both directions. It stays within that noise here.

Checks (playhorizon, head f5499edbe, rebased onto main after #7215 merged)

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 items_posed_on_the_gpu           1 passed
cargo test -p horizon-client --lib armor_stand                          10 passed
cargo test -p horizon-client --lib frames                               3 passed
cargo test -p horizon-client --lib item_draw                            2 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/7235 **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/frame-stand-items-gpu` --- ### 📝 Commits (1) - [`f5499ed`](https://github.com/horizon-rust/horizon/commit/f5499edbee2eadb58ebd38b0b2581669417a3ed5) Draw item frames' and armour stands' items on the GPU skin path ### 📊 Changes **3 files changed** (+51 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/armor_stands.rs` (+19 -4) 📝 `crates/horizon-client/src/game/frames.rs` (+12 -7) 📝 `crates/horizon-client/src/game/item_draw.rs` (+20 -7) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Follows #7215 (held items). Before this PR, an item frame's item and an armour stand's hand and head items were posed and lit vertex by vertex on the CPU every frame. The stand's body already went through the GPU skin path (#7056). Now items whose baked model fits that path take it too: opaque or cutout, with no glint, emission or translucent quads. - **Item frame.** Its item becomes a skinned draw of its own, culled by its bounds. - **Armour stand.** Its items join the stand's open skin draw (new `skin_item`, shared with `submit_item_skinned`). They are culled and truncated with the body. - **Unchanged.** Skulls, maps, special models and glint items keep the CPU path. ### Exactness `items_posed_on_the_gpu_draw_what_the_cpu_draws` (extended in #7215) already poses every 26.3 item state in the fixed, both third-person hands and head contexts. These are the poses frames and stands use. On the GPU path the vertices equal the CPU's byte for byte. ### A/B Setup: Mac mini M4 Pro, RD 16, 1280×720 offscreen, 10 s; 3 alternating pairs. The base is #7215's head (`9598faab`), and this PR is the same code on top of it. | Scene | Metric | base | this PR | change | |---|---|---|---|---| | `stress_frames` (512 frames, 8 items) | avg fps | 539.7 / 513.8 / 536.6 | 786.8 / 789.0 / 842.2 | **+52 %** (530 → 806) | | | 1 % low fps | 386.0 / 352.2 / 380.6 | 509.3 / 489.5 / 565.5 | **+40 %** (373 → 521) | | | frame CPU p50 | 1.83 ms | 1.20 ms | −34 % | | `stress_armor_stands` (500 stands, sword) | avg fps | 218.9 / 211.8 / 215.8 | 299.3 / 309.9 / 303.0 | **+41 %** (215 → 304) | | | 1 % low fps | 170.9 / 177.3 / 183.3 | 237.6 / 256.2 / 235.9 | **+37 %** (177 → 243) | | | frame CPU p50 | 4.56 ms | 3.22 ms | −29 % | Same scenes, other games (Mac, 1 run each): vanilla `stress_frames` 93.5 fps, vanilla-mods (Sodium, Lithium, FerriteCore, ImmediatelyFast) `stress_armor_stands` 98.3 fps. So this PR puts frames at ×8.6 vanilla and stands at ×3.1 vanilla-mods. Steady RSS moves by up to about 150 MB between runs on the shared Mac, in both directions. It stays within that noise here. ### Checks (playhorizon, head f5499edbe, rebased onto main after #7215 merged) ``` 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 items_posed_on_the_gpu 1 passed cargo test -p horizon-client --lib armor_stand 10 passed cargo test -p horizon-client --lib frames 3 passed cargo test -p horizon-client --lib item_draw 2 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:24 +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#7430
No description provided.