Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ xcl rpf D:\data\shaders.rpf --extract NAME --out folder
- **Without a command line** (xcl.exe opened from Explorer) XCL shows a small menu: *Choose a
game…* (pick its exe or `MicrosoftGame.config`) or *Run again* (the last one). On an error the
window stays open until Enter.
- The window title shows active shader compilation and pipeline builds; pipelines deferred until
first use are not counted as active.
- Experimental BCPack BC1 decoding can be enabled with `XCL_DSTORAGE_BCPACK_BC1=1`. Its fitted
tables can produce inaccurate textures; streams using unknown lane 1 symbols are rejected.
BC2–BC7 remain unsupported, and this does not guarantee a game will render or run.
- XCL works on **unpacked** game files you own; it contains nothing for decrypting or
circumventing DRM.
- **The game folder is never modified** – writes go to the overlay.
Expand Down
27 changes: 27 additions & 0 deletions THIRD_PARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ carry a note in their header about its origin and the date of changes (GPL-2.0
| [LLVM](https://github.com/llvm/llvm-project) | Apache-2.0 WITH LLVM-exception | `tests/data/llvm-amdgpu/*` (test data, not part of the program); GFX10 buffer format values (`UfmtSymbolicGFX10`) in `gpu/recomp/emit.rs` | test vectors; hardware facts |
| [WinDurango](https://github.com/WinDurango/WinDurango) | LGPL-3.0 | no code; d3d12_x.dll export numbers (facts) in `crates/xcl/data/stubdb.toml` | reference only |
| [libHttpClient](https://github.com/microsoft/libHttpClient) | MIT | no code; XTaskQueue/XAsync contract | specification |
| [bcpack-rs](https://github.com/Ahmet-Dedeler/bcpack-rs) and [silicon-rans](https://github.com/microsoft/silicon-rans) | MIT | experimental BCPack BC1 decoder and entropy tables | pinned Rust dependency; notices below |
| [bcpack-decoder](https://github.com/Tim0219800/bcpack-decoder) | MIT | no code; BC1 lane 1 semantics | format reference |
| Windows XGameRuntime (`System32\xgameruntime.dll`) | system | class GUIDs and slot order of the GDK thunk protocol in `hle/xgameruntime/api.rs` (facts, determined by analysis); APIs XCL does not implement are forwarded to it at runtime | interoperability; not distributed |
| docs.xbox.com | documentation | signatures, enums, structs written independently | reference |
| Rust crates (`Cargo.lock`) | MIT / BSD-2 / Zlib / Unlicense (or with an MIT alternative) | build dependencies | statically linked |
Expand All @@ -22,3 +24,28 @@ carry a note in their header about its origin and the date of changes (GPL-2.0
When adding dependencies: compatible with GPL-2.0-only are MIT, BSD, Zlib, ISC, Unlicense, LGPL-2.1(+),
GPL-2.0(+), MPL-2.0 (via its Secondary License clause). Incompatible: Apache-2.0 without an alternative,
GPL-3.0, LGPL-3.0, AGPL.

## BCPack notices

bcpack-rs: Copyright (c) 2026 Ahmet Dedeler. Its rANS decoder and tables derive from
silicon-rans: Copyright (c) Microsoft Corporation. Both are used under the MIT license:

```
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
1 change: 1 addition & 0 deletions crates/xcl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ name = "xcl"
path = "src/main.rs"

[dependencies]
bcpack-rs = { git = "https://github.com/Ahmet-Dedeler/bcpack-rs", rev = "c51ec521cbe6869136f29f5d157342374ef5cf33", default-features = false }
miniz_oxide = "0.9"
retour = "0.3"
serde = { version = "1", features = ["derive"] }
Expand Down
8 changes: 4 additions & 4 deletions crates/xcl/src/hle/d3d12x/present.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,15 @@ const COMPILE_TIMER: usize = 0x5C0;
/// While XCL compiles shaders (DXC, programs the disk cache did not have – the title draws
/// nothing with those pipelines meanwhile: after an XCL update the screen stays black while
/// thousands recompile), the window's title says so:
/// "XCL – <game> | compiling shaders: N running, M done[, Q pipelines queued][, F failed]".
/// "XCL – <game> | compiling shaders: N running, M done[, Q pipelines active][, F failed]".
/// It stays 2 s after the last compile (compiles in the title's own calls come one by one),
/// then the plain title comes back.
unsafe fn show_compiling(hwnd: HWND) {
static SHOWN: Mutex<Option<String>> = Mutex::new(None);
static LAST_ACTIVE: Mutex<Option<Instant>> = Mutex::new(None);
let (_, failed, queued) = super::pso_async::counts();
let (failed, pipelines) = super::pso_async::activity();
let (running, done) = crate::gpu::recomp::dxc::compile_counts();
let active = running > 0 || queued > 0;
let active = running > 0 || pipelines > 0;
let recent = {
let mut last = LAST_ACTIVE.lock().unwrap();
if active {
Expand All @@ -365,7 +365,7 @@ unsafe fn show_compiling(hwnd: HWND) {
};
let title = window_name();
let text = if recent {
let queued = if queued > 0 { format!(", {queued} pipelines queued") } else { String::new() };
let queued = if pipelines > 0 { format!(", {pipelines} pipelines active") } else { String::new() };
let failed = if failed > 0 { format!(", {failed} failed") } else { String::new() };
format!("XCL – {title} | compiling shaders: {running} running, {done} done{queued}{failed}")
} else {
Expand Down
35 changes: 35 additions & 0 deletions crates/xcl/src/hle/d3d12x/pso_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ struct Pending {
orphan: std::sync::atomic::AtomicBool,
}

impl Pending {
fn is_active(&self) -> bool {
self.sent.load(Ordering::Acquire) && !*self.done.lock().unwrap()
}
}

/// stand-in handed to the title → its real pipeline
static PENDING: Mutex<Option<HashMap<usize, Arc<Pending>>>> = Mutex::new(None);

Expand Down Expand Up @@ -153,6 +159,7 @@ pub fn resolve(pso: usize) -> usize {
/// it yet (a queue of a title's hundreds of pipelines must not hold up the one it binds now).
pub fn resolve_wait(pso: usize) -> usize {
let Some(p) = entry(pso) else { return pso };
p.sent.store(true, Ordering::Release);
let job = p.job.lock().unwrap().take();
if let Some(job) = job {
complete(&p, job());
Expand Down Expand Up @@ -201,3 +208,31 @@ pub fn counts() -> (usize, usize, usize) {
let pending = PENDING.lock().unwrap().as_ref().map_or(0, |m| m.values().filter(|p| !*p.done.lock().unwrap()).count());
(BUILT.load(Ordering::Relaxed), FAILED.load(Ordering::Relaxed), pending)
}

/// Failed builds and builds actually started or sent to workers, excluding dormant lazy pipelines.
pub fn activity() -> (usize, usize) {
let active = PENDING.lock().unwrap().as_ref().map_or(0, |m| {
m.values().filter(|p| p.is_active()).count()
});
(FAILED.load(Ordering::Relaxed), active)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn lazy_pipeline_is_active_only_after_its_build_starts() {
let standin = usize::MAX - 1000;
submit_lazy(standin, true, Box::new(move || {
let p = entry(standin).unwrap();
assert!(p.is_active());
0
}));
let p = entry(standin).unwrap();
assert!(!p.is_active());
assert_eq!(resolve_wait(standin), standin);
assert!(!p.is_active());
assert_eq!(released(standin), 0);
}
}
Loading