d3d12: support multi-slice R16/R32 depth-UAV pairs #519
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/519"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-29T19:04:05Z.
Summary
Narrowed #519 to multi-slice
R16/R32depth-UAV pairs only (split out per@brcly's review; the opt-in memory-wait stall release change has been moved off this PR toglovepost/TuxBox:feat/d3d12-opt-in-memory-wait-releaseuntil ProjectScarlett game evidence is collected):runtime/d3d12/src/device/depth.rs&device/views/creation.rs: Pairs multi-sliceDXGI_FORMAT_R16_TYPELESS/DXGI_FORMAT_R32_TYPELESS(includingTexture2DArrayUAV views with slice bounds validation) alongsideR32G8X24_TYPELESS/D16_UNORM_S8_UINT, mapping initialUNORDERED_ACCESSstates appropriately for single-plane pairs.runtime/d3d12/src/commands/depth.rs,commands/barriers.rs,device/resources.rs: Extends subresource validation (subresource < pair.slices * pair.planes) and per-slice depth-UAV copy/synchronization across array slices.runtime/d3d12/src/tests/commands/depth.rs&tests/device/depth.rs: Adds unit tests coveringpair_primary,host_uav_desc,initial_uav_maps_to_copy_source_only_for_single_plane_pairs, and command-side multi-slice depth sync.Verification
DXC=<dxc> python3 tuxbox.py check --no-gpuon rebasedorigin/main6bab5478): 9/9 passed (739Python tests OK with1skipped,648lib +3bin +2integration shader compiler,120DXBC,24XG layout with1ignored,7XG entry point,22storage codec,9ACP HAL, D3D12 Windows typecheck).cargo check --tests --target x86_64-pc-windows-msvc --manifest-path runtime/d3d12/Cargo.toml): passed cleanly.6bab5478. Prior combined commit (f1c5e681) passed10/10check_d3d12_gpu.pyand126/126tuxbox.py verifyon both NVIDIA RTX 2070 SUPER (10de:1e84) and AMD RX 9070 XT (1002:13c0).AI-assistance disclosure
Prepared and verified with AI-assisted coding tools (submitting contributor verified builds, diffs, and test runs).
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T21:41:55Z.
Thanks. Two separate things here, and one holds it:
main, a GPU memory wait that nothing is going to write is released after the stall timeout, because, inmain's own words, "a queue held forever trips the title's GPU watchdog". This PR makes that release opt-in (TUXBOX_MEMORY_WAIT_RELEASE_SECS), so by default such a queue is held forever. ProjectScarlett hits these waits (the frame log countsmemory_waits_released), so this would need game runs showing it doesn't end in the title's watchdog. Without that evidence, we'd keepmain's default.R16/R32depth-UAV pairing is unrelated and looks reasonable.Could you split them? The depth-UAV part can then be reviewed on its own, and the release change can come with game evidence.
Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-29T22:37:42Z.
@brcly Updated #519 on
main(6bab5478, commitac493db5), narrowed to multi-sliceR16/R32depth-UAV pairs only:barriers.rs,commands/depth.rs,device/depth.rs,device/resources.rs,device/views/creation.rs, andtests/{commands,device}/depth.rs).TUXBOX_MEMORY_WAIT_RELEASE_SECS,memory_wait.rs,release_timeout.rs,memory_wait_regressions.rs) out toglovepost/TuxBox:feat/d3d12-opt-in-memory-wait-releasewithout opening a PR yet until we collect ProjectScarlettTUXBOX_FRAME_LOG/ watchdog evidence.tuxbox.py check --no-gpu(9/9) andcargo check --tests --target x86_64-pc-windows-msvcontuxbox-d3d12. ProjectScarlett was not re-run since splitting.Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-30T01:12:58Z.
Rebased onto
main(f482572a, commit0d767e3a3a03) with no functional changes fromac493db5, and ran the changed GPU checks on NVIDIA (headlessxvfb-runwithWAYLAND_DISPLAY=""):WAYLAND_DISPLAY="" TUXBOX_CHECK_JOBS=2 DXC=<dxc> xvfb-run -a -s "-screen 0 2560x1440x24" python3 tuxbox.py check --changed --adapter 10de:1e84 --proton <proton> --prefix <prefix> --windows-dxc <windows-dxc>10de:1e84), driver620.73.04,GE-Proton11-14Lanes and fixtures on the GPU(d3d12-*,guest-frame,present,lanes,lanes-*) and allD3D12 regression controls(22/22) passed (13 passed, 0 failed, 0 not run).Evidence: TuxBox check of 0d767e3a3a03, no uncommitted changes, GPU 10de:1e84: 13 passed, 0 failed, 0 not runImported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T01:46:59Z.
The AMD check you were missing, on
0d767e3a: AMD iGPU (1002:13c0, RADV, Mesa 26.0.8, GE-Proton11-14, Linux), fullpython tuxbox.py check: 199 pass, 0 fail. A game was loading on the other card for part of it. ProjectScarlett was not run on this commit.Evidence: TuxBox check of
0d767e3a3a, no uncommitted changes, GPU 1002:13c0: 14 passed, 0 failed, 0 not runImported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T04:12:23Z.
Heads-up: main just landed a large cleanup (up to
e5d2e913), so this PR needs a rebase.rustfmt.toml).unwrap(), lossyascasts and undocumentedunsafeoutside tests.cargo fmt --check, rustdoc with warnings denied, and Miri on the providers' unit tests.The least painful way is to format your branch first, so the rebase only shows real changes:
Then run
python tuxbox.py check --no-gpu, which now includes the format step.If clippy flags something new:
Fromfor widening,TryFromfor narrowing, and a mask for bit fields.unwrap(): use?, orexpectwith the reason it can't fail.unsafeblock: it needs a// SAFETY:comment.CONTRIBUTING's "Code checks" section lists the commands. Thanks!