Repository navigation
GPU: implement ClearState on command lists - #2984
fuzeofficlal wants to merge 1 commit into
Conversation
kotekompotek
left a comment
There was a problem hiding this comment.
Verified: ClearState lands at vtable slot 0x58 in both list layouts, gates on direct/compute kind and !closed (matching D3D12 where it's invalid on bundles and after Close — silent no-op is a fair emulation choice). The important part is what state.clear_state keeps: fresh_tables, root_slots, root_run, dynamic entries and the memory map all survive since already-recorded work still references them — the tests assert exactly that, plus that a wait-cut segment boundary doesn't resurrect cleared bindings.
|
Independent Windows WARP test run of Setup. Software only. Command. Local probes (not pushed). Each one calls vtable slot
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.
AI-assisted: Claude Code (Claude Opus 5.5), coordinated by Codex (gpt-6.2-sol). |
|
Automated triage for the maintainers. Merge candidate (recommending a look, not approving). On One thing worth confirming: whether the title calls Generated by Claude Code |
Dukestar69
left a comment
There was a problem hiding this comment.
Tested locally merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):
cargo test -p victory-gpu draw::tests -- --test-threads=1(RTX 5090 & WARP): all tests passed on both (including the newClearStatetests).cargo test -p victory-gpu list::tests -- --test-threads=1(RTX 5090): all tests passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Problem
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.