From 4a4c5f7be0463317cbd558620d5fc5567e8785a3 Mon Sep 17 00:00:00 2001
From: bmjask <>
Date: Wed, 25 Nov 2026 22:16:14 -0800
Subject: [PATCH] D3D12.X: invalidate retired queue address caches
Add an inactive Stage C coordinator that removes every audited raw-command-queue cache only after a future retirement mark completes. Cover allocation, copy scratch, CPU-write, late-release, sparse/VRAM, title-texture, presentation, and synchronization-graph state.
Extract COM-bearing values under their subsystem lock and release them only after unlocking. In-flight batches retain independent fence clones, and the retirement registry remains untouched.
No overlapping queue-retirement PR was found. Locally cross-checked with the GNU Windows target; Windows execution remains untested here.
Assisted-by: Codex (GPT-5.6-sol)
---
crates/xcl/src/hle/d3d12x/alloc_pool.rs | 27 ++++++
crates/xcl/src/hle/d3d12x/cpu_writes.rs | 10 ++
crates/xcl/src/hle/d3d12x/late_release.rs | 10 ++
crates/xcl/src/hle/d3d12x/list_x.rs | 100 ++++++++++++++++++++
crates/xcl/src/hle/d3d12x/present.rs | 26 +++++
crates/xcl/src/hle/d3d12x/sparse.rs | 13 +++
crates/xcl/src/hle/d3d12x/title_textures.rs | 6 ++
crates/xcl/src/hle/d3d12x/vram.rs | 41 ++++++++
8 files changed, 233 insertions(+)
diff --git a/crates/xcl/src/hle/d3d12x/alloc_pool.rs b/crates/xcl/src/hle/d3d12x/alloc_pool.rs
index e12db4060f..24213d1694 100644
--- a/crates/xcl/src/hle/d3d12x/alloc_pool.rs
+++ b/crates/xcl/src/hle/d3d12x/alloc_pool.rs
@@ -80,6 +80,33 @@ unsafe impl Send for State {}
static STATE: Mutex