GPU: implement ID3D12GraphicsCommandList::ClearState (slot 0x58) #848
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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-24T12:25:44Z.
Summary
Implements
ID3D12GraphicsCommandList::ClearState(vtable slot11,0x58) invictory-gpuacross both older (LIST_FUNCTIONS) and newer (NEWER_LIST_FUNCTIONS) console command-list layouts.Because external PR creation is currently restricted (
collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:geiyiliyabumo/VIctory@feat/list-clear-stategeiyiliyabumo/VIctory@d57ea67(based onmainffe310e)Changes
crates/victory-gpu/src/draw.rs:State::clear(&mut self, pipeline: This)resetting guest bindings (pipeline,heaps,graphics,compute,vertex,index,targets,depth,topology) and cached host state (host_pipeline,host_roots,host_heaps,fresh_tables,table_failed) while preservingself.dynamicdescriptor slots still referenced by earlier recorded commands in the same list.draw::clear_state_tests::clear_resets_bindings_but_retains_dynamic_slots.crates/victory-gpu/src/list.rs:clear_state(this: This, pipeline: This)wired at slot11(0x58) inMETHODS(shared by bothLIST_FUNCTIONSandNEWER_LIST_FUNCTIONS).unsafe { host.list.ClearState(None) }(leaving translated host pipeline binding lazy on the next draw/dispatch), resets guest state viastate.clear(pipeline), preservesHostList::statesresource-state tracking, and records adiagnosticsop note when enabled.list::tests::clear_state_slot_is_stableandlist::tests::clear_state_preserves_recorded_gpu_commands(clears pixel 0 red beforeClearState, verifies trackedRENDER_TARGETstate survivesClearState, clears pixel 1 green afterClearState, submits and verifies[255, 0, 0, 255, 0, 255, 0, 255]readback).Verification (Windows 11 x64 MSVC, AMD Radeon RX 9060 XT RDNA4 + WARP)
cargo xtask policy: PASS (154 files ok)cargo clippy --workspace --all-targets --locked -- -D warnings(default +--features diagnostics): PASS (0 warnings)cargo test -p victory-gpu --locked -- clear_state: 3/3 PASS (live RX 9060 XT GPU readback)VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --features diagnostics --locked -- clear_state: 3/3 PASScargo test --workspace --locked: PASS (all workspace crates green)AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T12:55:21Z.
Melissa checked ClearState together with #158, which adds a dynamic depth range to the list. The two patches apply cleanly, but the saved range survives ClearState and the next bind replays it. With depth cleared to 0.5, a draw after ClearState still failed the old bounds and left 0.5 in the pixel. A draw after Reset wrote the expected 0.25.
The follow-up saves the list's dynamic descriptor allocations, calls the existing guest-state reset helper to clear bindings and saved depth bounds, then restores ownership of the allocations. Earlier recorded commands can still use those slots. On RTX 4090 under Wine/vkd3d-proton 3.2, the draw after ClearState then wrote 0.25. The vertex and mesh readbacks covered fresh, excluded, included, cleared, and reset states. All three original ClearState controls passed, including the two recorded clears.
This is a synthetic result on the combined branches. On #848 alone, the saved-depth-bounds field does not exist. The helper change and readback are available in the integration commit.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:55:32Z.
Automated triage for the maintainers.
Confirmed missing on
main: slot 11 (0x58, ClearState) is not in theMETHODStable incrates/victory-gpu/src/list.rs, so it falls into the missing table on both list layouts. This change is now open as PR #1166 (same author), so review continues there.The comment above notes that the dynamic depth range from #158 would survive ClearState if both landed. Please raise that on #1166 so whichever lands second resets it.
Generated by Claude Code