fix(gpu): resolve D3D12 error 646 in ambient depth binding #2

Manually merged
github merged 1 commit from github-bot/gh-2 into main 2026-11-26 14:14:28 +00:00 AGit
Owner

@⁠jeremygold02 on GitHub · 2026-11-26 07:01 UTC · original
jeremygold02:codex/d3d12-ambient-depth-srv → main · +24 −12 · 2 files · 1 commits · merged 2026-11-26 14:09 UTC

Problem

The ambient lighting stand-in used the output image's UAV as a placeholder for depth in the radiance and air passes. The descriptor lookup also accepted an unordered view for a shader-resource lookup. The host then bound a UAV to the compute table that expects a depth SRV, triggering Direct3D 12 debug-layer error 646.

Change

  • Require the descriptor type to match the requested binding. The depth lookup accepts an SRV, and the output-image lookup accepts a UAV.
  • Bind depth in the resolve pass, which reads it. Require the depth SRV's dimensions to match the output image.
  • Leave the depth table unset in the radiance and air passes, which have no depth input. The image retains its UAV binding in all three passes.

Test setup

  • GPU: NVIDIA GeForce RTX 5070 (12 GB VRAM)
  • Driver: NVIDIA 621.01
  • CPU: Intel Core Ultra 7 265K (20 cores, 20 threads)
  • Memory: 32 GB RAM
  • OS: Windows 11 Home 64-bit, build 26200

Verification

Built a clean Windows diagnostics checkpoint containing this fix with cargo build --offline --locked --target-dir target --jobs 2 --profile diag -p victory --features diagnostics. Ran both NVIDIA launcher presets with VICTORY_D3D12_DEBUG=1.

Preset Result D3D12 error 646
Series S Rendered the prologue and continued into later shots 0 occurrences
Series X Rendered the prologue and continued into later shots 0 occurrences

Both validation runs used the integrated local checkpoint. This PR contains only the ambient descriptor-binding change. Frame-rate impact was outside the scope of these checks.

**@⁠jeremygold02** on GitHub · 2026-11-26 07:01 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2) `jeremygold02:codex/d3d12-ambient-depth-srv` → `main` · +24 −12 · 2 files · 1 commits · merged 2026-11-26 14:09 UTC ## Problem The ambient lighting stand-in used the output image's UAV as a placeholder for depth in the radiance and air passes. The descriptor lookup also accepted an unordered view for a shader-resource lookup. The host then bound a UAV to the compute table that expects a depth SRV, triggering Direct3D 12 debug-layer error **646**. ## Change - Require the descriptor type to match the requested binding. The depth lookup accepts an SRV, and the output-image lookup accepts a UAV. - Bind depth in the resolve pass, which reads it. Require the depth SRV's dimensions to match the output image. - Leave the depth table unset in the radiance and air passes, which have no depth input. The image retains its UAV binding in all three passes. ## Test setup - **GPU:** NVIDIA GeForce RTX 5070 (12 GB VRAM) - **Driver:** NVIDIA 621.01 - **CPU:** Intel Core Ultra 7 265K (20 cores, 20 threads) - **Memory:** 32 GB RAM - **OS:** Windows 11 Home 64-bit, build 26200 ## Verification Built a clean Windows diagnostics checkpoint containing this fix with `cargo build --offline --locked --target-dir target --jobs 2 --profile diag -p victory --features diagnostics`. Ran both NVIDIA launcher presets with `VICTORY_D3D12_DEBUG=1`. | Preset | Result | D3D12 error 646 | | --- | --- | --- | | Series S | Rendered the prologue and continued into later shots | 0 occurrences | | Series X | Rendered the prologue and continued into later shots | 0 occurrences | Both validation runs used the integrated local checkpoint. This PR contains only the ambient descriptor-binding change. Frame-rate impact was outside the scope of these checks.
Only the resolve pass uses depth. Require the correct descriptor type and matching dimensions to prevent D3D12 error 646.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:32:42 +00:00
github manually merged commit 7480e961a5 into main 2026-11-26 14:14:28 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.