d3d12: leave out traced shadow passes without the BVH builder #3379

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u origin "github-pr/3379:github-pr/3379"
git switch "github-pr/3379"
Open
leonida/mandy
Luislariosss wants to merge 1 commit from github-pr/3379 into main

This branch is out-of-date with the base branch

Conversation
Reviewers 0 approvals
  • No reviewers
Details
This pull request is blocked because it's outdated.
This branch is out-of-date with the base branch
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 'github-pr/3379:github-pr/3379'
git switch 'github-pr/3379'
Luislariosss commented 2026-12-03 18:02:47 +00:00

Claimed in the coordination issue as: D3D12-GPU-SKIP-RT-SHADOW-WITHOUT-BVH (https://github.com/ProjectLeonida/mandy/issues/3312#issuecomment-7387497732)

Depends on: none

What and why

Without LEONIDA_BVH_BUILDER=1 (and without hardware ray tracing) no acceleration structure is ever built, yet the traced shadow passes still run: CS_GenerateShadowMasks_Raytraced, CS_RTShadowTrace, CS_RaytraceShadows* and the rest of RT_SHADOW_NAMES. They trace whatever the structure's memory holds, so the tiles the title marks for rays (the edges of the cascades' shadows, and hair) come out speckled with shadow at random.

The change leaves those passes out by default when no structure exists. LEONIDA_SKIP_RT_SHADOW stays the explicit override: 1 skips them even with a builder, 0 runs them even without one (the A/B), and unset decides from whether a structure can exist (LEONIDA_BVH_BUILDER=1 or hwrt::active()). Nothing changes for builds that do build a structure.

Tested

  • cargo test -p leonida-gpu --offline --lib -- pipeline::make --test-threads=1: 37 passed.
  • New test skip_rt_shadow_for over the six combinations (structure on/off × switch unset/1/0); red by reverting only the decision to the old expression.
  • cargo clippy -p leonida-gpu --all-targets --offline: clean.
  • cargo xtask policy --staged: ok. (cargo test -p xtask fails only in repository_passes_policy, on three files that were already over the size limit upstream: leonida-gpu/src/host.rs, leonida-gpu/src/indirect/amplify_dxil.rs, leonida-shader/src/emit/lower.rs.)
  • docs/switches.md regenerated for the changed description.

GPUs tested: n/a (no in-game run; the decision is CPU-side).

AI-assisted: yes — implemented and reviewed by coding agents; reviewed by the submitter.

Checklist

  • Based on current main and merges cleanly (rebased on 8da914820).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption.
  • No new translator rule.
Claimed in the coordination issue as: D3D12-GPU-SKIP-RT-SHADOW-WITHOUT-BVH (https://github.com/ProjectLeonida/mandy/issues/3312#issuecomment-7387497732) Depends on: none ### What and why Without `LEONIDA_BVH_BUILDER=1` (and without hardware ray tracing) no acceleration structure is ever built, yet the traced shadow passes still run: `CS_GenerateShadowMasks_Raytraced`, `CS_RTShadowTrace`, `CS_RaytraceShadows*` and the rest of `RT_SHADOW_NAMES`. They trace whatever the structure's memory holds, so the tiles the title marks for rays (the edges of the cascades' shadows, and hair) come out speckled with shadow at random. The change leaves those passes out by default when no structure exists. `LEONIDA_SKIP_RT_SHADOW` stays the explicit override: `1` skips them even with a builder, `0` runs them even without one (the A/B), and unset decides from whether a structure can exist (`LEONIDA_BVH_BUILDER=1` or `hwrt::active()`). Nothing changes for builds that do build a structure. ### Tested - `cargo test -p leonida-gpu --offline --lib -- pipeline::make --test-threads=1`: 37 passed. - New test `skip_rt_shadow_for` over the six combinations (structure on/off × switch unset/1/0); red by reverting only the decision to the old expression. - `cargo clippy -p leonida-gpu --all-targets --offline`: clean. - `cargo xtask policy --staged`: ok. (`cargo test -p xtask` fails only in `repository_passes_policy`, on three files that were already over the size limit upstream: `leonida-gpu/src/host.rs`, `leonida-gpu/src/indirect/amplify_dxil.rs`, `leonida-shader/src/emit/lower.rs`.) - `docs/switches.md` regenerated for the changed description. GPUs tested: n/a (no in-game run; the decision is CPU-side). AI-assisted: yes — implemented and reviewed by coding agents; reviewed by the submitter. ### Checklist - [x] Based on current `main` and merges cleanly (rebased on `8da914820`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption. - [x] No new translator rule.
First-time contributor

Independent local verification of this change (I changed no code).

  • Head c42ae891, merge base 6ced7a6c. The new test is absent on the base: git grep -F traced_shadows_are_left_out_without_the_builder_unless_asked_for 6ced7a6c -- d3d12/crates/leonida-gpu/src/pipeline/make.rs -> exit 1.
  • On the PR head: cargo test -p leonida-gpu --locked --lib pipeline::make::tests::traced_shadows_are_left_out_without_the_builder_unless_asked_for -- --exact -> 1 passed / 788 filtered, with a private CARGO_TARGET_DIR.
  • git diff --check 6ced7a6c c42ae891 -> clean. python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/pipeline/make.rs d3d12/docs/switches.md -> clean.

GPUs tested: none (synthetic pipeline-selection inputs; no device-gated test). Driver: n/a. No game data, assets or extracted shaders were used or attached; no in-game run was attempted.

AI-assisted: yes, Hy4 flash (verification only). No approval implied; this is a local test report.

Independent local verification of this change (I changed no code). - Head `c42ae891`, merge base `6ced7a6c`. The new test is absent on the base: `git grep -F traced_shadows_are_left_out_without_the_builder_unless_asked_for 6ced7a6c -- d3d12/crates/leonida-gpu/src/pipeline/make.rs` -> exit 1. - On the PR head: `cargo test -p leonida-gpu --locked --lib pipeline::make::tests::traced_shadows_are_left_out_without_the_builder_unless_asked_for -- --exact` -> 1 passed / 788 filtered, with a private `CARGO_TARGET_DIR`. - `git diff --check 6ced7a6c c42ae891` -> clean. `python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/pipeline/make.rs d3d12/docs/switches.md` -> clean. GPUs tested: none (synthetic pipeline-selection inputs; no device-gated test). Driver: n/a. No game data, assets or extracted shaders were used or attached; no in-game run was attempted. AI-assisted: yes, Hy4 flash (verification only). No approval implied; this is a local test report.
Sign in to join this conversation.
No description provided.