GPU: implement ID3D12GraphicsCommandList::ClearState (slot 0x58) #1166
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1166
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1166/head"
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?
@geiyiliyabumo on GitHub · 2026-11-24 16:19 UTC · original
geiyiliyabumo:feat/list-clear-state→main· +310 −1 · 2 files · 1 commits · closed without mergingSummary
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.
@Zipettte on GitHub · 2026-11-24 18:00 UTC · original
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).
@Marvisak on GitHub · 2026-11-25 00:38 UTC · original · edited 2026-11-25 02:23 UTC
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
@geiyiliyabumo on GitHub · 2026-11-25 01:51 UTC · original
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.@andrewpozdnakov7-jpg on GitHub · 2026-11-25 20:40 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 21:59 UTC · original
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