[PR #5702] [MERGED] Cull off-screen dropped items; fix index crash after translucent sections #6451

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

📋 Pull Request Information

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

Base: main ← Head: perf/frame-cpu


📝 Commits (1)

  • 139ef2f Cull off-screen dropped items; restore quad indices after sorted pages

📊 Changes

2 files changed (+22 additions, -4 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+8 -1)
📝 crates/horizon-client/src/game/item_draw.rs (+14 -3)

📄 Description

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

What

Dropped items: frustum cull (CPU per frame). dropped_item_geometry resolved and meshed every item entity within 64 blocks, including those behind the camera. It now applies EntityRenderer.shouldRender's test first: the item's 0.25 box, grown by 0.5, must intersect the view frustum. Mobs (creatures.rs) and minecarts already do this. Pickup animations still always draw.

Measured with HORIZON_SPIKES spans: 12 s flight at render distance 12, 8–33 dropped items nearby, RTX 4060 / Vulkan.

Span Before After
dropped_item_geometry 0.17–0.21 ms 0.008 ms
entity_geometry 0.29–0.33 ms 0.11–0.16 ms

Crash fix: wgpu index validation error on the first in-world frame. On main at ae4e28774 the game aborted with Index 220008 extends beyond limit 65536. draw_sections left a translucent sorted-index page (65536 entries) bound, and the cloud draw after it (36668 quads) used it. draw_sections now rebinds the shared quad indices when it bound a sorted page.

Checks

python3 tools/pr_ready.py --quick: rustfmt ✅ (after cargo fmt), clippy ✅, tests for horizon-client and horizon-client-render ✅ (2462 passed), Python tests ✅ (511 passed). Its Scope row counted an untracked local .claude/worktrees/; the real diff is 2 files, +22 −4. Parity harnesses not run locally; they are left to CI.

🤖 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/5702 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/frame-cpu` --- ### 📝 Commits (1) - [`139ef2f`](https://github.com/horizon-rust/horizon/commit/139ef2f801ca446a6c493fb7255e1d951675891d) Cull off-screen dropped items; restore quad indices after sorted pages ### 📊 Changes **2 files changed** (+22 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+8 -1) 📝 `crates/horizon-client/src/game/item_draw.rs` (+14 -3) </details> ### 📄 Description > 🤖 Opened by rdbtCVS's AI agent (Claude Code, Claude Opus 5.5), not by rdbtCVS personally. ## What **Dropped items: frustum cull (CPU per frame).** `dropped_item_geometry` resolved and meshed every item entity within 64 blocks, including those behind the camera. It now applies `EntityRenderer.shouldRender`'s test first: the item's 0.25 box, grown by 0.5, must intersect the view frustum. Mobs (`creatures.rs`) and minecarts already do this. Pickup animations still always draw. Measured with `HORIZON_SPIKES` spans: 12 s flight at render distance 12, 8–33 dropped items nearby, RTX 4060 / Vulkan. | Span | Before | After | |---|---|---| | `dropped_item_geometry` | 0.17–0.21 ms | 0.008 ms | | `entity_geometry` | 0.29–0.33 ms | 0.11–0.16 ms | **Crash fix: wgpu index validation error on the first in-world frame.** On `main` at ae4e28774 the game aborted with `Index 220008 extends beyond limit 65536`. `draw_sections` left a translucent sorted-index page (65536 entries) bound, and the cloud draw after it (36668 quads) used it. `draw_sections` now rebinds the shared quad indices when it bound a sorted page. ## Checks `python3 tools/pr_ready.py --quick`: rustfmt ✅ (after `cargo fmt`), clippy ✅, tests for horizon-client and horizon-client-render ✅ (2462 passed), Python tests ✅ (511 passed). Its Scope row counted an untracked local `.claude/worktrees/`; the real diff is 2 files, +22 −4. Parity harnesses not run locally; they are left to CI. 🤖 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:20: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#6451
No description provided.