GPU: fix D3D12 debug-layer state/type errors in the ambient stand-ins #787

Manually merged
github merged 1 commit from github-bot/gh-787 into main 2026-11-28 19:42:53 +00:00 AGit
Owner

@⁠JoeY54 on GitHub · 2026-11-28 05:53 UTC · original
JoeY54:fix/d3d12-debug-layer-states → main · +27 −2 · 2 files · 1 commits · merged 2026-11-28 19:39 UTC

Summary

Fixes two D3D12 debug-layer errors from the ambient stand-ins in a normal Series X 1440p + DLSS Quality + DLSS FG 2x session. I reported them in #726. Two files change, and nothing changes outside the ambient passes.

Scope change: this PR first also changed the card-copy compare (id=538 on title-buffer card copies, ~56,700 per run). #194 already fixes that, so that commit has been dropped. The original two-commit head was 7a89b07. The branch now holds only the ambient commit, rebased onto current main.

Debug-layer message Count per 240 s debug run, before → after Cause Fix
id=538 ERROR on a depth texture ~2,800–3,300 → 0 The reflections stand-in (Role::Miss) reads the title's depth through its SRV table. At that point the depth is still in the DEPTH_READ state the title's draws left it in. The title resource of the chosen depth view is made DEPTH_READ | SHADER_RESOURCE with ensure_state before the pass. A texture that is not a depth target gets SHADER_RESOURCE only.
id=646 ERROR ~6,000 → 0 The Radiance and Air roles pass the image's UAV handle as depth into root parameter 1, which is a static SRV table. Their keep/mean programs never read t0. This is a different path from #2, which is already on main. The t0 range in the ambient root signature is DESCRIPTORS_VOLATILE. indirect.rs already uses that flag.

Other expected debug-layer output, untouched here: id=645 2× (probe_view_limit heap probes) and id=1378 (full-output viewport over the DLSS render-size target).

Relation to other open PRs:

Validation

Title runs (RTX 5090, driver 621.24, official signed Streamline 2.14.16 / NGX 310.9.16, own legally obtained copy, play-nvidia.ps1 defaults: Series X, native 1440p, DLSS Quality, DLSS FG 2x)

  • These were made with the original two commits on a local integration of 8fc2254 + #479 + #613.
  • The counts above are from a diagnostics build with VICTORY_D3D12_DEBUG=1 and VICTORY_D3D12_DRED=light, over 240 s.
  • An A/B run with VICTORY_AMBIENT_SPECULAR=0 removed the depth-texture 538 before the fix, which attributes it to the reflections stand-in.
  • After the fix, the log still shows Miss and Air passes.
  • Release, 300 s, warm cache: 28.88 fps after 120 s (28.80 before). FG was on for all presents, with 0 errors and exit code 0.
  • Not rerun on the narrowed branch.

On this branch (63b902f + a45bea7; same stable patch-id as the original 7a89b07)

  • cargo build -p victory: passes.
  • cargo clippy -p victory-gpu --all-targets --locked --offline -- -D warnings: fails only on shadow.rs:1708 % 16, which is already on main. It is fixed in #479. The two changed files have no Clippy findings.
  • cargo test -p victory-gpu --lib --locked --offline -- --test-threads=1, under an exclusive GPU lock: 453 passed, 0 failed, 36 ignored, exit 0.

Raw logs stay local.

AI-assisted (Claude); runs on my own hardware.

**@⁠JoeY54** on GitHub · 2026-11-28 05:53 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/787) `JoeY54:fix/d3d12-debug-layer-states` → `main` · +27 −2 · 2 files · 1 commits · merged 2026-11-28 19:39 UTC ## Summary Fixes two D3D12 debug-layer errors from the ambient stand-ins in a normal Series X 1440p + DLSS Quality + DLSS FG 2x session. I reported them in #726. Two files change, and nothing changes outside the ambient passes. **Scope change:** this PR first also changed the card-copy compare (`id=538` on title-buffer card copies, ~56,700 per run). #194 already fixes that, so that commit has been dropped. The original two-commit head was `7a89b07`. The branch now holds only the ambient commit, rebased onto current `main`. | Debug-layer message | Count per 240 s debug run, before → after | Cause | Fix | |---|---|---|---| | `id=538` ERROR on a depth texture | ~2,800–3,300 → 0 | The reflections stand-in (`Role::Miss`) reads the title's depth through its SRV table. At that point the depth is still in the `DEPTH_READ` state the title's draws left it in. | The title resource of the chosen depth view is made `DEPTH_READ \| SHADER_RESOURCE` with `ensure_state` before the pass. A texture that is not a depth target gets `SHADER_RESOURCE` only. | | `id=646` ERROR | ~6,000 → 0 | The Radiance and Air roles pass the image's UAV handle as `depth` into root parameter 1, which is a static SRV table. Their `keep`/`mean` programs never read `t0`. This is a different path from #2, which is already on `main`. | The `t0` range in the ambient root signature is `DESCRIPTORS_VOLATILE`. `indirect.rs` already uses that flag. | Other expected debug-layer output, untouched here: `id=645` 2× (`probe_view_limit` heap probes) and `id=1378` (full-output viewport over the DLSS render-size target). Relation to other open PRs: - Merges cleanly with #194, #63, #124, #818 and #847. - #194 and #393 already conflict with `main` on their own. ## Validation **Title runs** (RTX 5090, driver 621.24, official signed Streamline 2.14.16 / NGX 310.9.16, own legally obtained copy, `play-nvidia.ps1` defaults: Series X, native 1440p, DLSS Quality, DLSS FG 2x) - These were made with the original two commits on a local integration of `8fc2254` + #479 + #613. - The counts above are from a diagnostics build with `VICTORY_D3D12_DEBUG=1` and `VICTORY_D3D12_DRED=light`, over 240 s. - An A/B run with `VICTORY_AMBIENT_SPECULAR=0` removed the depth-texture `538` before the fix, which attributes it to the reflections stand-in. - After the fix, the log still shows `Miss` and `Air` passes. - Release, 300 s, warm cache: 28.88 fps after 120 s (28.80 before). FG was on for all presents, with 0 errors and exit code 0. - Not rerun on the narrowed branch. **On this branch** (`63b902f` + `a45bea7`; same stable patch-id as the original `7a89b07`) - `cargo build -p victory`: passes. - `cargo clippy -p victory-gpu --all-targets --locked --offline -- -D warnings`: fails only on `shadow.rs:1708` `% 16`, which is already on `main`. It is fixed in #479. The two changed files have no Clippy findings. - `cargo test -p victory-gpu --lib --locked --offline -- --test-threads=1`, under an exclusive GPU lock: 453 passed, 0 failed, 36 ignored, exit 0. Raw logs stay local. _AI-assisted (Claude); runs on my own hardware._
The compare after a submission's lists reads the card copies as root SRVs
without transitions, relying on the common state. It was appended to the same
ExecuteCommandLists call as the title's lists, where a CopyBufferRegion into a
copy leaves it promoted to COPY_DEST until the call ends (D3D12 debug layer
538, ~57,000 per 240 s diagnostics run at Series X 1440p + DLSS + FG). Buffers
decay to COMMON at the end of a call, so the compare now starts a call of its
own right behind the lists, in the late and the waited submission paths.

Debug-layer run after the change: 538 on title-buffer card copies 56,687 -> 0;
the run still meets launch/init/stable output/orderly shutdown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The indirect-light and reflection stand-ins bind the depth they read as a
static SRV table (root parameter 1). Two D3D12 debug-layer errors came of it
in a Series X 1440p + DLSS + FG diagnostics run:

- 646 (~6,000 per 240 s): the Radiance and Air roles pass the image's UAV
  handle as the depth; their keep/mean programs read no depth. The range is
  now DESCRIPTORS_VOLATILE.
- 538 (~3,000 per 240 s): the Miss role reads the title's depth texture while
  it is still in the depth-read state its draws left it in. The title
  resource of the chosen depth view is now made DEPTH_READ|SHADER_RESOURCE
  (SHADER_RESOURCE alone for a texture that is no depth target) first.

Debug-layer run after both fixes: 538 0, 646 0; the stand-ins still run, and
the run meets launch/init/stable output/orderly shutdown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 05:54:56 +00:00
Author
Owner

@⁠Aniseto on GitHub · 2026-11-28 07:08 UTC · original

Ran the victory-gpu library suite at 7a89b07 on an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build; VICTORY_D3D12_ADAPTER=NVIDIA.

cargo test -p victory-gpu --lib -- --test-threads=1
453 passed; 0 failed; 36 ignored; 0 measured; 0 filtered out      (exit 0)

All 453 tests pass here with 36 ignored; no skips were reported. The PR has no comments yet, so this is the first datapoint in the thread and the first from an RTX 5070 Ti. These are CPU-side tests of the state/type handling; I did not run a debug-layer session, so the id=538/id=646 error counts from the description were not reproduced here.

Not tested: a real Series X 1440p + DLSS + frame generation debug-layer session, a paired smoke run, the full workspace suite, release profile, AMD and Intel GPUs, native wave64 hosts, Wine, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

**@⁠Aniseto** on GitHub · 2026-11-28 07:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/787#issuecomment-7235741008) Ran the victory-gpu library suite at `7a89b07` on an NVIDIA Blackwell desktop part: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build; `VICTORY_D3D12_ADAPTER=NVIDIA`. ``` cargo test -p victory-gpu --lib -- --test-threads=1 453 passed; 0 failed; 36 ignored; 0 measured; 0 filtered out (exit 0) ``` All 453 tests pass here with 36 ignored; no skips were reported. The PR has no comments yet, so this is the first datapoint in the thread and the first from an RTX 5070 Ti. These are CPU-side tests of the state/type handling; I did not run a debug-layer session, so the `id=538`/`id=646` error counts from the description were not reproduced here. Not tested: a real Series X 1440p + DLSS + frame generation debug-layer session, a paired smoke run, the full workspace suite, release profile, AMD and Intel GPUs, native wave64 hosts, Wine, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-28 07:12 UTC · original · approved these changes

Tested locally merged onto main (63b902f).

  • Merge & Policy: Clean merge; cargo xtask policy passed (294 files ok).
  • Tests (RTX 5090):
    • cargo test -p victory-gpu --lib ambient:: passed (5 passed; 0 failed).
    • cargo test -p victory-gpu --lib draw:: passed (8 passed; 0 failed; 1 ignored).
    • cargo test -p victory-gpu --lib host::card_steps:: passed (9 passed; 0 failed; 1 ignored).
  • Compiled with 0 warnings.

Targeted D3D12 debug-layer state/type correctness fix for card-copy compare and ambient passes. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-28 07:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/787#pullrequestreview-6096431681) · **approved these changes** Tested locally merged onto `main` (`63b902f`). - **Merge & Policy**: Clean merge; `cargo xtask policy` passed (`294 files ok`). - **Tests (RTX 5090)**: - `cargo test -p victory-gpu --lib ambient::` passed (`5 passed; 0 failed`). - `cargo test -p victory-gpu --lib draw::` passed (`8 passed; 0 failed; 1 ignored`). - `cargo test -p victory-gpu --lib host::card_steps::` passed (`9 passed; 0 failed; 1 ignored`). - Compiled with 0 warnings. Targeted D3D12 debug-layer state/type correctness fix for card-copy compare and ambient passes. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
github-bot changed title from GPU: fix D3D12 debug-layer state/type errors in the card-copy compare and ambient stand-ins to GPU: fix D3D12 debug-layer state/type errors in the ambient stand-ins 2026-11-28 14:34:42 +00:00
github-bot force-pushed github-bot/gh-787 from 7a89b0777e to a45bea7de9 2026-11-28 14:34:42 +00:00 Compare
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-28 08:43 UTC · original

Closing this as a duplicate. #194 already fixes the main id=538 error, on the card-copy compare (copies left in COPY_DEST after copies in place), as noted in #726. I should have checked for existing fixes before opening this.

Thanks to Aniseto for the test run on the RTX 5070 Ti.

**@⁠JoeY54** on GitHub · 2026-11-28 08:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/787#issuecomment-7236769180) Closing this as a duplicate. #194 already fixes the main `id=538` error, on the card-copy compare (copies left in `COPY_DEST` after copies in place), as noted in #726. I should have checked for existing fixes before opening this. Thanks to Aniseto for the test run on the RTX 5070 Ti.
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-28 08:52 UTC · original

Reopening with a narrower scope. #194 covers only the card-copy compare 538, so that commit is dropped. The depth-texture 538 from the reflections stand-in and the 646 from the Radiance/Air roles are not fixed elsewhere, and they stay here. New head a45bea7 on current main. The description is updated.

**@⁠JoeY54** on GitHub · 2026-11-28 08:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/787#issuecomment-7236865047) Reopening with a narrower scope. #194 covers only the card-copy compare `538`, so that commit is dropped. The depth-texture `538` from the reflections stand-in and the `646` from the Radiance/Air roles are not fixed elsewhere, and they stay here. New head `a45bea7` on current `main`. The description is updated.
Author
Owner

@⁠Aniseto on GitHub · 2026-11-28 09:00 UTC · original

Re-ran the victory-gpu library suite at a45bea7 after the head moved from 7a89b07; this is a new response in the same thread, not an edit of my earlier report:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build; VICTORY_D3D12_ADAPTER=NVIDIA.

cargo test -p victory-gpu --lib -- --test-threads=1
453 passed; 0 failed; 36 ignored; 0 measured; 0 filtered out      (exit 0)

Same counts as at the previous head: all 453 tests pass with 36 ignored and no skips. These are CPU-side tests; I did not run a debug-layer session, so the id=538/id=646 error counts from the description were not reproduced on either head.

Not tested: a real Series X 1440p + DLSS + frame generation debug-layer session, a paired smoke run, the full workspace suite, release profile, AMD and Intel GPUs, native wave64 hosts, Wine, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

**@⁠Aniseto** on GitHub · 2026-11-28 09:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/787#issuecomment-7236952167) Re-ran the victory-gpu library suite at `a45bea7` after the head moved from `7a89b07`; this is a new response in the same thread, not an edit of my earlier report: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build; `VICTORY_D3D12_ADAPTER=NVIDIA`. ``` cargo test -p victory-gpu --lib -- --test-threads=1 453 passed; 0 failed; 36 ignored; 0 measured; 0 filtered out (exit 0) ``` Same counts as at the previous head: all 453 tests pass with 36 ignored and no skips. These are CPU-side tests; I did not run a debug-layer session, so the `id=538`/`id=646` error counts from the description were not reproduced on either head. Not tested: a real Series X 1440p + DLSS + frame generation debug-layer session, a paired smoke run, the full workspace suite, release profile, AMD and Intel GPUs, native wave64 hosts, Wine, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
github-bot referenced this pull request from a commit 2026-11-28 19:41:56 +00:00
github manually merged commit 075d08a5aa into main 2026-11-28 19:42:53 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/trustno1-coder--VIctory-NVIDIA!787
No description provided.