WIP: fix(bug-report): the report's picture keeps the screen's shape #1143
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1143
Loading…
Reference in a new issue
No description provided.
Delete branch "enum/Longshot:fix/bug-report-picture-shape"
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?
Type: fix · Risk: low · Tested on: Windows 11, RTX 4070 · Needs: Linux, any GPU (a renderer build)
Why
The Insert menu's Bug report saves a picture of the game, and on any screen that isn't 16:9 that picture is distorted.
It is always 1280x720, so a 3440x1440 screen's frame is squeezed into it: 0.372 across but 0.5 down, and everything in
it looks tall and thin, the HUD included. #1133's picture looks so and sent the triage looking for a stretched HUD
that the screen does not have. The reporter's own full-size screenshot later showed the HUD at its true shape: each
heart 45x34 pixels, as here. Part of #1133: what is left there is the HUD's place on a wide screen, not this.
How to reproduce
Seen on: Windows 11 Pro (26300), RTX 4070, NVIDIA 616.56, on a 3440x1440 monitor in fullscreen
Settings and switches: Aspect ratio 21:9 (monitor's), Output resolution 3440x1440
Steps: in play, Insert menu > Gameplay > Bug report; open the report folder's
picture.pngExpected: a picture in the screen's shape
Actual: 1280x720, everything in it tall and thin
What changed
The bug report's picture now keeps the screen's shape, fitted into 1280x720: 1280x536 at 21:9, 1152x720 at 16:10,
1280x720 at 16:9. The control bridge's shots keep their size and their log line.
shot_ask_next(the report's picture, its only caller) asks through the newshot_ask_aswithshapeset.shot_ask_recordthen fits the frame intokShotWxkShotHwithpresent_rect, by the display aspect thewindow's present uses for its bars (
host->aspect_ratio, else the frame's or the crop's own shape). The headlessframe, already squeezed to the shot's size, is fitted the same way. The frame is blitted to the image's corner,
only that rectangle is copied back, and
shot_ask_takewrites the PNG at that size. The image and the buffer staykShotWxkShotH. All ingpu/vk/vk_replay.cpp.shot_ask(the control bridge's) isshot_ask_aswithoutshape: stillkShotWxkShotH, asdocs/control.mdsays, and its log line is byte for byte as before (tests/test_longshot_ctl.pymatches it). Thereport's line names its picture and size.
bug_report_picture(vk_menu.cpp) andshot_ask_next(vk_internal.h) describe the new size.tests/test_bug_report.py's checks ofshot_ask_nextandshot_ask_recordname the new calls, as they namedthe old.
Measurements
Verdict: passes. The new check fails on
mainfor the bug and passes here. In the game, on a 3440x1440 monitor, thereport's picture goes from 1280x720 (squeezed) to 1280x536, scaled the same across as down.
Hardware: Windows 11 Pro (26300), RTX 4070 (616.56), Ryzen 9 7900X, 64 GB; a 3440x1440 monitor
Scene: Kokiri Forest, the repository's
kokiri-startsave, in play; Aspect ratio 21:9, Output resolution 3440x1440,NVIDIA DLSS, Frame generation 2x (DLSS FG), NVIDIA Reflex on, fullscreen
Method: a Bug report saved from the Insert menu (keyboard), its
picture.png's size and scale against the 3440x1440frame;
main's renderer and this one in the same game folderHow to reproduce: the steps above;
python -I -B tests/run_all.py test_bug_report_picture71b1edd81ff0e4eetests/test_bug_report_picture.pypicture.png, 3440x1440 screenrun_all.py(Windows)(The in-game run used this change before its last commit, which made the report's log line name its picture and size,
(the bug report's picture, 1280x536). That change only touches the line's text, as the check shows.)Flags and settings
None. (
gpu/vk/vk_menu.cppchanges only a comment, abovebug_report_picture.)Testing
Tested:
tests/test_bug_report_picture.py(new) runsvk_replay.cpp's shot asks with stand-ins for the blit, the readback andthe PNG writer. It covers 21:9, 16:10, 16:9, the headless frame, two crops and the bridge's shot, and checks the
readback's barrier and invalidate sizes. It fails on
mainand passes here, on Windows (llvm-mingw clang) and Linux(WSL, g++ 15). Undoing the fix fails its cases again, and so does a readback barrier sized too small.
test_bug_report,test_longshot_ctland the full suite (above).test_bug_report_defaultsfails here as onmain(Auto's shadow_res, diagnosed on #773).
main's renderer and with this one. Pictures and scalesare above.
(0 at 16:9 and handheld, 1.25 to 5.33 otherwise), the threading. It found two stale comments and two test gaps, all
fixed here.
Not tested: a 16:10 or 4:3 monitor in the game (covered by the check, not run). A whole renderer build on Linux:
the renderer was built on Windows (llvm-mingw,
RX_VK_ONLY=1 nx2/build.py --standalone, 0 failed); on Linux only theshot code the check cuts out was compiled (g++ 15). Linux in the game: the change is in the renderer's common code,
with no platform branch.
Must be tested:
RX_VK_ONLY=1 python -I nx2/build.py --standalone), expecting it to compile and link with no new warning ingpu/vk/vk_replay.cpp; and, if a game is at hand, a Bug report on a screen that is not 16:9, expectingpicture.pngin the screen's shape (Test Farm: @Beanstalk linux, a renderer build of this branch)Risks
What could break: the bug report's picture only. The control bridge's shots, the per-frame shots (
RX_VK_SHOTS)and the headless output are unchanged.
Turning it off: revert the commit
Compatibility: Nothing changes for a player but the picture's size in a bug report on a screen that isn't 16:9.
MkwVkHostandMkwVkRendererare unchanged, so no API version bump.Issues
See #1133
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
Tested in game: Windows 11 Pro (26300), RTX 4070, NVIDIA 616.56, on a 3440x1440 monitor in fullscreen (Aspect ratio 21:9, Output resolution 3440x1440, DLSS, DLSS FG 2x, Reflex): in play in Kokiri Forest (kokiri-start save), Insert menu > Gameplay > Bug report saved with main's renderer and with this one in the same game folder. main: picture.png 1280x720, squeezed (0.372 across, 0.5 down). This PR: 1280x536 (0.3721 across, 0.3722 down), the same spot, report.txt and the log written as before.
WIP: fix(bug-report): the report's picture keeps the screen's shapeto fix(bug-report): the report's picture keeps the screen's shapefix(bug-report): the report's picture keeps the screen's shapeto WIP: fix(bug-report): the report's picture keeps the screen's shape@Beanstalk linux, any GPU: build the renderer from this branch (RX_VK_ONLY=1 python -I nx2/build.py --standalone) and say whether it compiles and links with no new warning in gpu/vk/vk_replay.cpp. If a game folder is at hand, save an Insert menu > Gameplay > Bug report on a screen that isn't 16:9 and give picture.png's size (expected: the screen's shape, 1280x536 at 21:9).
@enum only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.