feat(linux): AMD FSR 4 on Linux: the build compiles the Vulkan back end with it, for the player's own FSR 4 library #24
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/ui
area/updates
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!24
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:feat/linux-fsr4"
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 Linux the launcher shows AMD FSR 4 as "Windows only for now", but the game has had a Linux FSR 4 path for a while (a Vulkan FSR 4 library the player puts beside the game, such as fsr4-vk's
amd_fidelityfx_upscaler_vk.so). Builds just never compiled it in. With MagicBeanDev/Longshot#174, a Linux build with--fsrcompiles its own Vulkan back end with FSR 4. This PR offers the switch on Linux to match.What changed
Core/MakeGameCommand.cs: on Linux, FSR 4 passes--fsralone. Nothing of AMD's is fetched (AMD publishes no Linux runtime), there's noLONGSHOT_FFX_SDK, andLONGSHOT_VK_PREBUILTis dropped as it already is for DLSS, so the back end is compiled with FSR 4. The newFsrBuilds()is true on Windows, and on Linux only when the version's tools carrythird_party/fidelityfx(Longshot PR 174).Core/LauncherSettings.cs: a newFsrLinuxNoticerecords that the Linux notice was read. It is kept apart fromFsrLicense, so a launcher home shared with Windows never takes it for AMD's licence.Checked()keeps FSR on with either one.App/ViewModels/SettingsStepViewModel.cs,App/Views/SettingsStepView.axaml,App/Views/LicenceView.axaml: the AMD FSR 4 row shows on Linux, replacing the "Windows only for now" row. Turning it on shows "AMD FSR 4 on Linux" instead of AMD's licence. That screen says nothing is downloaded, the renderer is compiled with FSR 4 (a few minutes longer), and the player suppliesamd_fidelityfx_upscaler_vk.so, whose source and terms are theirs to check. Its button is "Turn on".FsrBuildable, fromFsrBuildswith the job's tools), the switch is greyed out and the row says "This version can't build it on Linux yet."App/ViewModels/BuildStepViewModel.cs: the build gets the acknowledgement for its platform. The build list and the failure report record FSR 4 as it was really built ("asked, not built" when the tools couldn't). The log says so when that happens.tests/launcher_core/Program.cs:--fsralone, with no prebuilt back end and no AMD runtime folder.--fsr, now with an explicit stub rather than the real disk.FsrBuildsis always true on Windows.Testing
python -I tests/test_launcher_core.py --dotnet ~/.dotnet/dotnet --longshot <Longshot checkout>: 582 checks passed on this head.python -I tests/test_release.py: OK.dotnet build App/LongshotLauncher.csproj -c Release --no-incremental -warnaserror: succeeded (Linux, .NET 10).Left for a follow-up
MakeGameCommand.ForCheck(the files step's check) always setsLONGSHOT_VK_PREBUILT. On a Linux CPU without AVX2 it therefore rejects the game files, even though a DLSS or FSR 4 build would compile its own back end. That was already true for DLSS before this PR, and fixing it means carrying the build's choices into the files step.Screenshots
To add: the settings step on Linux with the AMD FSR 4 row, and the "AMD FSR 4 on Linux" screen.
🤖 Generated with Claude Code
Code review only (diff and surrounding code read; no build or tests run). The Linux FSR 4 change looks right:
--fsralone, noLONGSHOT_FFX_SDK,LONGSHOT_VK_PREBUILTdropped as for DLSS, gated onthird_party/fidelityfxwhere Longshot PR 174'sappimage.shputs it (usr/share/longshot, which isToolsRoot).entry.Fsrnow records what was actually built, andfsris set inRun()beforeComplete()can run. The launcher never runs--updateitself (an Update or Rebuild passes the game files and--out), so make_game's.longshot_fsrmark can't turn FSR back on behind the launcher'sLONGSHOT_VK_PREBUILT. With FSR off the mark is removed, andbuild.py'sprebuilt_renderer()ignores the variable underLONGSHOT_FSRanyway.Findings, most severe first:
Core/SystemRequirements.cs,tests/launcher_core/RequirementsChecks.cs, the requirements card inFilesStepView.axaml/WizardViewModel.csand a README section (5 of the 11 files, about 180 lines) are a system-requirements check that the description doesn't mention. It's a separate topic: take it out of this PR and give it its own.FsrLicensenow also means "acknowledged the Linux notice", so it no longer always means AMD's licence was accepted (see inline).--checkstill runs with the prebuilt back end's AVX2 check, which an FSR or DLSS build skips (already true for DLSS).@ -135,1 +136,4 @@command = MakeGameCommand.For(job.Tools!, request, job.Service.Platform, job.Service.Home, LauncherService.LauncherPath);fsr = command.Arguments.Contains("--fsr");if (s.Fsr && s.FsrLicense && !fsr)lock (log) log.Add("AMD FSR 4: this version's tools carry no AMD FSR API headers for Linux, so it is built without FSR 4.");Nit: the
settings:line at 76 still says ", FSR 4" for this build, and so does the bug report's "FSR 4 on" (Report). This line corrects it two lines later, but writing the effective state (fsr) inReportwould make a pasted report unambiguous. Also, this message can only fire on Linux today. Nothing ties it there, so ifFsrBuildsever turns false on Windows it would still say "for Linux".@ -126,3 +125,4 @@if (value == s.Fsr) return;if (value && !s.FsrLicense){Main.Modal = new LicenceViewModel(Main, false, Linux, () => { s.FsrLicense = true; s.Fsr = true; Save(); RaiseUpscalers(); },Low: on Linux, "Turn on" sets
s.FsrLicense = true, although the comment at line 141 says there is no licence to accept there.LauncherSettingsdocuments a licence flag as "true only once its license was accepted", and on Windows that flag is what passes--accept-amd-licenseand shows "Licence accepted earlier.". A home shared across a dual boot (LONGSHOT_LAUNCHER_HOME, or a portable launcher's home) would carry a Linux acknowledgement into a Windows build that downloads AMD's runtime without the player ever seeing AMD's licence. A separate flag for the Linux notice (andwindows ? r.FsrLicense : r.FsrNoticeinMakeGameCommand.For, withChecked()following) would keep the two apart.@ -141,2 +141,3 @@// (Linux: nothing of AMD's is downloaded, so there is no licence to accept; the player's own library goes beside the game)public bool FsrAccepted => s.Fsr && Windows;public string FsrLine => Linux ? "" : s.Fsr ? "" : s.FsrLicense ? "Licence accepted earlier." : "Shows AMD's licence first.";public string FsrLine => Linux ? (s.Fsr ? "Put amd_fidelityfx_upscaler_vk.so beside the game." : "Needs your own Vulkan FSR 4 library.")Medium: on Linux this row is offered whatever the version's tools are. Only an AppImage with Longshot PR 174 carries
third_party/fidelityfx, and no release has it yet. With an older one,MakeGameCommand.Forquietly leaves out--fsr: the player turns it on, reads "Put amd_fidelityfx_upscaler_vk.so beside the game.", and gets a build without FSR 4. The only sign is the log line under Show details.Job.Toolsis known by step 2 (Startalready needs it), soMakeGameCommand.FsrBuilds(Job.Tools, Job.Service.Platform)could drive this line, e.g. "This version's tools can't build FSR 4 on Linux yet", or disable the switch for such tools.Low (already true for DLSS):
ForCheck(line 113, below this hunk; anchored here, onFsrBuilds) builds its environment from a request with no FSR, soLONGSHOT_VK_PREBUILTis always set for--check. make_game'scheck()runscheck_cpu(), which returns early only withoutLONGSHOT_VK_PREBUILTor withLONGSHOT_FSR=1. On a Linux CPU without AVX2, the files step therefore rejects the game files, even though an FSR 4 (or DLSS) build compiles its own back end and Longshot PR 174 makescheck_cpulet it through. That's rare (an RX 9000 with a pre-AVX2 CPU), but worth knowing. A fix would pass the upscaler choice intoForCheck.@ -0,0 +1,116 @@using System.Runtime.InteropServices;High: this file,
tests/launcher_core/RequirementsChecks.cs, the requirements card inApp/Views/FilesStepView.axamlandApp/ViewModels/WizardViewModel.cs, and the README's new last paragraph aren't part of FSR 4 on Linux, and the description doesn't mention them. Please drop them from this PR (one topic) and open them separately if they're wanted.@ -772,3 +773,3 @@"-I", lin.MakeGame, "--romfs", "/d/romfs", "--exefs", "/d/exefs", "--out", "/g", "--language", "fr", "--work", "/w","--jobs", "6", "--no-prepare-shaders", "--fetch-ngx-sdk", "--accept-nvidia-license",}), "Linux arguments (no FSR): " + string.Join(" ", l.Arguments));}), "Linux arguments (tools without AMD's FSR API headers: no FSR): " + string.Join(" ", l.Arguments));Nit: this check now claims "tools without AMD's FSR API headers", but
lis built with nodirectoryExistsstub, so it holds only becauseDirectory.Existsfinds nothing under the scratch home. Passing_ => falsewould make the claim explicit, likelf/lfubelow do. There's also no Linux case with DLSS and FSR together (argument order, one own back end).5f2c02c96ba7780720c3WIP: feat(linux): AMD FSR 4 on Linux: the build compiles the Vulkan back end with it, for the player's own FSR 4 libraryto feat(linux): AMD FSR 4 on Linux: the build compiles the Vulkan back end with it, for the player's own FSR 4 librarySelf-review fixes (
a7780720):