GPU: track D3D12 shadow-buffer states (#1670) #1690
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1691"
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 Elensito on 2026-11-24T20:47:13Z.
What changed
Fixes #1670
Validation
cargo test -p victory-gpucargo xtask policyVICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --features diagnostics shadow::tests::buffer_states_follow_submission_order_and_combine_reads -- --nocaptureThe reported RTX 5080 case could not be reproduced on that hardware locally.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T20:57:02Z.
Review: APPROVED
Verified locally merged onto
origin/main(Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):cargo test -p victory-gpu— 51 passed, 0 failed (1 ignored) on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(includingbuffer_states_follow_submission_order_and_combine_reads)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— okClean D3D12 shadow-buffer state tracking across submission order and combined read states. Looks good.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T21:42:13Z.
Review: COMMENTED
Static review only: Windows-only code (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff.
D3D12 shadow-buffer states are tracked per submission order: buffer_state() queries the resource state, done() records completion against the shadow, and buffer_states_follow_submission_order_and_combine_reads tests ordering + read combining on a real device. This is the foundation for correct barrier elision on copied buffers — please make sure the Windows hardware test ran, since state tracking bugs show up as device removal or corruption, not test failures on macOS (which cannot run any of this).
Imported from Marvisak/VIctory. Originally posted by Headache3318 on 2026-11-25T01:09:01Z.
Independent second-read at head
667e7dc9a4.This is a massive architectural simplification despite the modest title: 132 files changed, +2,270 / -37,366 lines. Several internal crates and features are removed (memory.rs page-table approach, bindless.rs, pipelines.rs, shaderpack.rs, publish.rs, many diagnostic features, HostList::id breadcrumb matching, range.rs).
What the PR adds: buffer state tracking on shadow buffers via
HostList::buffer_state()andShadow::state(AtomicU32), combining consecutive read states (VERTEX | SRV) and resetting on writes (UAV), mirroring the existing texture state model. New test validates the tracking.Correctness concerns: three
shadow.gpu_writes(list, address, len)calls are removed, so root UAV write-backs are no longer copied back to title memory — shader writes through root UAVs will be lost. Theupdate_busypath that copied title writes under GPU write ranges is gone, which could cause stale constants to reach the GPU. Off-element buffer views (for_view) andkeep_writesare removed.Recommendation: The new buffer state tracking itself is clean and well-tested, consistent with the existing texture state model. But the scope is dramatically larger than the title suggests, and several correctness paths are gone. These removals should be documented as intentional simplifications with a note on what breaks. The removed test coverage should be restored or replaced. A commit message explaining why these features are being removed would help reviewers understand the rationale.
Arch Linux, kernel 7.3.5-arch1-1, zero-CPU read, AI-assisted.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:34:30Z.
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/host.rs,crates/victory-gpu/src/indirect.rs,crates/victory-gpu/src/shadow.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
upstream-sync referenced this pull request2026-11-25 12:03:42 +00:00
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.