From 2d9a9fe2a80fa2d86bcbce5a47d92980b63093c1 Mon Sep 17 00:00:00 2001 From: theaustinayers <153482135+theaustinayers@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:22:54 -0500 Subject: [PATCH] D3D12.X: ExecuteIndirect with a pipeline still being built is skipped With the limit on waits for a background pipeline, ExecuteIndirect could reach the PC call with the pipeline's stand-in while the list held XCL's ABI root signature from a translated draw: debug layer 953 (root signature does not match the pipeline state), six times as a retail title's world started, and then the device hung (0x887a0006). Such a call is skipped like a draw or dispatch of that pipeline; a PC pipeline gets the title's root signature first, as graphics_bound does. With it the same run shows no 953 and no device removal. Assisted-by: Claude Code (Claude Fable 5.2) Co-Authored-By: Claude Fable 5.2 --- crates/xcl/src/hle/d3d12x/bind.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/xcl/src/hle/d3d12x/bind.rs b/crates/xcl/src/hle/d3d12x/bind.rs index d8df8e3..5fb218f 100644 --- a/crates/xcl/src/hle/d3d12x/bind.rs +++ b/crates/xcl/src/hle/d3d12x/bind.rs @@ -218,6 +218,24 @@ pub(super) unsafe extern "system" fn execute_indirect(this: *mut c_void, sig: us let (gfx, compute) = (super::real::is_translated_graphics(pso), super::real::is_translated_compute(pso)); let (args_off, count_off) = (args_off + super::real::buffer_delta(args), count_off + super::real::buffer_delta(count_buf)); if !gfx && !compute { + // A pipeline still being built (or whose build failed): its stand-in draws nothing, and + // the list may hold XCL's ABI root signature from a translated draw before it – the PC + // call with that pair is invalid (debug layer 953, "the currently set Root Signature + // doesn't match the currently set Pipeline State Object"; a retail title's world then + // hung the GPU, 0x887a0006). Skipped, like a draw or dispatch of such a pipeline. + if super::pso_async::is_pending(with(this, |s| s.pso)) { + count(DRAWS_SKIPPED); + static N: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(0); + if N.fetch_add(1, Ordering::Relaxed) < 4 { + crate::xlog_warn!("D3D12.X: ExecuteIndirect with a pipeline that is still being built skipped"); + } + return; + } + // a PC pipeline: the title's root signature, as for a draw (`graphics_bound`) + let rs = with(this, |s| s.rs_gfx) as *mut c_void; + if let (Some(list), Some(r)) = (ID3D12GraphicsCommandList::from_raw_borrowed(&this), ID3D12RootSignature::from_raw_borrowed(&rs)) { + list.SetGraphicsRootSignature(r); + } return pc(this, sig, max, args, args_off, count_buf, count_off); } if ROOT_SIGNATURES.lock().unwrap().as_ref().is_some_and(|s| s.contains(&sig)) {