[PR #4448] [MERGED] Shader packs 8/12: atomics on shared vectors, Iris camera uniforms #5630

Closed
opened 2026-11-03 05:13:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4448
Author: @PzmuV1517
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: shader-packs/08


📝 Commits (7)

  • fcd2161 Shader packs: atomic functions on a component of a shared integer vector
  • 6e385e7 Shader packs: Iris's camera uniforms
  • 62a673e Shader packs: eye uniforms are the player's in third person, compound assignments on atomic vectors
  • 888fc0f Shader packs: relativeEyePosition points from the eye to the camera, uint indices on split vectors
  • fd94b69 Merge the stack below (main merged) into #4448
  • 8f43b2d Merge main into #4448
  • 96fbc60 Shader packs: atomic vector rewrites carry main's preprocessor warnings

📊 Changes

6 files changed (+429 additions, -4 deletions)

View changed files

📝 crates/horizon-client-render/src/camera.rs (+8 -0)
📝 crates/horizon-client-render/src/gfx.rs (+4 -0)
📝 crates/horizon-client-render/src/gfx/pack_uniforms.rs (+41 -4)
📝 crates/horizon-client/src/game.rs (+10 -0)
➕ crates/horizon-shaders/src/translate/atomic_vectors.rs (+349 -0)
📝 crates/horizon-shaders/src/translate/mod.rs (+17 -0)

📄 Description

Part 8 of 12 of the shader pack work from #3737. It builds on part 7 (#4447): this branch is that one plus the commits below, so review only these:

  • fcd216128 Shader packs: atomic functions on a component of a shared integer vector
  • 6e385e741 Shader packs: Iris's camera uniforms
  • 62a673ec2 Shader packs: eye uniforms are the player's in third person, compound assignments on atomic vectors
  • 888fc0faf Shader packs: relativeEyePosition points from the eye to the camera, uint indices on split vectors

What and why

atomic functions on a component of a shared integer vector (fcd216128)

atomicAdd(sums[i], n) and atomicMax(lights[k].w, w) on a shared ivecN or uvecN are GLSL that naga can't express (it has no atomic vectors): such a vector, or array of vectors, becomes an array of its components, a component an element of it, and the whole vector is read and written through functions of ours. Rethinking Voxels' light lists use them.

Iris's camera uniforms (6e385e741)

cameraPositionInt and cameraPositionFract (and their previous values) are the camera's whole blocks and the rest, exact however far from the origin; eyePosition, relativeEyePosition, playerLookVector and playerBodyVector are the eye and where it looks, the camera being the eye in first person. The previous camera position is kept in double precision for them.

eye uniforms are the player's in third person, compound assignments on atomic vectors (62a673ec2)

eyePosition, playerLookVector and playerBodyVector came from the camera, which a third-person
view backs away from the player (and turns around in front view); they are the camera
entity's eye and rotation now, and relativeEyePosition is the eye from the camera.

A shared vector split for atomic functions took sums += v to hz_get_sums() += v, which does
not compile; compound assignments write through the setter. Array sizes of several tokens
are kept whole. Tests cover components, swizzles, whole reads and writes, arrays and a
program compiling end to end.

relativeEyePosition points from the eye to the camera, uint indices on split vectors (888fc0faf)

Vanilla reference

Horizon-only: vanilla has no shader packs. Nothing changes unless a pack is selected.

Self-check

pr_ready (tools/pr_ready.py --quick on Mac, against origin/main at 27cb8f96b, 2 min 29 s)

Check Result
Scope ⚠️ 184 files, +124316 −264; 124439 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ✅ 495 passed (24 s)
rustfmt ✅ (4 s)
Rust ⚠️ 1.98.1 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ✅ (31 s)
tests: workspace ❌ 2562 passed, 7 failed (1 min 2 s)
doc tests ✅ 0 passed (4 s)
content root tests ✅ 7 passed (18 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (1 s)
launcher tests ❌ 315 passed, 1 failed (3 s)
Parity ➖ 359 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 347 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Failures that aren't from this stack:

  • The horizon-port-pack resource pack tests and the launcher's modpacks::tests::resource_only_profile_can_play_without_enabling_or_overwriting_packs fail with "/var: not an ordinary directory" on macOS, where /var is a symlink. The resource pack tests fail the same way on main itself, and this stack changes neither horizon-port-pack nor the launcher.

🔄 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/4448 **Author:** [@PzmuV1517](https://github.com/PzmuV1517) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shader-packs/08` --- ### 📝 Commits (7) - [`fcd2161`](https://github.com/horizon-rust/horizon/commit/fcd21612876425d80f0b2a4753a971e5653f503e) Shader packs: atomic functions on a component of a shared integer vector - [`6e385e7`](https://github.com/horizon-rust/horizon/commit/6e385e741f4e389f611cc9c20c4e435e29e54c50) Shader packs: Iris's camera uniforms - [`62a673e`](https://github.com/horizon-rust/horizon/commit/62a673ec2ccc8e32919eeb35e1196bc468d7b613) Shader packs: eye uniforms are the player's in third person, compound assignments on atomic vectors - [`888fc0f`](https://github.com/horizon-rust/horizon/commit/888fc0fafd8f34f10433f1e161d95a3a9e118780) Shader packs: relativeEyePosition points from the eye to the camera, uint indices on split vectors - [`fd94b69`](https://github.com/horizon-rust/horizon/commit/fd94b69918bd136f75807f12cc5637752afcc78d) Merge the stack below (main merged) into #4448 - [`8f43b2d`](https://github.com/horizon-rust/horizon/commit/8f43b2de7c32031aed65d57f520b266f26565b21) Merge main into #4448 - [`96fbc60`](https://github.com/horizon-rust/horizon/commit/96fbc6093c8489122a735e609703807d04776c1b) Shader packs: atomic vector rewrites carry main's preprocessor warnings ### 📊 Changes **6 files changed** (+429 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/camera.rs` (+8 -0) 📝 `crates/horizon-client-render/src/gfx.rs` (+4 -0) 📝 `crates/horizon-client-render/src/gfx/pack_uniforms.rs` (+41 -4) 📝 `crates/horizon-client/src/game.rs` (+10 -0) ➕ `crates/horizon-shaders/src/translate/atomic_vectors.rs` (+349 -0) 📝 `crates/horizon-shaders/src/translate/mod.rs` (+17 -0) </details> ### 📄 Description Part 8 of 12 of the shader pack work from #3737. It builds on part 7 (#4447): this branch is that one plus the commits below, so review only these: - `fcd216128` Shader packs: atomic functions on a component of a shared integer vector - `6e385e741` Shader packs: Iris's camera uniforms - `62a673ec2` Shader packs: eye uniforms are the player's in third person, compound assignments on atomic vectors - `888fc0faf` Shader packs: relativeEyePosition points from the eye to the camera, uint indices on split vectors ## What and why **atomic functions on a component of a shared integer vector** (`fcd216128`) atomicAdd(sums[i], n) and atomicMax(lights[k].w, w) on a shared ivecN or uvecN are GLSL that naga can't express (it has no atomic vectors): such a vector, or array of vectors, becomes an array of its components, a component an element of it, and the whole vector is read and written through functions of ours. Rethinking Voxels' light lists use them. **Iris's camera uniforms** (`6e385e741`) cameraPositionInt and cameraPositionFract (and their previous values) are the camera's whole blocks and the rest, exact however far from the origin; eyePosition, relativeEyePosition, playerLookVector and playerBodyVector are the eye and where it looks, the camera being the eye in first person. The previous camera position is kept in double precision for them. **eye uniforms are the player's in third person, compound assignments on atomic vectors** (`62a673ec2`) eyePosition, playerLookVector and playerBodyVector came from the camera, which a third-person view backs away from the player (and turns around in front view); they are the camera entity's eye and rotation now, and relativeEyePosition is the eye from the camera. A shared vector split for atomic functions took sums += v to hz_get_sums() += v, which does not compile; compound assignments write through the setter. Array sizes of several tokens are kept whole. Tests cover components, swizzles, whole reads and writes, arrays and a program compiling end to end. **relativeEyePosition points from the eye to the camera, uint indices on split vectors** (`888fc0faf`) ## Vanilla reference Horizon-only: vanilla has no shader packs. Nothing changes unless a pack is selected. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Mac, against origin/main at 27cb8f96b, 2 min 29 s) | Check | Result | | --- | --- | | Scope | ⚠️ 184 files, +124316 −264; 124439 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ✅ 495 passed (24 s) | | rustfmt | ✅ (4 s) | | Rust | ⚠️ 1.98.1 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ✅ (31 s) | | tests: workspace | ❌ 2562 passed, 7 failed (1 min 2 s) | | doc tests | ✅ 0 passed (4 s) | | content root tests | ✅ 7 passed (18 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (1 s) | | launcher tests | ❌ 315 passed, 1 failed (3 s) | | Parity | ➖ 359 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 347 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Failures that aren't from this stack: - The `horizon-port-pack` resource pack tests and the launcher's `modpacks::tests::resource_only_profile_can_play_without_enabling_or_overwriting_packs` fail with "/var: not an ordinary directory" on macOS, where `/var` is a symlink. The resource pack tests fail the same way on main itself, and this stack changes neither `horizon-port-pack` nor the launcher. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:56 +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#5630
No description provided.