Skip to content

games/upscaler: a profile can make MetalFX the default for the game's own upscaler - #2722

Closed
Esteban-V wants to merge 1 commit into
seedds:mainfrom
Esteban-V:game/upscaler-profile-default
Closed

Esteban-V wants to merge 1 commit into
seedds:mainfrom
Esteban-V:game/upscaler-profile-default

Conversation

@Esteban-V

Copy link
Copy Markdown
Contributor

What and why

DM_UPSCALER=metalfx (PR #1459) draws a game's NDSR upscaler shaders with MetalFX's spatial scaler, but only when the player picks it; the default was the game's own network for every game. For Ocarina of Time it is the cheaper choice on every Mac measured, so this lets a profile choose the default.

 game.tsv            +upscaler  game | metalfx          (default game; metalfx refused when the shader map has no upscaler shaders)
 game.py             +#define DM_GAME_UPSCALER "…"
 settings.tsv        DM_UPSCALER default: game → DM_GAME_UPSCALER
 nvn_mtl.m up_mfx_on DM_UPSCALER unset / invalid → the profile's value (RED line for an invalid one)
 0400486024DEC000    +upscaler metalfx

Games without the key behave exactly as before (upscaler defaults to game). The player's saved choice and env.txt still win. Players of Ocarina of Time who never changed the setting move to MetalFX, by design (docs/frontends.md); one who wants the game's network picks "Game's own".

Evidence for Ocarina of Time (from #1459): M4 Pro, kokiri-deck, GPU p50 17.15 → 15.79 ms; M2 Air (issue #1911), upscale 2.50 → 1.31–1.38 ms. On a base M4 Mac mini (16 GB) it was played for several sessions with no visual problems reported, as part of a set of changes; not benchmarked alone there.

Checked

  • Tests: dm/tools/tests/test_game_profile.py, test_settings.py, test_launcher_settings.py, docs_patches.py --check pass. make -C dm/gfx/tests GAME=0400486024DEC000 check_t_upscaler_mfx: every run 0 failed, including a new unset run (takes the profile's MetalFX) and DM_UPSCALER=bogus (RED line, keeps the profile's choice); also checked with Donkey Kong Bananza, where unset and bogus keep the game's shaders.
  • Devices and OS: M3 Pro MacBook Pro, macOS 27.2.
  • Not checked: iOS. The default applies there too (shared host code, no platform split in settings.tsv); measured on the Mac only. The note says so.

Docs

  • Key documented in dm/games/README.md; docs/settings.md, docs/reference/rendering.md, docs/env_switches.tsv and the game's note updated; docs_patches.py entry added.
  • No game files, keys or data extracted from a game in the change or the attachments

… own upscaler

DM_UPSCALER=metalfx draws a game's NDSR upscaler shaders with MetalFX's spatial scaler, but only when the player picks it: the default was the game's network for every game. Ocarina of Time was measured faster with it (PR seedds#1459 and its follow-up): on an M4 Pro, kokiri-deck, DM_UPSCALER=metalfx took the frame's GPU p50 from 17.15 to 15.79 ms, and on an M2 Air the upscale from 2.50 to 1.31-1.38 ms. The picture was not washed out; the edges are softer.

The new profile key upscaler (game, the default, or metalfx) becomes DM_GAME_UPSCALER in the profile header. The host's up_mfx_on falls back to it when DM_UPSCALER is unset or not one of the two values (a red line names the bad value), and its log line says whether DM_UPSCALER or the profile chose MetalFX. The launcher's Game's upscaler row takes it as its default. game.py refuses metalfx for a profile whose shader map holds no upscaler shaders, since there would be nothing to replace. Ocarina of Time sets it, so players who never changed the setting move to MetalFX on that game, as a changed tested default does (docs/frontends.md, Saved choices); a saved choice or DM_UPSCALER=game keeps the network. The default applies on iOS too; it was measured on the Mac only.

Checked: test_game_profile.py and test_settings.py (the macro, its validation, the setting's default for Ocarina of Time), test_launcher_settings.py, test_docs.py, docs_patches.py --check, and make -C dm/gfx/tests check_t_upscaler_mfx with GAME=0400486024DEC000 and GAME=040074A01BF12000, which now also runs with DM_UPSCALER unset and with an unknown value: both follow the profile (MetalFX on Ocarina of Time, the game's shader on Donkey Kong Bananza), the test's expectation taken from DM_GAME_UPSCALER. The shader chain is unchanged.
@github-actions github-actions Bot added nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts) docs Documentation game: 0400486024DEC000 A game labels Nov 14, 2026
@gnavarro24

Copy link
Copy Markdown
Contributor

Hi! This branch is based on a main from before commit c70c242 ("ci: repair host and tool test failures on main"). Most of the failing checks here (Host unit tests, Tool tests, clang-tidy, Build check) come from that older base, not from this change.

To pick up the fix, merge the current main into this branch and push:

git fetch origin
git merge origin/main
git push

If the merge has conflicts, ask here if you want help with them.

@seedds

seedds commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thanks @Esteban-V for putting this together and testing it!

We're going to close this and keep the game's own upscaler as the default for now:

  • Visual trade-off and consistency: MetalFX's spatial scaler visibly softens edges and shifts dark levels compared to Ocarina of Time's own upscaler, and players who want the extra ~1.3 ms of GPU headroom on Mac can already switch Game's upscaler to MetalFX in the settings window. Keeping the game's own upscaler as the default matches our other Switch 2 games (such as Donkey Kong Bananza and Splatoon Raiders).
  • Unvalidated iOS default: As written, the profile default applies to iOS as well, where MetalFX hasn't been measured on Ocarina of Time yet. Because Ocarina's upscaler format needs two extra full-size intermediate textures per cached dynamic-resolution size, enabling it by default on iOS without device testing risks extra memory pressure on iPhones.
  • What was checked: Reviewed the diff against current main (including the current per-platform default mechanism, Ocarina of Time's Mac numbers, and its MetalFX texture path); no code changes were landed.
  • Still open: Speeding up the translated upscaler shaders directly so every game benefits without changing the picture, and measuring MetalFX's GPU and memory impact on iOS if we revisit defaults later.

@seedds seedds closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 0400486024DEC000 A game nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants