Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
4e8aaf4
D3D12.X: the PC desc of a translated VS / PS pipeline in its own func…
suppai-ringo Nov 24, 2026
e62643e
D3D12.X: a journal of the pipelines a title queues (<data>\cache\pipe…
suppai-ringo Nov 24, 2026
bc5bdc7
D3D12.X: a journal write error cuts its frame back and ends the journ…
suppai-ringo Nov 24, 2026
0cc1dee
D3D12.X: the journal keeps a run's heap-window flag
suppai-ringo Nov 24, 2026
35463a0
Shaders: xcl pipelines compiles a run's queued pipelines outside the …
suppai-ringo Nov 24, 2026
2028381
Shaders: xcl pipelines replaces another binary's pipelines.done
suppai-ringo Nov 24, 2026
c8e43aa
Shaders: xcl pipelines reads a rewritten torn frame again, takes the …
suppai-ringo Nov 24, 2026
4083f62
Shaders: xcl pipelines makes big compute pipelines one at a time and …
suppai-ringo Nov 24, 2026
b06e58c
Shaders: xcl pipelines keeps 6 GB of commit free for the PC, also wit…
suppai-ringo Nov 24, 2026
d20dc0f
Shaders: xcl pipelines keys done by driver, keeps only in-flight work…
suppai-ringo Nov 24, 2026
d9cea04
Shaders: xcl pipelines replays a run's heap windows and their switch-…
suppai-ringo Nov 24, 2026
bbf56a8
Shaders: xcl pipelines retries what Ctrl+C cut short
suppai-ringo Nov 24, 2026
ff12231
Merge origin/main into pipelines-3-tool
suppai-ringo Nov 24, 2026
c02d059
D3D12.X: the pipeline journal opens off the title's threads, and lock…
suppai-ringo Nov 24, 2026
dd66d20
Merge pipelines-2-journal (c02d059: the journal opens off the title's…
suppai-ringo Nov 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ XCL works only on unpacked game files you already own. It does not download, dec
| Feature | State | What it does | Verified by |
|---|---|---|---|
| **Video** | ✅ | the game's Bink 2 console DLL decodes its movies (720p / 1080p) on the CPU; the game's own YUV → RGB display shaders (`PS_Bink…` in its pack) translate like any other. Bink's GPU-assisted mode needs no Bink-specific support: its compute shaders ship with the game and go through the recompiler too (no game seen using it yet) | a game movie decodes frame by frame, picture checked |
| **Tools** | ✅ | `xcl inspect`, `xcl run`, `xcl disasm` (RDNA2, console shader containers), `xcl shaders` (pack statistics, recompile / compile runs), `xcl rpf` | – |
| **Tools** | ✅ | `xcl inspect`, `xcl run`, `xcl disasm` (RDNA2, console shader containers), `xcl shaders` (pack statistics, recompile / compile runs), `xcl rpf`, `xcl pipelines` (compiles a run's pipelines outside the game) | – |

## Controls

Expand Down Expand Up @@ -116,6 +116,7 @@ xcl disasm <shader.bin> [--hex] # RDNA2 disassembler (console contain
xcl shaders D:\data\shaders.rpf --top 50 # pack statistics; --recomp / --compile N
xcl shaders D:\data\shaders.rpf --precompile --only cs --pipelines # build compute pipelines and save driver blobs for the next run
xcl rpf D:\data\shaders.rpf --extract NAME --out folder
xcl pipelines D:\Games\SomeTitle [--watch] # compile the pipelines a run queued (<data>\cache\pipelines.bin)
```

- **Without a command line** (xcl.exe opened from Explorer) XCL shows a small menu: *Choose a
Expand Down
25 changes: 22 additions & 3 deletions crates/xcl/src/gpu/recomp/pso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,33 @@ pub fn fspx(blob: &[u8]) -> Option<Fspx<'_>> {
/// Memory windows of the title's unified memory (1 without it), with `HEAP_WINDOWS` when
/// shaders take them from the descriptor heap (`heap_windows`).
pub fn mem_windows() -> u32 {
let n = crate::gpu::uma::get().map_or(1, |u| u.shader_windows() as u32);
if n > 1 && heap_windows() && !SWITCH_FORM.with(|s| s.get()) {
n | super::HEAP_WINDOWS
let n = match MEM_WINDOWS_OVERRIDE.load(std::sync::atomic::Ordering::Relaxed) {
0 => {
let n = crate::gpu::uma::get().map_or(1, |u| u.shader_windows() as u32);
if n > 1 && heap_windows() {
n | super::HEAP_WINDOWS
} else {
n
}
}
n => n,
};
if SWITCH_FORM.with(|s| s.get()) {
n & !super::HEAP_WINDOWS
} else {
n
}
}

static MEM_WINDOWS_OVERRIDE: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(0);

/// `mem_windows` as a title's run had it, with its `HEAP_WINDOWS` (`xcl pipelines` replays a
/// run's pipelines without the title's unified memory: the HLSL, and so the cache keys, must be
/// that run's). 0: unset.
pub fn set_mem_windows(n: u32) {
MEM_WINDOWS_OVERRIDE.store(n, std::sync::atomic::Ordering::Relaxed);
}

thread_local! {
/// this thread translates in the switch form (`in_switch_form`)
static SWITCH_FORM: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
Expand Down
2 changes: 1 addition & 1 deletion crates/xcl/src/gpu/shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub fn readable(p: usize, len: usize) -> bool {
Some(e) => e,
None => return false,
};
if crate::gpu::uma::get().is_some_and(|u| u.in_committed_window(p, len)) {
if crate::gpu::uma::existing().is_some_and(|u| u.in_committed_window(p, len)) {
return true;
}
if resident_and_readable(p, end) {
Expand Down
6 changes: 6 additions & 0 deletions crates/xcl/src/gpu/uma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,12 @@ impl Uma {
}
}

/// The UMA if something made it already (`get` makes it: a process without a title, such as
/// `xcl pipelines`, must not reserve its windows for a check).
pub fn existing() -> Option<&'static Uma> {
GLOBAL.get()?.as_ref()
}

/// The title's graphics memory (created on first use; `XCL_UMA_MB`, default 2048).
pub fn get() -> Option<&'static Uma> {
GLOBAL
Expand Down
1 change: 1 addition & 0 deletions crates/xcl/src/hle/d3d12x/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub mod list_x;
pub mod null;
pub mod present;
pub mod pso_async;
pub mod pso_journal;
pub mod real;
mod shader_cache_session;
pub mod sparse;
Expand Down
Loading
Loading