Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
474b799
d3d12: min/max samplers honour filterMinmaxImageComponentMapping (D3D…
Zilumz1 Nov 23, 2026
e6f34ed
d3d12: say when the driver's pipeline cache stops keeping new pipelin…
thegalaxydev Nov 25, 2026
869319b
docs: rewrap the pipeline cache growth paragraph (RT-PIPELINE-CACHE-G…
thegalaxydev Nov 25, 2026
ad6045b
d3d12_xs: say so when LEONIDA_D3D12=vulkan is asked of a runtime buil…
quartz-heron-58 Nov 26, 2026
34ddcc1
Merge origin/main into carry/pr-2173
OreoFR Nov 29, 2026
ce907ce
Merge origin/main into carry/pr-2062
OreoFR Nov 29, 2026
5d1d6c8
d3d12: frame-time percentiles and what stalls frames, in the log and …
TheGeogeo Nov 29, 2026
5d72958
d3d12: frame-time panel lines fit long stalls, the first line counts …
TheGeogeo Nov 29, 2026
ffd3681
d3d12: a pipeline a frame waits for goes before those asked for earli…
TheGeogeo Nov 29, 2026
223df10
Merge origin/main into carry/pr-279
OreoFR Nov 29, 2026
f8ee175
ci: build and test the d3d12 Rust runtime on Windows (CI-D3D12-CARGO-…
MoonEyes Nov 29, 2026
61c5b18
d3d12: a frame's pipeline wait counts the queue lock its promotion wa…
TheGeogeo Nov 30, 2026
d92dc7a
Merge origin/main (f9f3ec4c6) into the carry of #279
OreoFR Nov 30, 2026
0590fe2
Merge origin/main (f9f3ec4c6) into the carry of #2173
OreoFR Nov 30, 2026
bede3ad
Merge origin/main (f9f3ec4c6) into the carry of #2062
OreoFR Nov 30, 2026
4668888
Merge remote-tracking branch 'origin/main' into d3d12-pipeline-wait-q…
TheGeogeo Nov 30, 2026
c6a8f71
Merge origin/main into d3d12-frame-time-stats
TheGeogeo Nov 30, 2026
db9f497
Merge pull request #2725 from OreoFR/carry/pr-279
MoonEyes Nov 30, 2026
f0143cd
Merge pull request #2732 from OreoFR/carry/pr-2173
MoonEyes Nov 30, 2026
99167bc
Merge pull request #2737 from OreoFR/carry/pr-2062
MoonEyes Nov 30, 2026
afb5115
Merge pull request #2613 from TheGeogeo/d3d12-frame-time-stats
MoonEyes Nov 30, 2026
ad36782
Merge pull request #2622 from TheGeogeo/d3d12-pipeline-wait-queue
MoonEyes Nov 30, 2026
22450ad
Merge main into ci/d3d12-cargo-test
MoonEyes Nov 30, 2026
6d69584
ci: d3d12 workflow follows TheGeogeo's review
MoonEyes Nov 30, 2026
dcd93be
ci: skip the depth bounds test on the runner's software adapter until…
MoonEyes Nov 30, 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
88 changes: 88 additions & 0 deletions .github/workflows/d3d12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Builds and tests the D3D12 runtime (d3d12/, Rust: leonida.exe and its crates) when it changes. Until now no workflow
# ran its tests, so a change that broke one of them reached main unseen. It needs no GPU and no game files: the tests
# that need a device or the title skip themselves.
#
# Measured on main 060c47160 (Windows 11, toolchain from d3d12/rust-toolchain.toml): the workspace builds in about
# 4 minutes and its tests take about 11; 1441 pass, 58 are ignored, and one fails, the xtask asset-policy test, because
# two sources are over its 640 KiB limit (crates/leonida-gpu/src/host.rs, crates/leonida-shader/src/emit/lower.rs).
# `cargo clippy -D warnings` also fails on main (about 25 findings in five crates) and `cargo fmt --check` would
# reformat most of the tree. So the tests are the gate; the policy test and clippy run as reports until those are fixed,
# and formatting is left out so it does not collide with the open d3d12 pull requests.
name: D3D12 runtime

on:
push:
branches: [main]
paths:
- "d3d12/**"
# leonida-lua's tests read mods/example_lua.
- "mods/**"
- ".github/workflows/d3d12.yml"
pull_request:
paths:
- "d3d12/**"
# leonida-lua's tests read mods/example_lua.
- "mods/**"
- ".github/workflows/d3d12.yml"
workflow_dispatch:

permissions:
contents: read

concurrency:
# Each non-PR run has its own group so a queued push or dispatch cannot replace it.
group: d3d12-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
d3d12:
name: d3d12 (windows-latest)
# The crates are Windows-only today (leonida-gpu does not build on macOS); Linux follows #2577 if it lands.
runs-on: windows-latest
timeout-minutes: 70
defaults:
run:
working-directory: d3d12
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# The runner's own rustup installs the toolchain pinned in d3d12/rust-toolchain.toml, no third-party action.
- name: Rust toolchain
run: |
rustup show active-toolchain || rustup toolchain install
rustc --version
echo "RUSTC_HASH=$(rustc -vV | tr -d '\r' | awk '/^commit-hash: /{print $2}')" >> "$GITHUB_ENV"
- name: Cache Cargo downloads
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cargo/registry
~/.cargo/git
key: d3d12-windows-cargo-${{ env.RUSTC_HASH }}-${{ hashFiles('d3d12/Cargo.lock') }}
restore-keys: |
d3d12-windows-cargo-${{ env.RUSTC_HASH }}-
d3d12-windows-cargo-
- name: Build
run: cargo build --workspace --all-targets --locked
# The features of the executable people run (d3d12/scripts/build-nvidia.ps1, without dlss); no other step builds them.
- name: Build as shipped (diagnostics, mimalloc)
run: cargo build -p leonida --features diagnostics,mimalloc --locked
# The software adapter of the runner does not do the depth bounds test as this one expects, and #2663 fixes that
# in the renderer; drop the --skip with it. A failing test here also stops the crates after leonida-gpu.
- name: Tests (no GPU, no game data)
timeout-minutes: 30
run: cargo test --workspace --exclude xtask --locked -- --skip depth_bounds_pipeline_loads_and_filters_draws
# tests/replay.rs is compiled only with the diagnostics feature.
- name: Replay test (diagnostics)
timeout-minutes: 15
run: cargo test -p leonida-gpu --features diagnostics --test replay --locked
# Report only until host.rs and lower.rs are split under the limit; make it blocking then.
- name: Asset policy (report)
continue-on-error: true
run: cargo test -p xtask --locked
# Report only until the existing findings are fixed; make it blocking (-D warnings) then.
- name: Clippy (report)
continue-on-error: true
run: cargo clippy --workspace --all-targets --locked -- -D warnings
33 changes: 0 additions & 33 deletions d3d12/.github/workflows/ci.yml

This file was deleted.

16 changes: 16 additions & 0 deletions d3d12/crates/leonida-gpu/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5337,6 +5337,8 @@ pub(crate) mod indirects;
mod font;
#[cfg(feature = "diagnostics")]
mod panel;
// Frame-time percentiles and what stalls frames, with the frame-rate line.
mod frametime;
// Leonida: the F1 settings menu and the frame-rate line, in every build.
mod menu;
// Leonida: the trainer menu laid over the picture (`leonida-menu`, F4).
Expand Down Expand Up @@ -12361,6 +12363,8 @@ struct Meter {
logged: std::time::Instant,
/// The caption the window had, once read.
caption: Option<Vec<u16>>,
/// Frame times and stalls, logged with the line.
stalls: frametime::Meter,
}

impl Meter {
Expand All @@ -12374,6 +12378,10 @@ impl Meter {
drawn: crate::draw::drawn(),
logged: now,
caption: None,
stalls: frametime::Meter::new(
crate::pipeline::made(),
RESIDENT[1].load(Ordering::Relaxed),
),
}
}

Expand All @@ -12389,6 +12397,7 @@ impl Meter {
tracing::debug!(target: "leonida_gpu::frame", token = crate::frame::current(), "present");
#[cfg(feature = "diagnostics")]
crate::copystat::presented();
self.stalls.presented(std::time::Instant::now());
self.frames += 1;
#[cfg(feature = "diagnostics")]
{
Expand All @@ -12409,6 +12418,13 @@ impl Meter {
let five = self.logged.elapsed() >= std::time::Duration::from_secs(5);
if five {
self.logged = std::time::Instant::now();
// (Here: the frame times are this meter's.)
self.stalls.line(
crate::pipeline::making(),
crate::pipeline::made(),
RESIDENT[1].load(Ordering::Relaxed),
crate::residency::available_commit(),
);
}
// (The copy counters run from one five-second line to the next.)
#[cfg(feature = "diagnostics")]
Expand Down
Loading
Loading