GPU: implement ClearState on command lists #2984
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!2984
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2984"
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?
@fuzeofficlal on GitHub · 2026-11-26 02:12 UTC · original
fuzeofficlal:fix/gpu-list-clear-state→main· +290 −8 · 2 files · 1 commits · openProblem
ID3D12GraphicsCommandList::ClearState(slot 11 /0x58) was missing fromMETHODSincrates/victory-gpu/src/list.rsand fell through to the generic unimplemented stub. BecauseClearStatereturnsvoid, callingClearState(pso_b)silently leftState.pipelinepointing to the previous pipeline along with stale root arguments, descriptor heaps, render/depth targets, vertex/index views, topology, depth bounds, andFixedreplay state, and never cleared the host command list.Fix
clear_stateat slot 11 (0x58) inMETHODS(preserving the same slot in bothLIST_FUNCTIONSandNEWER_LIST_FUNCTIONS).DIRECTandCOMPUTElists, callhost.list.ClearState(None), clear all guest and cached host bindings plusFixedreplay state viaState::clear_state(pipeline)while preserving resources needed by previously recorded commands (dynamic,fresh_tables,root_slots,root_run,memory, deferred uploads/copies), and recordpipeline::bound(pipeline).closedstate onList(distinct from internal segment cuts at waits) soClearStateon a closed list is safely ignored.Verification
draw::tests::clear_state_switches_compute_pipeline_without_losing_recorded_work(executes two Wave32 compute pipelines acrossClearState(b)in a single list and reads back both title buffers),draw::tests::clear_state_clears_graphics_bindings_before_a_segment_cut(verifies all bindings andFixedstate clear before await64segment cut while retaining recordeddynamic/memory/deferred work), andlist::tests::clear_state_has_the_same_slot_in_both_layouts.cargo test --locked -p victory-gpu --lib -- list:: draw:: --test-threads=1(VICTORY_D3D12_DEBUG=1): 27/27 passed on both hardware D3D12 (RTX 5090) and WARP.cargo clippy --locked -p victory-gpu --tests -- -D warnings(default &--features diagnostics): 0 warnings.cargo xtask policy: 191 files ok.@oni-swr on GitHub · 2026-11-26 03:02 UTC · original
Independent Windows WARP test run of
3cdfd5f875c44e2249fa46abee76ff57ab5d9187, compared with its exact parent63bcca43c6a00a758510398fa43096ce7e4f7df0. This reports test results only, not a review verdict.Setup. Software only.
VICTORY_D3D12_WARP=1andVICTORY_WARP=1, built with--features diagnostics.VICTORY_DXILpointed at the Windows SDK 10.0.26100.0 x64dxil.dll, but the victory-gpu lib tests never loaded it: a probe found nodxil.dllmodule in the process after creating the translated pipelines. Before any dispatch, each probe checked that the host device's adapter LUID matchesEnumWarpAdapter:Microsoft Basic Render Driver, vendor0x1414, device0x8c, software flag set. No hardware GPU was used. No game files, dumps or shader data, only synthetic state and programs.Command.
cargo test --locked -j 4 -p victory-gpu --features diagnostics --lib -- --test-threads=1, plus filtered runs (probe_attest,probe_,list::).Local probes (not pushed). Each one calls vtable slot
0x58on a title list:63bcca43cdfd5f8table_failedand fixed topology/stencil set. AfterClearState(null)all 16 are cleared, andfresh_tables,root_slotsandroot_runare keptClearStateafterCloseleaves state untouched. AfterResetit clears again. On a bundle it leaves state untouchedClearState(B), dispatch,ClearState(A), dispatch, each into its own page. Expected[A,B,A][A,A,A][0x0badc0de, 0x5eed1234, 0x0badc0de], one segment[A,A,A]The synthetic Wave32 store program in the GPU probes uses the packet layout from this PR's test, with different values. The sequence checked is independent of the PR's tests.
Counts.
list::on the head: 5 passed (includingclear_state_has_the_same_slot_in_both_layouts).benchmark_private_data_release), includingdraw::tests::clear_state_switches_compute_pipeline_without_losing_recorded_workanddraw::tests::clear_state_clears_graphics_bindings_before_a_segment_cut. The suite total also included the WARP attestation probe and 4 unrelated local mesh-clamp probes for #2996; 3 of those fail here as they do on the parent.AI-assisted: Claude Code (Claude Opus 5.5), coordinated by Codex (gpt-6.2-sol).
@Marvisak on GitHub · 2026-11-26 05:26 UTC · original
Automated triage for the maintainers.
Merge candidate (recommending a look, not approving). On
main, slot 11 (0x58) of the list vtable incrates/victory-gpu/src/list.rsfalls to the unimplemented stub. This PR addsclear_state, which follows the public D3D12ClearStatecontract: it acts only on open direct and compute lists, sets the given pipeline, clears the host list, and resets the title-side bindings through the newState::clear_stateindraw.rs. It keeps what already-recorded work still needs (dynamic slots, fresh tables, root views, the memory map). The newclosedflag is set bycloseand cleared byreset, so segment cuts at waits do not count as closed. The compute test runs two pipelines across aClearStatein one list and reads back both results, and the graphics test checks each field. A separate WARP run posted here shows the probes fail onmainand pass on this head. CIcheckpasses.One thing worth confirming: whether the title calls
ClearStateat all. That would decide how much this matters, not whether it is correct.Generated by Claude Code
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.