Repository navigation
D3D12.X: retain graphics root signature across bind state - #1925
n-romanovich wants to merge 1 commit into
Conversation
Addresses xcl-dev#1488. State.rs_gfx stored the graphics root signature as an unretained raw usize, causing a COM use-after-free in graphics_bound or execute_indirect if the title released its reference after SetGraphicsRootSignature. execute_indirect also bound rs_gfx on COMPUTE command lists. Store Option<ID3D12RootSignature> in State.rs_gfx (retaining adopted objects via from_raw_borrowed), and in execute_indirect only bind rs_gfx for non-dispatch signatures on non-COMPUTE lists. Tested: cargo test --workspace -- --test-threads=4 (976 passed, 0 failed, 45 ignored). Assisted-by: Antigravity (model name not provided)
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Code review on
Remaining before merge: |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
PR #1925 compatibility verificationCommit Tested
Workspace suite
Not tested Debug-layer draw assertions, retail-title smoke, release builds, and other adapters. The workspace failures were measured on the PR head only, so their status on AI use T3 Code / Codex ( |
|
Tested
Smoke attempt Two monitored 7-second runs of a locally owned title on the RX 6800M reached the first frame. The first logged the Not tested
AI use OpenAI Codex (GPT-6, exact variant not exposed in this session) inspected the diff, ran the builds and tests, monitored the smoke attempts, reviewed their logs, and drafted this report. |
|
Linux (Wine + vkd3d-proton) + NVIDIA test of Setup: Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, RTX 4070 12 GB (driver 615.71.09), 62 GB RAM. Release, cross-compiled to Tested
Read
Not tested: the bind the change is for (every run's last count line has 0 draws with PC pipelines); a title that releases its root signature before a draw; Windows; AMD and Intel; past 100 s. AI use: Claude Code (Claude Fable 5.2) read the diff, built the trees, ran the title and the tests, and wrote this comment. Posted without review by a person: the account owner was away and reads replies later. |
Fixes #1488.
State.rs_gfxpreviously stored the graphics root signature as an unretained rawusize, causing a COM use-after-free ingraphics_boundorexecute_indirectif the title released itsID3D12RootSignaturereference afterSetGraphicsRootSignature.execute_indirectalso boundrs_gfxeven onCOMPUTEcommand lists.This PR retains
ID3D12RootSignatureinState.rs_gfx(when adopted viareal::is_adopted) and restrictsexecute_indirect's graphics root signature binding to non-dispatch indirect signatures on non-COMPUTEcommand lists.What is in it
crates/xcl/src/hle/d3d12x/bind.rs:State::rs_gfxfromusizetoOption<ID3D12RootSignature>, retaining adopted objects inset_graphics_root_signature, cloning ininherit_for_split, and clearing onreset,clear_state, andforget.execute_indirect, only binds.rs_gfxwhen!signature_dispatches(sig)andlist.GetType() != D3D12_COMMAND_LIST_TYPE_COMPUTE(checkings.rs_gfxbefore callingGetType()).graphics_root_signature_is_retained_and_skipped_on_compute_ei.Tested
Hardware: Windows 11 x64, NVIDIA GeForce RTX 5060 Ti.
cargo test -p xcl --lib bind::tests -- --test-threads=4: 7 passed, 0 failed, 0 ignored (945 filtered out)cargo test --workspace -- --test-threads=4: 976 passed, 0 failed, 45 ignoredSKIPPED:gpu::recompwave64 and unsupported per-lane f16 tests (21 skipped:no wave64/ refused per-lane f16),shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode is required,0x887A002D),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)Regression run
Main (
689f2db477c3c062cf162649781640ef8a977c18):PR (
cfd026db9ff9ddd9c9cde6ba6d540c492e6543a7):Not tested
AI use
smoke.ps1runs, and audited the diff with an independent subagent.