Skip to content

Build FSR 3.1 from FidelityFX SDK sources on Linux and Windows - #68

Open
f1ames0ff wants to merge 11 commits into
masterfrom
feature/linux-support
Open

f1ames0ff wants to merge 11 commits into
masterfrom
feature/linux-support

Conversation

@f1ames0ff

@f1ames0ff f1ames0ff commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Replaces the checked-in prebuilt amd_fidelityfx_vk provider with a source build of the vendored FidelityFX SDK 1.1.4 (renderer submodule commit a286fda1).
  • Linux: build_linux.sh builds the provider with a glslangValidator permutation generator, then configures and builds the engine. The provider is FSR3.1-only, exports the five FFX API entry points, carries the libamd_fidelityfx_vk.so SONAME and is resolved through RUNPATH.
  • Windows: build_win.ps1 builds the provider through AMD's SDK CMake and bundled FidelityFX_SC.exe, then passes QR_FFX_VK_LIBRARY/QR_FFX_VK_RUNTIME_DLL to the renderer. Deployment, editor and GPU-test targets copy the source-built DLL.
  • Source fixes: luma-history storage image is rgba16f; the opaque FSR3 context grows for 32-bit wchar_t; Vulkan scratch arrays are 16-byte aligned (fixes the GCC -O2 movaps crash in CreateBackendContextVK); portable FFX_API_ENTRY; non-MSVC version literal.

Linux verification

  • Clean build/linux-clean build from scratch: provider and 40 permutation headers built, CTest 6/6 passed.
  • In-game FSR 3.1: provider 3.1.4, dispatch 854x480 -> 1280x720; qperfdump shows GPU upscale 0.21 ms and CPU upscale avg 0.220 ms.
  • All modes dispatch (Native AA, Quality, Balanced, Performance, Ultra Performance); live 1280x720 -> 960x540 resize recreated the context and dispatched 640x360 -> 960x540.
  • 45-second FSR run: no crashes, assertions, validation messages or TAAU fallback warnings.

Windows verification

Windows CI run 42023882552 passed both Debug and Release: build_win.ps1 built the provider from the vendored FidelityFX sources, the dumpbin check found all five ffxCreateContext/ffxDestroyContext/ffxConfigure/ffxQuery/ffxDispatch exports in amd_fidelityfx_vk.dll, and CTest passed the non-GPU suite. The hosted runner has no Vulkan device, so an in-game Windows run remains the manual GPU gate.

Full details: docs/fsr-linux-source-build.md and renderer/Source/FidelityFX_SDK_1.1.4/README.md.

Fresh-clone follow-up

A fresh clone of the pushed branch initially exposed one missing piece: build_linux.sh did not apply the pinned NVRHI max-binding-layouts patch, so the RT pass was unavailable and the game aborted. The script now applies the patch for the build and reverses it on exit, exactly like build_win.ps1. Re-verified from the fresh clone: the source-built provider dispatches 854x480 -> 1280x720, and the NVRHI submodule is clean after the build.

f1ames0ff added 11 commits November 18, 2026 20:37
Restore the Unix platform layer removed by the Windows-only cleanup (pl_linux, sys_sdl_unix, net_bsd/net_udp, POSIX helpers) and merge the non-Windows CMake branches back into the current build: GCC flags, system Vulkan/SDL2/OpenAL, codec find_package paths, and the platform source lists. Port the Win32-only file handling in the pkz, material loader and editor to POSIX (opendir/readdir, rename, tmpfile, pkz handle dispatch), define _GNU_SOURCE for mimalloc's clock_gettime, and supply max/min for the texture manager. The renderer submodule gains the Xlib surface and the non-Windows FSR stub; the NVRHI max-binding-layouts patch is applied to the submodule by the Linux build script.
The host now builds the FSR 3.1 Vulkan provider from the vendored FidelityFX SDK before configuring the engine. build_win.ps1 builds the provider with AMD's SDK CMake and deployment copies the source-built DLL; build_linux.sh builds the Linux .so with the glslangValidator permutation generator. The renderer submodule pointer advances to the source-build commit.

Linux verification: provider 3.1.4 dispatches 854x480 -> 1280x720, GPU upscale 0.21 ms and CPU upscale 0.220 ms, no TAAU fallback; CTest 6/6 passed. Windows source build is wired but requires a Windows build/run to be exercised.
A fresh Linux checkout otherwise builds with c_MaxBindingLayouts at the stock 8, so the RHI ray-tracing pass is unavailable and the game aborts with 'the frame cannot be drawn'. Mirror build_win.ps1: apply third_party/nvrhi-max-binding-layouts.patch for the build and reverse it on exit. Verified from a fresh clone of the pushed branch: the provider dispatches 854x480 -> 1280x720 and nvrhi is clean after the build.
The windows-2022 hosted image has no usable Vulkan SDK, and the vendor NSIS installer can hang in a headless session (Start-Process -Wait follows its child process tree). The job now downloads the headers and dxc assets directly and uses the repository's checked-in vulkan-1.lib, avoiding the installer entirely. This is required for the Windows FSR source-build gate to start.
Picks up renderer 25af42d: the two ffx-api headers use <FidelityFX/...> instead of the case-mismatched <FidelityFx/...>, and the tracked FidelityFx symlink is removed. That symlink was the cause of the Windows CI provider copy failure (Copy-Item could not resolve it). Patch 0006 covers external SDK checkouts.
Picks up renderer commit for the QR_DXC hint order and passes -DQR_DXC from build_win.ps1 when VULKAN_SDK is set. This unblocks the Windows CI GPU-test shader probes, which were picking the Windows SDK dxc without SPIR-V codegen.
The Debug qray_cluster_lists_tests and qray_gpu_context_tests exit with 0xc0000135 while Release passes. Print dumpbin /dependents and the deployed DLL list before the test step so the missing loader is identified.
The Debug qray_cluster_lists_tests and qray_gpu_context_tests import vulkan-1.dll because their objects contain unreferenced Vulkan entry points; the hosted image has no system loader. Fetch the Silk.NET Vulkan loader native package and put vulkan-1.dll into the minimal SDK's Bin, which is on PATH for ctest. Remove the temporary dependency diagnostics step.
Windows CI run 42023882552 passed Debug and Release: provider source build, five-export dumpbin check and CTest. The hosted runner has no Vulkan device, so the in-game Windows run remains the manual GPU gate.
A workflow_dispatch Release run now attaches quakeray.exe, the runtime DLLs and id1 assets to a pre-release, so a Windows build can be downloaded and tested under Proton on a Linux GPU box. Normal PR/push runs are unchanged.
@f1ames0ff
f1ames0ff force-pushed the feature/linux-support branch from a38292e to 12bc91b Compare November 18, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant