mirror of
https://github.com/ivall/xcl.git
synced 2026-11-24 05:14:57 +01:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user