loader: interface by its root size below 4K (fixes phone screen, nearby missions, map icons) #50

Manually merged
github merged 1 commit from github-bot/gh-49 into gh-pr/49/base 2026-12-05 09:28:51 +00:00 AGit
Owner

@⁠GiovanniFadanelli on GitHub · 2026-12-04 16:53 UTC · original
GiovanniFadanelli:fix/ui-root-size-below-4k → main · +126 −1 · 1 files · 1 commits · merged 2026-12-05 09:27 UTC

Summary

Fixes the interface below 4K output (e.g. VICTORY_OUTPUT=2560x1440): with the fwui layout scale from 36ea0e5 the HUD was the right size, but the phone screen's content was drawn in the top-left two thirds of the phone (the rest black) and the nearby-missions markers (hold D-pad down) were out of place.

Change

crates/victory-loader/src/resolution.rs, no new switch, Series S mode (own interface) unchanged:

  • Interface laid out by its root size. Below 2160 lines the UI root size (+0x1492d7924/28, written with the output size at +0x1de410a) becomes the output times 2160 / height (3840x2160 at 2560x1440). The title then lays its whole interface out as at 4K, draws it into a target of that size and scales that target to the output itself, so every part stays in proportion, including the phone and the 3D-anchored markers. The fwui scale patches are not written in that case; the pause-map cursor patches still are.
  • Screen map at the output size. The screen map instance takes its size from the UI root (+0x1833fd0), but the targets it draws into stay at the output size, so with the root at 3840x2160 its blips sat off the map, more so the further from the centre. The two loads at +0x1833fe3/+0x1833fed now read the output size (+0x148fdc560/+0x1491ac9fc), and +0x2a61610's size check calls the UI root provider's output-size slot (+0x18 instead of +0x30) so the map is not rebuilt every update.

Every site is compared byte for byte before it is written, as the other resolution patches are. Unit tests check the new displacements.

Test plan

  • cargo clippy --locked -p victory-loader --all-targets -- -D warnings
  • cargo build --release --locked -p victory
  • cargo test --locked -p victory-loader -- --test-threads=1
  • In game at 2560x1440 (RX 9070 XT), checked by eye: HUD, phone, nearby-missions markers, pause-map icons at several zoom levels, hover/click on the map, minimap
  • Other outputs (1920x1080, ultrawide) not checked by eye
  • NVIDIA not tested

🤖 Generated with Claude Code

**@⁠GiovanniFadanelli** on GitHub · 2026-12-04 16:53 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/49) `GiovanniFadanelli:fix/ui-root-size-below-4k` → `main` · +126 −1 · 1 files · 1 commits · merged 2026-12-05 09:27 UTC ## Summary Fixes the interface below 4K output (e.g. `VICTORY_OUTPUT=2560x1440`): with the `fwui` layout scale from 36ea0e5 the HUD was the right size, but the **phone screen's content** was drawn in the top-left two thirds of the phone (the rest black) and the **nearby-missions markers** (hold D-pad down) were out of place. ## Change `crates/victory-loader/src/resolution.rs`, no new switch, Series S mode (own interface) unchanged: - **Interface laid out by its root size.** Below 2160 lines the UI root size (+0x1492d7924/28, written with the output size at +0x1de410a) becomes the output times `2160 / height` (3840x2160 at 2560x1440). The title then lays its whole interface out as at 4K, draws it into a target of that size and scales that target to the output itself, so every part stays in proportion, including the phone and the 3D-anchored markers. The `fwui` scale patches are not written in that case; the pause-map cursor patches still are. - **Screen map at the output size.** The screen map instance takes its size from the UI root (+0x1833fd0), but the targets it draws into stay at the output size, so with the root at 3840x2160 its blips sat off the map, more so the further from the centre. The two loads at +0x1833fe3/+0x1833fed now read the output size (+0x148fdc560/+0x1491ac9fc), and +0x2a61610's size check calls the UI root provider's output-size slot (`+0x18` instead of `+0x30`) so the map is not rebuilt every update. Every site is compared byte for byte before it is written, as the other resolution patches are. Unit tests check the new displacements. ## Test plan - [x] `cargo clippy --locked -p victory-loader --all-targets -- -D warnings` - [x] `cargo build --release --locked -p victory` - [x] `cargo test --locked -p victory-loader -- --test-threads=1` - [x] In game at 2560x1440 (RX 9070 XT), checked by eye: HUD, phone, nearby-missions markers, pause-map icons at several zoom levels, hover/click on the map, minimap - [ ] Other outputs (1920x1080, ultrawide) not checked by eye - [ ] NVIDIA not tested 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Below 2160 lines of output the interface was scaled by the fwui layout
scale (36ea0e5). At 2560x1440 that drew the phone screen's content in the
top-left two thirds of the phone and put the nearby-missions markers out
of place: they are not laid out by the root's scale.

Now the UI root size (+0x1de410a) is written as the output times
2160 / height (3840x2160 at 2560x1440): the title lays its interface out as
at 4K, draws it into a target of that size and scales it to the output
itself, so every part of the interface stays in proportion. The fwui scale
patches are not written then; the pause-map cursor patches still are.

The screen map instance takes its size from the UI root, but the targets
it draws into stay at the output size, so its blips sat off the map (more
so further from the centre). +0x1833fd0 now reads the output size for the
screen target, and +0x2a61610's size check asks the UI root provider's
output-size slot so the map is not rebuilt every update.

Checked by eye at 2560x1440: HUD, phone, nearby-missions markers, pause map
icons at several zooms, and minimap all right. Series S mode (own
interface) is unchanged. No new switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 16:55:02 +00:00
Author
Owner

@⁠pew404 on GitHub · 2026-12-05 03:57 UTC · original

Tested on 1920x1080 output, which the PR description does not cover (it was checked at 2560x1440).

Build: this branch (b84ce67), built from source, launched from the launcher UI.
RX 9060 XT 16 GB / Ryzen 5 5600 / 32 GB / Windows 11. Series X, output 1920x1080, FSR 4.1.2 Quality, Frame Gen off. ~17 min of play.

Log shows the new patches applied: UI root size 3840x2160, screen map width/height/size check from the output, pause-map cursor patches at 1920x1080.

Checked by eye, all correct:

  • HUD: health, stamina, money, missions, minimap, music
  • Phone: content fills the phone screen, no offset
  • Map icons and pause map: icons in place, no drift
  • Nothing out of place found

Before this PR (v0.3.0, Series X, 1920x1080 output) the HUD was drawn about 2x too large.
Performance in the same run: median 23.8 fps (p10 18.5, p90 30.0, 30 fps cap), no errors in the log.

Works on 1920x1080 for me.

**@⁠pew404** on GitHub · 2026-12-05 03:57 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/49#issuecomment-7431462992) Tested on 1920x1080 output, which the PR description does not cover (it was checked at 2560x1440). Build: this branch (b84ce67), built from source, launched from the launcher UI. RX 9060 XT 16 GB / Ryzen 5 5600 / 32 GB / Windows 11. Series X, output 1920x1080, FSR 4.1.2 Quality, Frame Gen off. ~17 min of play. Log shows the new patches applied: UI root size 3840x2160, screen map width/height/size check from the output, pause-map cursor patches at 1920x1080. Checked by eye, all correct: - HUD: health, stamina, money, missions, minimap, music - Phone: content fills the phone screen, no offset - Map icons and pause map: icons in place, no drift - Nothing out of place found Before this PR (v0.3.0, Series X, 1920x1080 output) the HUD was drawn about 2x too large. Performance in the same run: median 23.8 fps (p10 18.5, p90 30.0, 30 fps cap), no errors in the log. Works on 1920x1080 for me.
github-bot changed target branch from main to gh-pr/49/base 2026-12-05 09:28:45 +00:00
github manually merged commit b84ce675db into gh-pr/49/base 2026-12-05 09:28:51 +00:00
Author
Owner

@⁠MiguelAlexS on GitHub · 2026-12-05 12:28 UTC · original

On main at a6b5a99 (v0.6.0) the interface below 4K output is cut off for me: at 2560x1440 the pause menu, pause map, weapon wheel and loading screens end at 1706x960, i.e. two thirds of the screen, and the rest of the UI is missing (the world renders full screen behind it). It looks like the UI is laid out at 3840x2160 and scaled by 2/3, but only the top-left 2560x1440 of the 4K-sized UI target is drawn.

Setup: RX 9070 XT, Windows 11, built from source at a6b5a99, launcher, Series X, output 2560x1440, FSR 4.1.2 Native AA, PC quality, ray tracing off.

Log, all as expected:

  • resolution: patched site=0x1de410a what="UI root size (the UI's layout size)" value="3840x2160"
  • screen map width/height/size check from the output, pause-map cursor patches at 2560x1440 (inv=1.5000)

Ruled out: VICTORY_THIN_SPLIT (toggled off live, still cut); the FSR profile patches only change the render scale.

This PR was tested on its base 01852c0; main has many GPU/loader commits since then, so it may be an interaction with something merged afterwards. At 3840x2160 output everything is fine.

**@⁠MiguelAlexS** on GitHub · 2026-12-05 12:28 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/49#issuecomment-7437975501) On `main` at a6b5a99 (v0.6.0) the interface below 4K output is cut off for me: at 2560x1440 the pause menu, pause map, weapon wheel and loading screens end at 1706x960, i.e. two thirds of the screen, and the rest of the UI is missing (the world renders full screen behind it). It looks like the UI is laid out at 3840x2160 and scaled by 2/3, but only the top-left 2560x1440 of the 4K-sized UI target is drawn. Setup: RX 9070 XT, Windows 11, built from source at a6b5a99, launcher, Series X, output 2560x1440, FSR 4.1.2 Native AA, PC quality, ray tracing off. Log, all as expected: - `resolution: patched site=0x1de410a what="UI root size (the UI's layout size)" value="3840x2160"` - screen map width/height/size check from the output, pause-map cursor patches at `2560x1440 (inv=1.5000)` Ruled out: `VICTORY_THIN_SPLIT` (toggled off live, still cut); the FSR profile patches only change the render scale. This PR was tested on its base 01852c0; main has many GPU/loader commits since then, so it may be an interaction with something merged afterwards. At 3840x2160 output everything is fine.
Author
Owner

@⁠gopinet on GitHub · 2026-12-05 17:13 UTC · original

Adding a data point to @⁠MiguelAlexS's report above, same setup family (2560x1440 output, FSR 4.1.2 Native AA): here the gameplay HUD is missing altogether with Native AA, and comes back with the Quality preset.

Setup: RX 9060 XT 16 GB (driver 32.0.32029.2010), i5-12400F, 32 GB, Windows 11. Series X, VICTORY_OUTPUT=2560x1440, ray tracing off, frame generation off, launched with scripts\play.ps1 (diagnostics build). Same save, same scripted input in all three runs (walk a few steps, open the phone with D-pad up), 3 minutes each.

Build FSR preset Phone screen HUD (minimap, button prompts)
8f78f14 (before this PR) native drawn in the top-left two thirds of the phone present
a6b5a99 (with this PR) native correct missing
a6b5a99 (with this PR) quality correct present

So the phone fix works at 1440p in both presets, but with render size == output size the HUD plane does not reach the screen. With quality everything is right by eye.

The logs of the two a6b5a99 runs differ only in the preset (preset="native" quality=0 scale=1.0, expected_render=[2560, 1440] output=[2560, 1440] against the quality sizes). Both show the same patched sites:

  • resolution: patched site=0x1de410a what="UI root size (the UI's layout size)" value="3840x2160"
  • screen map height/width from the output, size check against the output-size slot, pause-map cursor patches at 2560x1440 (inv=1.5000)

The HUD is also missing in longer native sessions at 1440p with ray tracing on, so it does not depend on that. Not checked here: 1920x1080 output with native, pause menu and map (the cut-off described above).

One caveat on the build: my a6b5a99 runs were built with the open PRs #43, #117, #113 and #103 merged on top (VICTORY_THIN_ORDER off, VICTORY_TRIM_BELOW_MB unset); none of them touches victory-loader or presentation. I am looking for the cause locally and will post it here if I find it.

cc @⁠GiovanniFadanelli

**@⁠gopinet** on GitHub · 2026-12-05 17:13 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/49#issuecomment-7441966248) Adding a data point to @⁠MiguelAlexS's report above, same setup family (2560x1440 output, FSR 4.1.2 Native AA): here the gameplay HUD is missing altogether with Native AA, and comes back with the Quality preset. **Setup:** RX 9060 XT 16 GB (driver 32.0.32029.2010), i5-12400F, 32 GB, Windows 11. Series X, `VICTORY_OUTPUT=2560x1440`, ray tracing off, frame generation off, launched with `scripts\play.ps1` (diagnostics build). Same save, same scripted input in all three runs (walk a few steps, open the phone with D-pad up), 3 minutes each. | Build | FSR preset | Phone screen | HUD (minimap, button prompts) | |---|---|---|---| | `8f78f14` (before this PR) | `native` | drawn in the top-left two thirds of the phone | present | | `a6b5a99` (with this PR) | `native` | correct | **missing** | | `a6b5a99` (with this PR) | `quality` | correct | present | So the phone fix works at 1440p in both presets, but with render size == output size the HUD plane does not reach the screen. With `quality` everything is right by eye. The logs of the two `a6b5a99` runs differ only in the preset (`preset="native" quality=0 scale=1.0`, `expected_render=[2560, 1440] output=[2560, 1440]` against the quality sizes). Both show the same patched sites: - `resolution: patched site=0x1de410a what="UI root size (the UI's layout size)" value="3840x2160"` - screen map height/width from the output, size check against the output-size slot, pause-map cursor patches at `2560x1440 (inv=1.5000)` The HUD is also missing in longer `native` sessions at 1440p with ray tracing on, so it does not depend on that. Not checked here: 1920x1080 output with `native`, pause menu and map (the cut-off described above). One caveat on the build: my `a6b5a99` runs were built with the open PRs #43, #117, #113 and #103 merged on top (`VICTORY_THIN_ORDER` off, `VICTORY_TRIM_BELOW_MB` unset); none of them touches `victory-loader` or presentation. I am looking for the cause locally and will post it here if I find it. cc @⁠GiovanniFadanelli
Author
Owner

@⁠MiguelAlexS on GitHub · 2026-12-05 18:45 UTC · original

Follow-up to my report above, after @⁠gopinet's table: the preset decides it here too. Same build (a6b5a99), same setup, output 2560x1440, only the FSR preset changed from Native AA to Quality (expected_render=[1706, 960] output=[2560, 1440]):

  • pause menu, pause map, weapon wheel, phone, loading screens and gameplay HUD: all full screen, nothing cut off
  • waypoint click on the pause map lands on the cursor

The log shows the same patched sites as the Native AA run (UI root size … 3840x2160, pause-map cursor patches at 2560x1440 (inv=1.5000)), so the difference is only render size == output size. With Native AA the UI ends at 1706x960 for me (the pause menu and map cut off, HUD drawn), with Quality it is whole. So both reports look like the same bug: with Native AA the UI plane is composited at the wrong size or not at all.

Correction to my report: "the FSR profile patches only change the render scale" was wrong, the preset is what triggers it.

**@⁠MiguelAlexS** on GitHub · 2026-12-05 18:45 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/49#issuecomment-7443411817) Follow-up to my report above, after @⁠gopinet's table: the preset decides it here too. Same build (`a6b5a99`), same setup, output 2560x1440, only the FSR preset changed from Native AA to **Quality** (`expected_render=[1706, 960] output=[2560, 1440]`): - pause menu, pause map, weapon wheel, phone, loading screens and gameplay HUD: all full screen, nothing cut off - waypoint click on the pause map lands on the cursor The log shows the same patched sites as the Native AA run (`UI root size … 3840x2160`, pause-map cursor patches at `2560x1440 (inv=1.5000)`), so the difference is only render size == output size. With Native AA the UI ends at 1706x960 for me (the pause menu and map cut off, HUD drawn), with Quality it is whole. So both reports look like the same bug: with Native AA the UI plane is composited at the wrong size or not at all. Correction to my report: "the FSR profile patches only change the render scale" was wrong, the preset is what triggers it.
Author
Owner

@⁠gopinet on GitHub · 2026-12-05 19:06 UTC · original

Found the cause locally, and a small fix that works here. Thanks @⁠MiguelAlexS for the Quality run: your "ends at 1706x960" is exactly the fraction this predicts.

Cause. With this PR the UI root size is 3840x2160 below 4K output, so the title draws its interface into a 3840x2160 colour target. But the title only makes the interface's own depth-stencil (at the root size) when the render size differs from the output size. When they are equal (Native AA), two twin checks take the other branch:

  • title+0x1edb9ec: the own depth-stencil is not made (mov eax,[output width]; cmp eax,[render width]; jne <make it> … same for the heights)
  • title+0x31a7b0: the getter hands out the scene's depth-stencil, which has the render size, in place of the interface's own ([+0x7665cb0])

Every interface draw then has a 3840x2160 colour target with a 2560x1440 depth-stencil, and only the common top-left corner is drawn: output/root = two thirds at 1440p (1706x960 on screen), one half at 1080p. The minimap and button prompts sit outside that corner, which is the "HUD missing" I reported; the pause menu and map are cut at two thirds, which is the other report. With Quality the render size differs from the output, the own depth-stencil exists, and everything is whole.

Measured (frame captures of the interface pass in menus/loading screens at 2560x1440 output, diagnostics build):

Native AA, a6b5a99 Quality, a6b5a99 Native AA, with the fix
Interface draws captured 28 10 43
…with a 2560x1440 depth-stencil 28 0 0
…with a 3840x2160 depth-stencil 0 10 43

Viewport and scissor are 3840x2160 in all three. Read statically in the title image: the two checks and the sizes the two depth-stencils are made with. Assumed, not verified with the debug layer: that the clipping itself comes from the colour/depth size mismatch.

Fix tried here. Two one-byte in-memory patches, written only when the UI root size is written (output under 2160 lines) and both sites match their bytes:

  • title+0x1edb9f8: 75 24 → eb 24 (make the interface's own depth-stencil whatever the render size)
  • title+0x31a7bc: 75 24 → eb 24 (hand it out whatever the render size)

Both are the first jne of each check, right after cmp eax, [+0x99fecf8] (render width). All in crates/victory-loader/src/resolution.rs, next to the UI root site; nothing else changes, and nothing at 4K or on Series S.

Result (RX 9060 XT 16 GB, i5-12400F, Series X, frame generation off, 3-minute runs, no errors in the logs):

Output Preset Phone Minimap + prompts
2560x1440 Native AA correct present
2560x1440 Native AA + ray tracing correct present
2560x1440 Quality correct present (as before)
1920x1080 Native AA correct present (the unpatched build showed the same defect there, cut at one half)

Cost: one more depth-stencil, about 40 MB of VRAM; frame rate unchanged.

Not tested: pause menu, pause map and weapon wheel with the fix (the cut-off @⁠MiguelAlexS saw; by the mechanism they should be whole, but I have not looked), other output sizes and ultrawide, long sessions. Same build caveat as my previous comment (open PRs #43, #117, #113, #103 on top of a6b5a99).

cc @⁠GiovanniFadanelli @⁠ReTerryDavis

**@⁠gopinet** on GitHub · 2026-12-05 19:06 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/49#issuecomment-7443715199) Found the cause locally, and a small fix that works here. Thanks @⁠MiguelAlexS for the Quality run: your "ends at 1706x960" is exactly the fraction this predicts. **Cause.** With this PR the UI root size is 3840x2160 below 4K output, so the title draws its interface into a 3840x2160 colour target. But the title only makes the interface's *own* depth-stencil (at the root size) when the render size differs from the output size. When they are equal (Native AA), two twin checks take the other branch: - `title+0x1edb9ec`: the own depth-stencil is not made (`mov eax,[output width]; cmp eax,[render width]; jne <make it>` … same for the heights) - `title+0x31a7b0`: the getter hands out the scene's depth-stencil, which has the render size, in place of the interface's own (`[+0x7665cb0]`) Every interface draw then has a 3840x2160 colour target with a 2560x1440 depth-stencil, and only the common top-left corner is drawn: output/root = two thirds at 1440p (1706x960 on screen), one half at 1080p. The minimap and button prompts sit outside that corner, which is the "HUD missing" I reported; the pause menu and map are cut at two thirds, which is the other report. With Quality the render size differs from the output, the own depth-stencil exists, and everything is whole. **Measured** (frame captures of the interface pass in menus/loading screens at 2560x1440 output, diagnostics build): | | Native AA, `a6b5a99` | Quality, `a6b5a99` | Native AA, with the fix | |---|---|---|---| | Interface draws captured | 28 | 10 | 43 | | …with a `2560x1440` depth-stencil | 28 | 0 | 0 | | …with a `3840x2160` depth-stencil | 0 | 10 | 43 | Viewport and scissor are 3840x2160 in all three. Read statically in the title image: the two checks and the sizes the two depth-stencils are made with. Assumed, not verified with the debug layer: that the clipping itself comes from the colour/depth size mismatch. **Fix tried here.** Two one-byte in-memory patches, written only when the UI root size is written (output under 2160 lines) and both sites match their bytes: - `title+0x1edb9f8`: `75 24` → `eb 24` (make the interface's own depth-stencil whatever the render size) - `title+0x31a7bc`: `75 24` → `eb 24` (hand it out whatever the render size) Both are the first `jne` of each check, right after `cmp eax, [+0x99fecf8]` (render width). All in `crates/victory-loader/src/resolution.rs`, next to the UI root site; nothing else changes, and nothing at 4K or on Series S. **Result** (RX 9060 XT 16 GB, i5-12400F, Series X, frame generation off, 3-minute runs, no errors in the logs): | Output | Preset | Phone | Minimap + prompts | |---|---|---|---| | 2560x1440 | Native AA | correct | present | | 2560x1440 | Native AA + ray tracing | correct | present | | 2560x1440 | Quality | correct | present (as before) | | 1920x1080 | Native AA | correct | present (the unpatched build showed the same defect there, cut at one half) | Cost: one more depth-stencil, about 40 MB of VRAM; frame rate unchanged. **Not tested:** pause menu, pause map and weapon wheel with the fix (the cut-off @⁠MiguelAlexS saw; by the mechanism they should be whole, but I have not looked), other output sizes and ultrawide, long sessions. Same build caveat as my previous comment (open PRs #43, #117, #113, #103 on top of `a6b5a99`). cc @⁠GiovanniFadanelli @⁠ReTerryDavis
This discussion has been locked. Commenting is limited to contributors.
No description provided.