GPU: rebind compute view-mark root descriptors after depth-twin conversion #2153
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2155"
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 Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T06:24:59Z.
Problem
State::bind(crates/victory-gpu/src/draw.rs) bindsp.marks(VIEW_MARKSroot SRV andVIEW_WRITESroot UAV) before iterating overp.stages. When a compute shader's descriptor table references a 16-bit depth texture whose writable twin was written earlier,State::tablestransitions the texture viaTwin::copy, whose computeconverter()replaces the command list's compute root signature and setsneed_rebind.The subsequent
if list.take_rebind()block restoresSetComputeRootSignature(&p.root)andSetPipelineState(&p.pso)(invalidating all previously bound compute root parameters per D3D12 rules), while only per-stage root arguments are bound below it — leavingVIEW_MARKSandVIEW_WRITESunbound for the dispatch.Changes
SetComputeRootShaderResourceViewandSetComputeRootUnorderedAccessViewforp.marksimmediately afterSetComputeRootSignature(&p.root)insideif list.take_rebind().draw::tests::compute_view_marks_rebind_after_depth_twin_conversion: writes a 16-bit depth twin (format = 118), binds aview_marks = truecomputeHostPipelinereading that depth SRV (triggeringTwin::copyandtake_rebind) and writing page1of a trackedShadowbuffer, verifying zero D3D12 Debug Layer errors andcopy_back_markswriteback across RTX 5090, AMD Radeon Graphics, and D3D12 WARP.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T06:33:10Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Compute view-mark root descriptors rebound after depth-twist — descriptor rebind fix for a specific transform path; narrow but plausible.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T11:53:24Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:cargo test -p victory-gpu draw::tests: 6/6 passed on RTX 5090, 6/6 passed on WARP (includingcompute_view_marks_rebind_after_depth_twin_conversion).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T11:26:09Z.
Automated triage for the maintainers.
Merge candidate.
The bug is real. On
main,State::bind(crates/victory-gpu/src/draw.rs) binds thep.marksroot SRV and UAV before the per-stage loop. Whenself.tablesmakes a depth texture readable viaTwin::copy, the twin's compute converter swaps the root signature. Thelist.take_rebind()branch then callsSetComputeRootSignature(&p.root)again, which clears every root argument bound before it, and only the per-stage arguments are rebound below. So a compute dispatch that marks its view writes ran withVIEW_MARKS/VIEW_WRITESunbound. The fix keeps the mark addresses from the first bind and sets them again right afterSetComputeRootSignaturein that branch. The graphics path doesn't need it, because there the root signature is not reset.The new test
compute_view_marks_rebind_after_depth_twin_conversioncovers the real path:view_markscompute pipeline that reads it, checking throughtwin::COPIESthat the conversion ran.copy_back_marks.The test is long, but every part of it is needed to reach this branch.
Shader::for_testis test-only. CI is passing (check), and the PR merges cleanly.Generated by Claude Code