GPU: implement ID3D12GraphicsCommandList::ClearState (slot 0x58) #1166
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1166"
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 geiyiliyabumo on 2026-11-24T16:19:02Z.
Summary
Closes #848
Full verification details and change notes are documented in #848 (commit
d57ea67, based onmainffe310e).Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --checkon edited files: PASScargo xtask policy: PASS (zero game files/data)cargo clippy --all-targets --locked -- -D warnings(default +--features diagnosticswhere applicable): PASSAI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:00:57Z.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
d57ea67:cargo test -p victory-gpupasses, 53 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:38:19Z.
Automated triage for the maintainers.
Recommended for a maintainer's look. This fills slot 0x58 (
ClearState) incrates/victory-gpu/src/list.rs, which main leaves to theE_NOTIMPLstub. It calls the host'sClearState(None)and resets the list's cachedState(State::clearindraw.rs), so the pipeline, root signatures and heaps are bound again before the next draw. The dynamic descriptor slots and the root-view run are kept until reset, because earlier commands may still read them. These semantics match the public D3D12ClearStatedocumentation. The GPU test reads back a clear recorded beforeClearStateand another recorded after it, confirming that both run. CI is passing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T01:51:49Z.
Rebased cleanly onto \main\ (\
ccfb029). \cargo test -p victory-gpu --locked\ (144 passed, 0 failed), \cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, and \cargo xtask policy\ all pass.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T20:40:22Z.
I tested this PR at
2d779bfmerged with current main13f91ca. The textual merge is clean, but the resulting test build hits E0063 at the State initializer because main added the saved fixed-function state, and E0308 where the existing readback test passes an owned texture to transition.After adapting only those test call sites, the expanded binding test finds that ClearState leaves the saved topology, viewport, scissor, blend factor, stencil reference and targets available for replay by State::cut. The fix resets that saved state while retaining the descriptor slots and root views used by earlier commands. D3D12 ClearState
Commit bfd5ce0 sits on the merge of your exact HEAD and main, keeping your commits and authorship. With the same tests, the old composition fails the stale-state assertion and the updated composition passes all three ClearState tests. The submitted clear regression still reads red and green from its two texels. Six paired runs reproduced the results. The full serial GPU suite on WARP passed 201 tests with one ignored under each debug setting. Strict Clippy in both configurations and asset policy passed.
Please retain the Git author on cherry-pick or rebase. If you fold the fix or test into another commit, please add the following trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted with Codex. Synthetic tests on WARP.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T21:59:33Z.
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing because the title never calls this slot (an unimplemented list slot logs its first call, and no title run has logged 0x58), and the change is incomplete against current
main.Stategained afixedfield thatState::cleardoes not reset, so a list cut at a wait afterClearStatewould set the old viewports, scissors, blend factor, stencil reference, topology and targets again;host_heapsis set to[0; 2]wheremainusesusize::MAX; and the tests no longer compile onmain.If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed