[PR #1235] [MERGED] perf(client): retain the End sky mesh on the GPU #3441

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1235
Author: @rdbtCVS
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ludovic111

Base: main ← Head: t3/cache-end-sky-mesh


📝 Commits (2)

  • 92b8cd6 perf(client): retain the End sky mesh on the GPU
  • 6e83037 end sky test: as_chunks instead of chunks_exact (clippy 1.99)

📊 Changes

5 files changed (+447 additions, -48 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+9 -2)
📝 crates/horizon-client/src/game/end.rs (+5 -40)
📝 crates/horizon-client/src/gfx.rs (+19 -6)
➕ crates/horizon-client/src/gfx/end_sky.rs (+84 -0)
➕ crates/horizon-client/src/gfx/end_sky/tests.rs (+330 -0)

📄 Description

The End sky rebuilt and uploaded 6,144 static vertices every frame alongside its animated flash. Retain those 1,536 tiled quads in an immutable renderer-owned GPU buffer, and draw the flash separately immediately afterward through the existing celestial pipeline. Inactive flashes no longer allocate a vertex vector.

The mesh is created on the first enabled End sky frame and reused while its atlas bounds are unchanged. Changed or missing sprite bounds invalidate it, and resource reload/device recreation replace the owning renderer. Existing title, fog, sky-toggle, blending and world draw ordering remain in place. The flash geometry and lighting calculations are unchanged.

Validation:

  • cargo fmt --all -- --check and git diff --check passed.
  • cargo clippy --locked -p horizon-client --no-default-features --lib --bins -- -D warnings passed.
  • cargo test --locked -p horizon-client --no-default-features --lib gfx:: -- --nocapture: 75 passed, 3 existing benchmarks ignored.
  • Real Vulkan tests on an RTX 4060 verify the same immutable buffer survives 600 preparations, atlas changes/missing sprites rebuild or clear it, and replacement renderer caches allocate independently.
  • 100 camera/flash cases produce byte-identical offscreen pixels for combined versus resident/separate draws using the production celestial shader and blend with a synthetic translucent atlas.
  • A temporary differential probe compared all vertex bytes with the builder from main at 34c3c1cf for three atlas layouts; all matched. Committed geometry snapshots preserve those results with position quantization to tolerate platform trig rounding.

This removes the repeated static geometry build/upload; no FPS or timing improvement is claimed. Validation does not include a full in-game resource-pack reload capture or a fresh vanilla framebuffer comparison. Weather rendering is untouched.


🔄 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/1235 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/cache-end-sky-mesh` --- ### 📝 Commits (2) - [`92b8cd6`](https://github.com/horizon-rust/horizon/commit/92b8cd692da2ffb244b4c81bb1a965d4608f956a) perf(client): retain the End sky mesh on the GPU - [`6e83037`](https://github.com/horizon-rust/horizon/commit/6e83037fca77eeb7884ceec25292c806efc48937) end sky test: as_chunks instead of chunks_exact (clippy 1.99) ### 📊 Changes **5 files changed** (+447 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+9 -2) 📝 `crates/horizon-client/src/game/end.rs` (+5 -40) 📝 `crates/horizon-client/src/gfx.rs` (+19 -6) ➕ `crates/horizon-client/src/gfx/end_sky.rs` (+84 -0) ➕ `crates/horizon-client/src/gfx/end_sky/tests.rs` (+330 -0) </details> ### 📄 Description The End sky rebuilt and uploaded 6,144 static vertices every frame alongside its animated flash. Retain those 1,536 tiled quads in an immutable renderer-owned GPU buffer, and draw the flash separately immediately afterward through the existing celestial pipeline. Inactive flashes no longer allocate a vertex vector. The mesh is created on the first enabled End sky frame and reused while its atlas bounds are unchanged. Changed or missing sprite bounds invalidate it, and resource reload/device recreation replace the owning renderer. Existing title, fog, sky-toggle, blending and world draw ordering remain in place. The flash geometry and lighting calculations are unchanged. Validation: - `cargo fmt --all -- --check` and `git diff --check` passed. - `cargo clippy --locked -p horizon-client --no-default-features --lib --bins -- -D warnings` passed. - `cargo test --locked -p horizon-client --no-default-features --lib gfx:: -- --nocapture`: 75 passed, 3 existing benchmarks ignored. - Real Vulkan tests on an RTX 4060 verify the same immutable buffer survives 600 preparations, atlas changes/missing sprites rebuild or clear it, and replacement renderer caches allocate independently. - 100 camera/flash cases produce byte-identical offscreen pixels for combined versus resident/separate draws using the production celestial shader and blend with a synthetic translucent atlas. - A temporary differential probe compared all vertex bytes with the builder from main at `34c3c1cf` for three atlas layouts; all matched. Committed geometry snapshots preserve those results with position quantization to tolerate platform trig rounding. This removes the repeated static geometry build/upload; no FPS or timing improvement is claimed. Validation does not include a full in-game resource-pack reload capture or a fresh vanilla framebuffer comparison. Weather rendering is untouched. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:09:33 +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#3441
No description provided.