Skip to content

d3d12: fix oversized HUD and menus at native 1440p - #3014

Open
Rulemore wants to merge 2 commits into
ProjectLeonida:mainfrom
Rulemore:fix/native1440-ui
Open

Rulemore wants to merge 2 commits into
ProjectLeonida:mainfrom
Rulemore:fix/native1440-ui

Conversation

@Rulemore

@Rulemore Rulemore commented Dec 1, 2026 •

Copy link
Copy Markdown

Claimed in the coordination issue as: D3D12-NATIVE1440-LEGACY-UI.

Depends on: #2889, #2958 for coordination of the overlapping output planner; whichever lands second needs rebasing. This narrow fix includes no code from either PR and can otherwise stand alone.

What and why

Series X at -Resolution 1440 -NoDlss currently shrinks the 4K mode row and Settings viewport. The game's 4K-authored HUD and menus are then laid out on a 1440p stage, making them oversized.

Port the native-1440p legacy UI mechanism from DexNom/VIctory via VIctory-NVIDIA: retain the stock 4K mode row and Settings viewport; set the legacy UI flag, 3840x2160 layout and 2560x1440 output whenever video settings are copied. Enlarge the UI pool to 94 MiB for the two legacy surfaces and two 1440p targets. Scene scale remains independently controlled by the existing render-scale hooks. Other output sizes retain their existing experimental path.

The new trampoline is guarded by the original site's hash and its padding. Patch groups now validate and snapshot all ranges, reject overlaps, and stage all page protections before writing. A protection failure restores staged protections without installing a partial control-flow patch. Protections are restored in reverse order for ranges sharing a page.

Tested

  • New native-1440p layout regression fails on the original planner and passes with this change.
  • cargo test --locked -p leonida-loader --lib: 92 passed, including the optional supported-image guard checks with LEONIDA_GAME_DIR set locally.
  • Tests cover trampoline targets and settings offsets, hash rejection, protection-staging failure, successful writes/reverse restoration, overlap rejection, and both native and existing non-native output guards.
  • cargo clippy --locked -p leonida-loader --lib --tests --no-deps: passed.
  • Optimized diag build with diagnostics,mimalloc: passed.
  • Changed-file clean-room scan and git diff --check: passed.
  • Native 1440p startup smoke test reaches the profile/start screen with the corrected UI layout and no UI-pool assertion. The user subsequently confirmed that the in-game HUD is correctly sized too. Full pause-map and extended play validation are not claimed here. No performance gain is claimed.

GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 617.14, Windows 11 build 26200; Series X, native 2560x1440, DLSS and frame generation off (startup smoke only).

AI-assisted: OpenAI Codex (GPT-6); independent read-only review by GPT-6.2 Sol. Review findings were addressed and the revised diff reviewed again.

Checklist

  • Based on upstream main 2705632.
  • One topic; no ultrawide feature or shader-translator changes.
  • No game files, logs, screenshots, dumps, keys or decryption changes included.

@andrew-ai

Copy link
Copy Markdown

The current-behavior paragraph in docs/ultrawide.md, lines 130–133 still says the 1440p profile changes the 3840×2160 mode row and points the Settings viewport at it. At this revision the 2560×1440 case returns early and preserves the 4K UI layout. This affects both an explicit LEONIDA_OUTPUT=2560x1440 and the LEONIDA_OUTPUT_1440=1 shorthand when no explicit size is set.

Please qualify the existing description as applying to other output sizes, and describe native 1440p separately. I ran the generated-switches check at 64c4b3e and it exited 0. That check covers the switches table, while this discrepancy is in the hand-written guide. Source and documentation review only.

Codex-assisted.

@Rulemore

Rulemore commented Dec 1, 2026

Copy link
Copy Markdown
Author

Updated in 973f31d. The guide now describes native 2560x1440 separately: stock 4K mode/Settings viewport, legacy 4K UI layout, 1440p output targets and the 94 MiB UI pool. It also documents the LEONIDA_OUTPUT_1440 fallback and limits the old experimental mode-row/viewport description to other non-stock output sizes. Documentation only; changed-file clean-room scan and git diff --check passed. Codex-assisted.

@andrew-ai

Copy link
Copy Markdown

Confirmed the documentation correction at 973f31d. The guide now matches the native 2560x1440 selection, its fallback when the explicit output is blank, and the separate path for other non-stock sizes. The generated switches check also passes. My documentation finding is resolved. Codex-assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants