Repository navigation
fix: the capture button saves the game's own frame, not the letterboxed window picture - #2168
Merged
Merged
Conversation
…ed window picture The controller's capture button (screenshot.h) copied the presented drawable: the window content, letterbox bars included, at the window's resolution. It now asks the renderer for the game's own frame (mtl_grab_next_game_frame, next to the diagnostics' mtl_grab_next_present): at the next present the game's picture -- the present's crop region of the source texture, that is the output resolution, before the MetalFX output upscale -- is copied into a shared buffer, and the commit feedback handler hands out the CGImage at that resolution; the source canvas can be larger than the picture (a 2560x1440 canvas with 1920x1080 output) and its remainder is undefined fill. An HDR or unexpected source frame, or a read-back buffer that cannot be made, falls back to the drawable copy (which tone-presses an HDR drawable to SDR); a present that cannot draw answers NULL like the window grab does. wshot and TOTK_WINDOW_SHOT keep the window picture, so TOTK_WSHOT_SRC still compares the 2K output with its source. The front ends call the game-frame grab first and the window grab when a build links only that. docs/controls.md says the saved picture is the game's own frame; the OoT copy is the same (the graphics layer is shared, the front ends and screenshot.h are identical).
ly05010419
added a commit
that referenced
this pull request
Nov 14, 2026
Owner
|
已合并并推送,补充修正见 cb6dac11。
HDR 源仍采用 drawable 回退。本轮未重做窗口/全屏或 HDR 的实际截图验收。谢谢贡献。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The capture button saves a copy of the presented drawable — the window content in pixels. That includes the letterbox bars around the game picture, and it caps the picture at the window's resolution even when the game renders internally at a higher one (the present's MetalFX upscale then downsamples into the window).
Change
The capture button now asks the renderer for the game's own frame. A new
mtl_grab_next_game_frame(next to the diagnostics'mtl_grab_next_present, same guard) makes the next present copy the game's picture — the present's crop region of the source texture, that is the output resolution, before the MetalFX output upscale — into a shared buffer in the same command buffer, and the commit feedback handler hands out the CGImage at that resolution: no letterbox bars, no window cap, none of the present-side boxes. The source canvas can be larger than the picture (a 2560x1440 canvas with 1920x1080 output); its remainder is undefined fill, so the copy takes the crop region.wshot/TOTK_WINDOW_SHOTkeep capturing the window picture;TOTK_WSHOT_SRCstill pairs it with its source.nvn_mtl.mis the shared hard-linked graphics layer; its front ends and screenshot.h are wired identically).docs/controls.md(+ zh-CN) states the saved picture is the game's own frame at its render resolution, without the bars.Tests
make check-cpasses (12 C tests,screenshot: all checks passfor both variants).make -C games/totk runtimelinksbuild/totk-nativewith the frontend compiled-Werror(the run then stops at the local untrackedanalysis/phase12-validation.jsondata target, unchanged from main — not in the repository).make check: 1493 tests, 2 failures, 17 skipped — both reproduce on a pristine checkout of this PR's base (70099c1f):test_one_folder_rule.DefaultWork.test_apps_in_a_folder_whose_parent_cannot_be_written_go_to_the_home_folder(reads the machine's real /Applications plists; environment-dependent) andtest_oot_ios_mip_drop.OotIosMipDrop.test_ios_keeps_few_pipeline_archives_open(the source-content assertion behind nvn_archive_map.h changes).Honest note on CI: upstream main is red on its own CI — run 43441200958 (
70099c1f, this PR's exact base): Source tests (settings) fails 4 ×test_current_modes_and_refresh(AssertionError: -6 != 0 : [settings] the contributors were not read: Could not connect to the server.), Source tests (core) fails 1 ×test_ios_keeps_few_pipeline_archives_open(the pipeline-archive source-content assertion). None of that red comes from this PR; thetestjob is the workflow's needs-gated aggregate.Known limitation: an HDR source frame still captures the letterboxed drawable (tone-pressed to SDR) — a follow-up can read the HDR source directly.