fix(water): guard fog/LDS races, OOB masks, NIS NaN, and copyback barriers #519

Open
github-bot wants to merge 1 commit from github-bot/gh-519 into main AGit
Owner

@⁠ZerefDragnee1l on GitHub · 2026-12-06 01:48 UTC · original
ZerefDragnee1l:fix/water-black-squares-shaders-and-barriers → main · +148 −107 · 8 files · 1 commits · open

Splits the water black-squares shader and barrier fixes out of #408 onto current main (companion to #457, which carries the larp-shader lds_meetings / idle_lds_reads changes).

Summary

  • Volumetric / water fog shaders (6871d6e4b3ac9a10, a10179ab7eda0dc3, 926c46bab3b86bd6): Guard log2 inputs against <= 0, prevent WaveActive* NaN lane contamination, validate cluster/slice bounds, and fix LDS min/max reduction synchronization.
  • Mask / scissor update shaders (07fb4c723c4241ed, d3c330847c597f3c): Clamp coordinates and dimensions before mask updates to avoid out-of-bounds UAV/texture writes.
  • NIS linear HDR luminance (crates/larp-gpu/src/nis/NIS_Scaler.h): Clamp luminance dot product before sqrt() to eliminate NaN propagation.
  • D3D12 barriers & copyback sync (crates/larp-gpu/src/barriers.rs, crates/larp-gpu/src/copyback.rs): Add missing LAYOUT_DIRECT_UNORDERED_ACCESS / SHADER_RESOURCE transitions and COMMON copyback global sync barrier.

Related: #457

Verification

  • git diff --check -> clean
  • cargo check -p larp -> exited 0 (larp-gpu and larp build.rs DXC compilation succeeded with 0 errors and 0 new warnings).
**@⁠ZerefDragnee1l** on GitHub · 2026-12-06 01:48 UTC · [original](https://github.com/gamingwithhomie/larp/pull/519) `ZerefDragnee1l:fix/water-black-squares-shaders-and-barriers` → `main` · +148 −107 · 8 files · 1 commits · open Splits the water black-squares shader and barrier fixes out of #408 onto current `main` (companion to #457, which carries the `larp-shader` `lds_meetings` / `idle_lds_reads` changes). ### Summary - **Volumetric / water fog shaders (`6871d6e4b3ac9a10`, `a10179ab7eda0dc3`, `926c46bab3b86bd6`)**: Guard `log2` inputs against `<= 0`, prevent `WaveActive*` NaN lane contamination, validate cluster/slice bounds, and fix LDS min/max reduction synchronization. - **Mask / scissor update shaders (`07fb4c723c4241ed`, `d3c330847c597f3c`)**: Clamp coordinates and dimensions before mask updates to avoid out-of-bounds UAV/texture writes. - **NIS linear HDR luminance (`crates/larp-gpu/src/nis/NIS_Scaler.h`)**: Clamp luminance dot product before `sqrt()` to eliminate NaN propagation. - **D3D12 barriers & copyback sync (`crates/larp-gpu/src/barriers.rs`, `crates/larp-gpu/src/copyback.rs`)**: Add missing `LAYOUT_DIRECT_UNORDERED_ACCESS` / `SHADER_RESOURCE` transitions and `COMMON` copyback global sync barrier. Related: #457 ### Verification - `git diff --check` -> clean - `cargo check -p larp` -> exited 0 (`larp-gpu` and `larp` `build.rs` DXC compilation succeeded with 0 errors and 0 new warnings).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-06 01:54:06 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/519/head:github-bot/gh-519'
git switch 'github-bot/gh-519'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-519'
git switch 'github-bot/gh-519'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-519'
git switch 'github-bot/gh-519'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-519'
git switch 'main'
git merge --squash 'github-bot/gh-519'
git switch 'main'
git merge --ff-only 'github-bot/gh-519'
git switch 'main'
git merge 'github-bot/gh-519'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.