d3d12: Series S profile output at 1440p or 4K with DLSS, off by default (D3D12-SERIES-S-1440-4K) #3412

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u origin "+refs/pull/3412/head:oreofr/series-s-1440-4k"
git switch "oreofr/series-s-1440-4k"
Open
leonida/mandy
OreoFR wants to merge 1 commit from oreofr/series-s-1440-4k into main AGit

This pull request has changes conflicting with the target branch.

Merge manually to resolve the conflicts.

Conversation
Reviewers 0 approvals
  • No reviewers
Details

This pull request has changes conflicting with the target branch.

Merge manually to resolve the conflicts.

  • d3d12/scripts/play-nvidia.ps1
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3412/head:oreofr/series-s-1440-4k'
git switch 'oreofr/series-s-1440-4k'
Member

Item: D3D12-SERIES-S-1440-4K (claimed in #3312).

What and why

Our Series S profile outputs 1920x1080; the Series X presets output 2560x1440 (LEONIDA_OUTPUT_1440). This lets the Series S profile output 2560x1440 or 3840x2160 through DLSS, experimental and off by default.

Ported after Darner (TrustNo1/Darner, GPL-3.0-or-later) commits f3080a5, d55c9fd, cb07682 by Jesper-Andersson (built on their #301; apps/darner/src/native_1440p.rs, heap_budget.rs, streamline/plan.rs Mode::for_series_s_output). Credited in each touched file.

  • leonida-loader/src/series_s_output.rs (new, portable): the decision. LEONIDA_SERIES_S_OUTPUT=1440|2160 applies only on the Series S profile with LEONIDA_UPSCALE=dlss in a DLSS build and without LEONIDA_OWN_UPSCALER; otherwise refused with one line saying why, and the game's 1920x1080 stays. Without DLSS the Series S title stops at boot with a scene of 1080 lines or more (Darner cb07682), hence the refusal.
  • Scene held to 1280x720 at most (Darner's Mode::for_series_s_output, by scale): performance (1/2) at 1440, ultra performance (1/3) at 2160. A LEONIDA_RENDER_SCALE that is a DLSS mode and fits is kept; anything else is replaced.
  • leonida-loader/src/hooks.rs: the patches, all or none (apply_all): the Series S UI pool immediate (mov eax, 0x5200000 to 0x5E00000 / 0x8000000), Darner's settings code in the int3 padding at 0x55ff285 (writes the output size, legacy UI flag/size into the title's video settings on every store), and the jump at the settings store. At 2160 the existing SERIES_S_LARGER pair (Series X render-target pool 2199 MB, 64 KiB-page heap 710 MB) goes in the same all-or-none set. Only applied, the scene scale is pinned through the existing render-scale lever.
  • apps/leonida/src/run.rs: decides before the image is mapped (console and DLSS build known there), prints the result and a VRAM note at 2160.
  • Scripts: -SeriesSOutput 1440|2160 on d3d12/scripts/play-nvidia.ps1 (refused on Series X, with -NoDlss/-Resolution/-Lowest, and again after the F1 menu's values if the upscale is not DLSS; replayed by SAVE AND RESTART; VRAM note under 10 GB) and on scripts/play-d3d12.ps1 (needs -SeriesS). The launcher (tools/leonida_launcher.py, #3405 open) is not touched: it can add a choice later.
  • Docs: README switch row, d3d12/README.md paragraph (VRAM: Darner's one 4K run peaked at 5.6 GB), d3d12/docs/switches.md regenerated.

Game bytes

No bytes of the title are added beyond what hooks.rs already does: offsets, the 5-byte mov eax, imm32 expectation (as SCANOUT_RESERVATION's), and for the 11-byte settings store only Darner's BLAKE3 hash of the stock bytes; those bytes are read from the player's image at load time and checked against the hash before anything is written. The padding must be all int3. The cave code is our (Darner's) own instructions.

Differences from Darner

  • Only the Series S pool immediate is patched (Darner also patches the Series X one, which the Series S cmovne never takes).
  • At 4K our existing SERIES_S_LARGER heap patch is used (heap size only, not the table total as Darner does); it is the one that already took Series S at scale 1.0 into the world.

Tests

  • cargo test -p leonida-loader -p leonida --locked: pass (new: plan/refusal/scene-scale tests, UI pool sizes, cave code and jumps, refusal on non-stock bytes through the levers). console_insn::tests::a_clzero_loop_becomes_plain_stores failed once in a parallel run and passes alone; untouched here.
  • With LEONIDA_GAME_DIR pointing at the player's 1.0.2.1 copy (file read only, game not started): the_resolution_places_are_in_the_retail_executable passes, including Darner's stock hash, the free padding, the Series S pool bytes, and the full patch through apply_levers on the image laid out as mapped, at 1440 and 2160 (output size, pool, jump, scene scale 0.5 / 1/3 in both upscalers, budgets at 2160 only).
  • cargo clippy -p leonida-loader -p leonida --all-targets --locked -- -D warnings: clean.
  • cargo build --profile diag -p leonida --locked: OK.
  • python -I tests/test_play_series_s_output.py (new, 6 tests: set with DLSS, refused without DLSS / with the own upscaler / on Series X, VRAM note, menu restart replay, play-d3d12 wants -SeriesS), tests/test_d3d12_switches.py, tests/test_docs_links.py, tests/test_docs_cli_flags.py, scripts/check_no_game_data.py on every changed file: pass.

In-game test pending (RTX 4070 Laptop 8 GB). Nothing here was run in game.

AI-assisted (Claude Code). Windows 11; no GPU used for these tests.

🤖 Generated with Claude Code

Item: **D3D12-SERIES-S-1440-4K** (claimed in #3312). ## What and why Our Series S profile outputs 1920x1080; the Series X presets output 2560x1440 (`LEONIDA_OUTPUT_1440`). This lets the Series S profile output **2560x1440 or 3840x2160 through DLSS**, experimental and **off by default**. Ported after Darner (TrustNo1/Darner, GPL-3.0-or-later) commits `f3080a5`, `d55c9fd`, `cb07682` by Jesper-Andersson (built on their #301; `apps/darner/src/native_1440p.rs`, `heap_budget.rs`, `streamline/plan.rs` `Mode::for_series_s_output`). Credited in each touched file. - `leonida-loader/src/series_s_output.rs` (new, portable): the decision. `LEONIDA_SERIES_S_OUTPUT=1440|2160` applies only on the Series S profile with `LEONIDA_UPSCALE=dlss` in a DLSS build and without `LEONIDA_OWN_UPSCALER`; otherwise refused with one line saying why, and the game's 1920x1080 stays. **Without DLSS the Series S title stops at boot with a scene of 1080 lines or more** (Darner `cb07682`), hence the refusal. - Scene held to **1280x720 at most** (Darner's `Mode::for_series_s_output`, by scale): performance (1/2) at 1440, ultra performance (1/3) at 2160. A `LEONIDA_RENDER_SCALE` that is a DLSS mode and fits is kept; anything else is replaced. - `leonida-loader/src/hooks.rs`: the patches, all or none (`apply_all`): the Series S UI pool immediate (`mov eax, 0x5200000` to 0x5E00000 / 0x8000000), Darner's settings code in the int3 padding at 0x55ff285 (writes the output size, legacy UI flag/size into the title's video settings on every store), and the jump at the settings store. At 2160 the existing `SERIES_S_LARGER` pair (Series X render-target pool 2199 MB, 64 KiB-page heap 710 MB) goes in the same all-or-none set. Only applied, the scene scale is pinned through the existing render-scale lever. - `apps/leonida/src/run.rs`: decides before the image is mapped (console and DLSS build known there), prints the result and a VRAM note at 2160. - Scripts: `-SeriesSOutput 1440|2160` on `d3d12/scripts/play-nvidia.ps1` (refused on Series X, with `-NoDlss`/`-Resolution`/`-Lowest`, and again after the F1 menu's values if the upscale is not DLSS; replayed by SAVE AND RESTART; VRAM note under 10 GB) and on `scripts/play-d3d12.ps1` (needs `-SeriesS`). The launcher (`tools/leonida_launcher.py`, #3405 open) is not touched: it can add a choice later. - Docs: README switch row, d3d12/README.md paragraph (VRAM: Darner's one 4K run peaked at 5.6 GB), `d3d12/docs/switches.md` regenerated. ## Game bytes No bytes of the title are added beyond what `hooks.rs` already does: offsets, the 5-byte `mov eax, imm32` expectation (as `SCANOUT_RESERVATION`'s), and for the 11-byte settings store only Darner's BLAKE3 hash of the stock bytes; those bytes are read from the player's image at load time and checked against the hash before anything is written. The padding must be all `int3`. The cave code is our (Darner's) own instructions. ## Differences from Darner - Only the Series S pool immediate is patched (Darner also patches the Series X one, which the Series S `cmovne` never takes). - At 4K our existing `SERIES_S_LARGER` heap patch is used (heap size only, not the table total as Darner does); it is the one that already took Series S at scale 1.0 into the world. ## Tests - `cargo test -p leonida-loader -p leonida --locked`: pass (new: plan/refusal/scene-scale tests, UI pool sizes, cave code and jumps, refusal on non-stock bytes through the levers). `console_insn::tests::a_clzero_loop_becomes_plain_stores` failed once in a parallel run and passes alone; untouched here. - With `LEONIDA_GAME_DIR` pointing at the player's 1.0.2.1 copy (file read only, game not started): `the_resolution_places_are_in_the_retail_executable` passes, including Darner's stock hash, the free padding, the Series S pool bytes, and the full patch through `apply_levers` on the image laid out as mapped, at 1440 and 2160 (output size, pool, jump, scene scale 0.5 / 1/3 in both upscalers, budgets at 2160 only). - `cargo clippy -p leonida-loader -p leonida --all-targets --locked -- -D warnings`: clean. - `cargo build --profile diag -p leonida --locked`: OK. - `python -I tests/test_play_series_s_output.py` (new, 6 tests: set with DLSS, refused without DLSS / with the own upscaler / on Series X, VRAM note, menu restart replay, play-d3d12 wants -SeriesS), `tests/test_d3d12_switches.py`, `tests/test_docs_links.py`, `tests/test_docs_cli_flags.py`, `scripts/check_no_game_data.py` on every changed file: pass. **In-game test pending (RTX 4070 Laptop 8 GB).** Nothing here was run in game. AI-assisted (Claude Code). Windows 11; no GPU used for these tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
LEONIDA_SERIES_S_OUTPUT=1440|2160 (play scripts: -SeriesSOutput 1440|2160) makes
the Series S profile output 2560x1440 or 3840x2160 instead of 1920x1080, through
DLSS from a scene of 1280x720 at most (performance at 1440, ultra performance at
2160). Refused without DLSS or with the title's own upscaler: the Series S title
stops at boot with a scene of 1080 lines or more. At 2160 the existing Series S
larger budgets (render-target pool 2199 MB, heap 710 MB) go in the same
all-or-none patch set.

The loader writes the output size into the title's video settings through code
in int3 padding, and grows the Series S UI pool. Only offsets, a 5-byte
immediate expectation and a BLAKE3 hash of the stock settings store are in the
source; the store is read from the player's image and checked before writing.

After Darner (TrustNo1/Darner, GPL-3.0-or-later) commits f3080a5, d55c9fd,
cb07682 by Jesper-Andersson. Not run in game yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OreoFR referenced this pull request from a commit 2026-12-04 02:26:46 +00:00
Sign in to join this conversation.
No description provided.