feat(host): a widescreen picture up to 5120x2160's pixels, native for 21:9 at the 4K output #2120
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2120
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/wide-past-4k"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On a 5120x2160 (21:9) monitor, the 3840x2160 output with Ultrawide on made a 4416x1864 picture, which the window copy then stretched to the screen: the monitor never got a native frame, and the Output resolution row showed 4416x1864. The cap behind it, 3840x2160's pixels, came from issue 1031, where a 32:9 screen's 7680x2160 picture ran its render targets' pool out. A 21:9 screen's native picture needs a third more pixels than 4K, not twice as many, and the pool already grows with the picture.
What changed
host/hos_wide_size.h: a picture wider or narrower than 16:9 takes at most 5120x2160's pixels (was 3840x2160's). At the 4K output a 21:9 screen gets its native 5120x2160, and the Output resolution row says "5120x2160 (native)". A 32:9 screen at the 4K output is still capped, now at 6256x1760 (was 5400x1520), its shape kept.host/nn_applet.calready scales the render-target pool with the picture's pixels, to 915 MB at 5120x2160 (test_rt_pool_minimum.pynow checks that case).HOS_WIDE_MAX_PX=<pixels>sets another cap without a rebuild (8294400 is the old 3840x2160's), in case a GPU needs the smaller picture. Listed indocs/development.md; the readme gives the new cap.Relation to #2052
Merged with current main; #2052's code is kept as merged (the output limits,
hos_wide_clampup to 48:9, the 24-row alignment at 48:9). With the new cap:test_widescreen_shapes.pykeeps #2052's 6528x1224 cases (the 24-row alignment and the four-decimal5.3333) underHOS_WIDE_MAX_PX=8294400, the old cap, and adds the full-size 7680x1440 and 48:9 at 2160.test_output_resolution.py's 7680x1440 output is full size;test_rt_pool_minimum.pyadds 48:9 at the 4K output.Tested
tests/run_all.pyon Windows (llvm-mingw) after the merge: 339 passed, 30 skipped, 4 failed. The 4 also fail on untouched main on this PC:test_recorder_sync(its exit case),test_precompile_compute_guard,test_bake_portability, andnx2/test_nup_read_name(no zstandard here).test_widescreen_shapes.py,test_output_resolution.py,test_rt_pool_minimum.pyandgpu/vk/tests/present_rect_test.cpppass.Not tested
This and the Aspect ratio PR (#2119) edit the same readme paragraph, so whichever merges second needs a one-line merge.
🤖 Generated with Claude Code
This looks right to me. I checked the render-target pool for each new size against
hos_rt_pool_size(host/nn_applet.c:180):The test changes move expectations to the new sizes and keep #2052's 24-row and
5.3333cases underHOS_WIDE_MAX_PX=8294400instead of dropping them, which is what I'd want. StrippingHOS_WIDE_MAX_PXfrom the fixture's environment keeps a developer's own setting from leaking in. The new switch is documented indocs/development.md, the readme sentence is updated, and the host and menu agree because both call the samehos_wide_max_px()(the menu already readsHOS_OUTPUT_RESthe same way). It merges cleanly with current main, and CI is green.A few small things, none blocking:
host/hos_wide_size.h:35-39:HOS_WIDE_MAX_PXhas a floor but no ceiling. The documented use is lowering the cap, but a value above the default at the 4K output brings back exactly #1031. 7680x2160 asks for a 1373 MB pool, and the description of #1031 says a pool that size failed the game's reservation at boot. Clamping it (v > 5120.0 * 2160.0 ? 5120.0 * 2160.0 : v), or saying in the development.md row that it's for lowering only, would stop someone "raising" it into a crash.HOS_WIDE_MAX_PX=8294400? As it stands, the only way back is an undocumented-for-players environment variable. Not a blocker; just asking whether you looked at memory use on a smaller card.github-sync referenced this pull request2026-11-12 06:22:54 +00:00