Game: a Builder update (or any window-less run) re-chooses Auto (this PC) for no screen and lowers the player's resolution #165
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
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/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#165
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What happened
Updating a game folder with the Builder lowered the player's output resolution:
longshot_options.iniwent fromoutput_res=2560x1440(Auto's own choice for a 2560x1440 165 Hz screen) tooutput_res=2048x1152, with a newauto_for=fingerprint andauto_tuned=dropped. The player only ran the update; nothing was changed in the menu.Any run without a real window does it the same way, so it isn't specific to the update: a headless start of the game (
HOS_HEADLESS=1) from that folder rewrote the same three lines again a few minutes later.Why (from the source at main
434712bb)auto_settings::fingerprint()(gpu/vk/auto_settings.h) includes the screen's size (h.screen_w,h.screen_h). The Builder's shader preparation (--prepare-shaders, no window) and a headless start see no real screen, so the fingerprint differs from the one the options file keeps (auto_for=).menu_auto_for_gputhen chooses again for that "screen" and writes it into the player's options file (auto_for = auto_fp,auto_tuned = 0, a newoutput_res).A normal windowed start afterwards sees the real screen again, so its fingerprint matches whatever was there before, and it keeps what the window-less run wrote. Restoring the old file fixes it: with the real window, the log says
vk: Auto (this PC): the settings chosen for this PC before (NVIDIA GeForce RTX 3080, 10051 MB of video memory, dedicated, screen 2560x1440 at 165 Hz, ...)and nothing changes.Steps
longshot_options.inihasauto_for=andoutput_resfor your screen.--cli --nup <file> --out <folder>), or start the game once withHOS_HEADLESS=1.longshot_options.ini:output_res,auto_forandauto_outputhave changed andauto_tunedis gone.Where in the game
Not in the game: the Builder's update (its shader preparation) and any window-less start.
Hardware and version
RTX 3080 10 GB, NVIDIA 621.14, i9-12900K, 64 GB RAM, Windows 11; main screen 2560x1440 at 165 Hz. nightly-34-545618fc updated to nightly-46-434712bb.
A fix that seems natural
Don't choose Auto again (and don't write the options file's Auto lines) in a run with no window: the preparation and headless starts. Either skip
auto_profile()there, or leave the screen size out of the fingerprint when it isn't a real screen. Players who update otherwise lose their resolution silently, and with "Auto" still shown in the menu.Taking this. The cause is narrower than I wrote: on Windows
auto_profile()(gpu/vk/vk_main.cpp) reads the screen only through the game's window (if (main_window && GetMonitorInfoW(MonitorFromWindow(main_window, MONITOR_DEFAULTTOPRIMARY), ...))), so a run with no window fingerprints a 0x0 screen, which never matchesauto_for=.MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY)gives the primary monitor, so the plan is to drop themain_window &&: the preparation and a headless start then fingerprint the player's real primary screen and leave the options alone. Linux reads the size through the window too (desktop_size); I'll say in the PR what that path does with no window.