GPU: retain immutable SRVs for each depth-plane twin #1111
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1111
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1111"
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?
@ghptc on GitHub · 2026-11-28 13:26 UTC · original
ghptc:review/depth-plane-srvs→main· +112 −87 · 2 files · 1 commits · merged 2026-11-29 00:24 UTCA command list can reference a depth-plane SRV after its slot has been rewritten. The plane pass uses one descriptor per (slice, mip), so one texture with 257 layers can lap the 256-entry ring before submission. The first draw then samples the last layer. This patch stores an immutable shader-visible SRV heap on the depth twin. Existing command-list references to the twin retain its descriptors through execution.
The regression draws a 4×4 class mask with depth EQUAL into R8_UNORM and maps the result. Only seven texels in layer zero should light. Layers 1–256 contain class 65 throughout.
[0,255,0,255,255,0,255,0,0,0,255,0,255,0,0,255]The independent branch also passed the stencil-plane copy control. #1018 addresses when the producer publishes a depth plane on the same command list. This regression exercises descriptor identity and reproduces independently on the common base. The frequency in gameplay remains unknown.
Reproduce
Start in a clean checkout of this PR's head, on Linux with cargo-xwin, Rust and the x64 Windows MSVC SDK/CRT. Measurements used Rust 1.98.1, cargo-xwin 0.24.2, Arch Linux, NVIDIA 620.73.04, Proton Experimental 11.0-20261123b, DXVK v3.1.1-240-g9e57fa0b2c5b495 and VKD3D-Proton 3.2.0 (30b0eb9bc12dc9f). Set
PROTON_FILESto Proton's files directory,SYNTHETIC_PREFIXto an initialized test-only prefix with Proton DXGI/D3D12/D3D12Core, andDXC_DIRto the x64 DLL directory from Microsoft DXC v1.8.2505.1. SetMS_FXCto a separately supplied x64 Microsoft d3dcompiler_47.dll. We used version 10.0.17134.12 to control for a separate builtin-compiler problem.CI
Windows CI on this head stopped at the same two Clippy diagnostics as its exact base, in
emit/mod.rsandshadow.rs. The hosted test step did not run. In an independent checkout with the four lint-only changes from #957 applied, Rust 1.98.1 passed Windows-target workspace Clippy with all targets in both default and all-features configurations (--locked -- -D warnings). PR run · Base run@sawetco on GitHub · 2026-11-28 13:52 UTC · original
Independent native D3D12 A/B on an RTX 5070 12 GB with Windows 11 build 26300, NVIDIA 621.40 and Rust 1.98.1. I used the hardware adapter and the regression's test hunks in
resource.rson base63b902f, then ran the same cases at3826f89.The base returned sixteen
255bytes. The PR passed the full byte comparison against[0,255,0,255,255,0,255,0,0,0,255,0,255,0,0,255]. Both runs used the synthetic fixture with the game closed.@upipibi on GitHub · 2026-11-28 21:41 UTC · original
Tested on Ampere: RTX 3070 (
10de:2484), driver 616.56, native Windows 11 Pro 10.0.26100, rustc 1.98.1. Debug test profile. The system WARP is the one that ships with Windows.3826f89f3, merged onto main77df871e5(--no-ff, clean, no conflicts). The PR's base is63b902f, 265 commits behind main, and 59 of those commits touchhost.rsorresource.rs. The merge still changes the same two files by the same amounts as the PR:host.rs+70/-70,resource.rs+42/-17. The head was still3826f89f3when I finished.Ampere reproduces the base failure, and the PR fixes it. With main's
host.rs, the 257-slice draw lights all 16 texels of slice zero, on the 3070 and on WARP. That is the same readback as the description's and sawetco's RTX 5070 results. With the PR, it lights the seven expected texels on both adapters, in every run.The test
The readback of slice zero was the same in all six runs, and it matches the test's
expected:I also ran the two non-ignored neighbours,
a_depth_planes_twin_is_drawn_into_the_plane(the same helper with 1 slice) anda_stencil_planes_twin_reaches_the_plane, once on each adapter: 2 passed, 0 failed, 0 ignored each time. The 1-slice readback is the same seven texels.VICTORY_D3D12_WARPdoes nothing without--features diagnostics(host.rs:957,cfg!(feature = "diagnostics")). I checked this: a default-features run withVICTORY_D3D12_WARP=1opened the 3070. The WARP figures above all come from the diagnostics build.Two notes on silent passes:
a_depth_planes_twin_is_drawn_into_the_planeis nowlet _ = draw_depth_classes(1);. It passes without drawing if no host device opens or the depth twins are off (VICTORY_DEPTH_TWINS=0), as it did before the PR. The new test uses.expect(...), so it fails in that case instead.Adapters seen
I added a temporary
eprintln!indraw_depth_classes, afterhost(). It resolveshost.device.GetAdapterLuid()throughEnumAdapterByLuidand printsGetDesc1, and it prints the 16 coverage bytes before the assert. I removed it before the lib suites.10de:24840x0VICTORY_D3D12_WARP=110de:24840x0--features diagnostics,VICTORY_D3D12_WARP=11414:008c0x2(software)Negative control: main's
host.rs, PR'sresource.rsgit checkout 77df871e5 -- crates/victory-gpu/src/host.rs. This keeps the PR's test, and the newTwin::plane_viewsfield is left unused.git diff --stat 77df871e5 -- crates/:resource.rsonly, +52/-17 (the PR's +42/-17 plus my temporary print). It builds with one extra warning,field plane_views is never read.All six runs panicked the same way:
The two neighbours still pass on main's
host.rson both adapters (2 passed, 0 failed, 0 ignored), and the 1-slice readback is the correct seven texels. So only the 257-slice case separates the two, as the description says.All 16 texels lit is what the ring would give. The test's other 256 layers hold class 65, which the draw lights at every texel. Main's
PLANE_VIEWSring has 256 slots, so slice 256's view overwrites slot 0 before the list runs. That explanation comes from reading the code, not from a measurement.cargo test -p victory-gpu --lib --locked(hardware, default features)77df871e5: 550 passed, 0 failed, 43 ignored in all 5 runs.The run-1 failure was
watch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_view(watch.rs:4764,left: Some([18664039]),right: Some([])). This is a CPU-side page-guard test in a file the PR does not change. It passed alone straight after, and in both later full runs. I count it as a flake: 1 failure in 3 merge runs and 0 in 5 main runs. I can't tell whether the PR makes it more likely.The PR adds no new compiler warnings in the lib test build. The six warnings in
victory-gpuand the one invictory-shader(unusedcolour) are all in code the PR does not touch.CI
gh pr checks 1111:checkfails. The description says it stops at two Clippy diagnostics that the base has too (emit/mod.rs,shadow.rs). I did not run clippy.Overlap
d4b73ec90) supersedes the #1018 mentioned in the description and changes the same two files plusdraw.rs.git merge-treeof the two heads auto-mergeshost.rs. It has one conflict, inresource.rs, and that conflict is in the test: both PRs rewrite the body ofa_depth_planes_twin_is_drawn_into_the_plane. #1541 does not touchPLANE_VIEWSorrecord_plane_pass's descriptor handling.host.rs.git merge-treewith #1111 is clean.git merge-tree, and neither touches the plane pass.Not tested
diagnosticslib suite, and the rest of the workspace.AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.