Keep tiled sun shadows compilable on NVIDIA drivers #582

Closed
github-bot wants to merge 1 commit from github-bot/gh-582 into main AGit
Owner

@⁠Sans0001010 on GitHub · 2026-12-06 03:13 UTC · original
Sans0001010:codex/structured-tiled-shadows → main · +6532 −6165 · 4 files · 1 commits · closed without merging

Why

The native NVIDIA compiler can run out of host memory on the replacement for CS_ShadowRenderTiledCascades (191ecaed66eea3b1). #452 protects affected drivers by falling back to a translated shader. This change lets those drivers use a replacement that completes pipeline creation while keeping the fallback for older shader packages. Related reports include #249 and #230.

Changes

  • Represent the original forward branches with an explicit per-lane block index. Keep both console-wave exchanges and all shadow sampling and output operations.
  • Read the group-uniform tile descriptor once and share it at the existing initialization barrier. Serialize the tile flag update so only one lane modifies the UAV word. The latter adapts the targeted change from #521.
  • Emit matching BLAKE3 sidecars for both heap layouts. The runtime retains the default protection when an older or mismatched DXIL file is present. The existing LARP_NVIDIA_SHADOW_REPLACE overrides still work.

Validation

  • Built both layouts with Windows SDK DXC 1.8 at -O3. The current branch's build produced byte-identical shaders to the ones tested in-game.
  • On the affected Windows NVIDIA machine, an isolated D3D12 pipeline creation with the stock shader exceeded 9 GiB of private commit and did not return within the test limit. The new 1M and 2M variants completed in 3.7 s and 3.6 s, respectively, with about 0.19 GiB peak private commit in the probe.
  • Compared 4,293 branch-outcome sequences against the original lifted control flow, including each wave exchange and the tile epilogue.
  • On the 1.1.6 runtime, the repaired pipeline compiled cold and the game reached the saved street scene with shadows drawn. A subsequent launch reused the pipeline cache without adding a new pipeline for this shader.

The change covers this replacement. The broader wave32 shadow translation work in #432 remains relevant to other tiled passes.

The latest main-branch source passed cargo check --locked --offline -p larp.

**@⁠Sans0001010** on GitHub · 2026-12-06 03:13 UTC · [original](https://github.com/gamingwithhomie/larp/pull/582) `Sans0001010:codex/structured-tiled-shadows` → `main` · +6532 −6165 · 4 files · 1 commits · closed without merging ## Why The native NVIDIA compiler can run out of host memory on the replacement for `CS_ShadowRenderTiledCascades` (`191ecaed66eea3b1`). #452 protects affected drivers by falling back to a translated shader. This change lets those drivers use a replacement that completes pipeline creation while keeping the fallback for older shader packages. Related reports include #249 and #230. ## Changes - Represent the original forward branches with an explicit per-lane block index. Keep both console-wave exchanges and all shadow sampling and output operations. - Read the group-uniform tile descriptor once and share it at the existing initialization barrier. Serialize the tile flag update so only one lane modifies the UAV word. The latter adapts the targeted change from #521. - Emit matching BLAKE3 sidecars for both heap layouts. The runtime retains the default protection when an older or mismatched DXIL file is present. The existing `LARP_NVIDIA_SHADOW_REPLACE` overrides still work. ## Validation - Built both layouts with Windows SDK DXC 1.8 at `-O3`. The current branch's build produced byte-identical shaders to the ones tested in-game. - On the affected Windows NVIDIA machine, an isolated D3D12 pipeline creation with the stock shader exceeded 9 GiB of private commit and did not return within the test limit. The new 1M and 2M variants completed in 3.7 s and 3.6 s, respectively, with about 0.19 GiB peak private commit in the probe. - Compared 4,293 branch-outcome sequences against the original lifted control flow, including each wave exchange and the tile epilogue. - On the 1.1.6 runtime, the repaired pipeline compiled cold and the game reached the saved street scene with shadows drawn. A subsequent launch reused the pipeline cache without adding a new pipeline for this shader. The change covers this replacement. The broader wave32 shadow translation work in #432 remains relevant to other tiled passes. The latest main-branch source passed `cargo check --locked --offline -p larp`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-06 03:17:34 +00:00
github-bot closed this pull request 2026-12-06 03:30:02 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.