Skip to content

vi::QueryDisplayBufferMaxResolution answers from the display the game is shown on - #971

Open
capibawa wants to merge 1 commit into
seedds:mainfrom
capibawa:display-buffer-from-screen
Open

capibawa wants to merge 1 commit into
seedds:mainfrom
capibawa:display-buffer-from-screen

Conversation

@capibawa

@capibawa capibawa commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What and why

This is split out of #957, as offered in its closing comment. main answers vi::QueryDisplayBufferMaxResolution with 4K for every docked game, whatever the screen. A docked Switch 2 answers with what its TV takes, and the game sizes its rendering from that answer. This change answers the same way: in handheld mode, the 1080p screen; docked, the largest of 720p / 1080p / 1440p / 4K that the display the game is shown on holds.

The display's size comes from a new front-end call, front_display_pixels:

  • on the Mac, the main display in its current mode (front_mac.m);
  • on iOS, the screen's nativeBounds, in landscape (front_ios.m);
  • otherwise a weak default, which falls back to 1080p.

The host logs the answer once. The entry under The display's largest buffer now describes this answer.

Checked

  • Builds and tests:
    • make -C dm/host GAME=04007EF01F8AE000 dmhost builds.
    • dm/ios/tools/compile_check.py passes (187 files).
    • dm/tools/tests/test_docs.py passes.
    • The new host boots Fire Emblem Fortune's Weave with one takeover of the name and logs vi::QueryDisplayBufferMaxResolution: 2560x1440 (docked, display 3456x2234).
  • Fire Emblem Fortune's Weave (04007EF01F8AE000, v131072):
    • On the 3456x2234 MacBook Pro screen, the answer is 1440p. The game renders 1024x576 into a 2048x1152 DLSS output, the same as with main's 4K answer, so nothing changes on this Mac.
    • With the front end reporting 1920x1080, it renders 960x540 into 1920x1080, which matches the screen, and holds 30 fps (p95 33.9 ms over 300 frames).
    • Both runs used this branch's own host, with the game's shader libraries built for main's chain version.
  • Devices and OS: MacBook Pro M3 Pro, macOS 27.0.1. On iOS, only the compile check ran.
  • regress.py: not run. Only Switch 2 games call this query, and none is in the local harness.

Docs

  • The finding is in its docs/reference/services.md entry, and python3 dm/tools/docs_symptoms.py was run (no change to the index)
  • No game files, keys or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

… is shown on

The host answered 4K for every docked game, whatever the screen. A docked Switch 2 answers with what its TV takes, and a game sizes its rendering from that answer. On a 1080p display, Fire Emblem Fortune's Weave rendered for a larger output than the screen shows, and the host then scaled that output down.

hle_vi.c now answers as a Switch 2 does. In handheld mode it gives the 1080p screen. Docked, it gives the largest of 720p, 1080p, 1440p and 4K that the display holds. The front end reports the display's size through front_display_pixels: the Mac's main display in its current mode (front_mac.m), or an iPhone's or iPad's screen (front_ios.m). A weak default covers builds without a front end, and the answer is 1080p when the size is not known. The host logs the answer once.

Checked: on a 3456x2234 MacBook Pro screen the answer is 1440p, and Fire Emblem Fortune's Weave renders 1024x576 into a 2048x1152 DLSS output, the same as with the 4K answer. With the front end reporting 1920x1080, it renders 960x540 into 1920x1080 at 30 fps (p95 33.7 ms). The host builds and boots the game with one takeover of the name. The iOS compile check (187 files) and test_docs pass. The services.md entry describes the new answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) ios The iPhone and iPad app (dm/ios) mac The Mac front end and app (dm/mac, front_mac.m) docs Documentation labels Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host) ios The iPhone and iPad app (dm/ios) mac The Mac front end and app (dm/mac, front_mac.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant