Repository navigation
build(vk): vendor AMD's FSR 3.1 passes and the script that compiles them - #1313
notquiteog wants to merge 1 commit into
Conversation
The first part of NotRexed#822, split out as asked: AMD's FidelityFX SDK GPU sources for the FSR 3.1 upscaler, frame interpolation and optical flow, and scripts/fsr3_shaders.py, which compiles them into gpu/vk/shaders like every other shader there. Nothing in the renderer uses them yet; the backend that records these passes is a later, separate PR. - third_party/fidelityfx-sdk: 76 files from FidelityFX SDK v1.1.4 (commit c6efa6bf), unmodified, MIT, with PROVENANCE.md saying what each folder is. - gpu/vk/shaders/fsr3_*_spv.h: the 28 compiled headers, checked in so a clone builds without glslang. - tests/test_fsr3_shaders.py (in run_all, Linux only): recompiles every pass and fails if a checked-in header no longer matches its source; source-regressions installs glslang-tools for it. Tested: every vendored file compared byte for byte with AMD's repository at c6efa6bf (76 of 76 identical); tests/test_fsr3_shaders.py with glslang 16 and spirv-val: 28 match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hckrman101
left a comment
There was a problem hiding this comment.
Thanks for splitting this out. Provenance looks right: AMD's MIT notice in LICENSE.txt, and PROVENANCE.md with the upstream URL, v1.1.4 and the commit. A few things before it can go in:
CI red, caused by the workflow change. Adding glslang-tools to the apt install in source-regressions.yml puts glslangValidator on PATH. tests/test_dlss_actor.py only compares the SPIR-V words of the checked-in DLSS headers when glslang is present, so on main that check is skipped. With the apt glslang the words differ, and it fails with "dlss_actor_frag_spv.h is not made from dlss_actor.frag as it is now". Options: install the glslang that made the existing headers, scope the package to the FSR3 step only, or make that test tolerant of version differences. tests/test_fsr3_shaders.py itself passes.
Needs a rebase. It's 82 commits behind main and conflicts in tests/run_all.py.
Option set. This compiles with HDR_COLOR_INPUT=1 and INVERTED_DEPTH=1. #1095 compiles the same passes with LDR colour and standard depth, and says that matches the renderer's inputs from #1008. One of the two is wrong for what the renderer feeds in, and nothing here pins or checks the options. Worth reconciling against the backend that will record these passes.
Reproducibility. glslang isn't pinned, and the version that made the headers isn't recorded in the script or PROVENANCE.md. Recording it would help the next regeneration.
Overlap. #1095 vendors the same SDK commit into the same third_party path with the same fsr3_*_comp_spv.h names, and #1335 ships this same header set too, so only one of the three can land. This one is the superset (it adds frame interpolation and optical flow, which nothing uses yet). It would be good to settle with the other authors which one carries the shaders.
Nits: PROVENANCE says "eleven frame-interpolation passes", but FI_VARIANTS has 10. Comments mention gpu/vk/vk_fsr3.cpp and vk_fsr3fi.cpp, which don't exist on main.
What
The first part of #822, split out as requested there: only the vendored FidelityFX SDK sources and the script that compiles them. Nothing in the renderer uses them yet; the backend that records these passes, and the camera and frame-pacing changes, come later as separate PRs.
third_party/fidelityfx-sdk/c6efa6bf): the common core,fsr3upscaler,frameinterpolation,opticalflow,spd,fsr1. Unmodified, MIT, withLICENSE.txtand aPROVENANCE.mdsaying what each folder is and where it came fromscripts/fsr3_shaders.pygpu/vk/shaders/fsr3_*_spv.hwith the one option set the renderer will record them under;--checkcompares instead of writinggpu/vk/shaders/fsr3_*_spv.htests/test_fsr3_shaders.pyrun_all.pywith a{glslang}tool, skipped on Windows (as thespirv-valchecks are);source-regressions.ymlinstallsglslang-toolsfor itNo runtime library is involved: this is the SDK-source route, which runs on any GPU on Windows and Linux, not AMD's FidelityFX API.
Testing
c6efa6bf7f2027b3ec94f28578bb5965eabb9e55: 76 of 76 identical.python -I tests/run_all.py tests/test_fsr3_shaders.pywith glslang 16.2.0 and spirv-val: 28 match.Size
49,075 added lines, almost all of it the two mechanical parts: AMD's GLSL (unmodified, checked above) and the generated SPIR-V headers (checked by the test). The reviewable code is
scripts/fsr3_shaders.py, the test, and four lines ofrun_all.pyand the workflow.🤖 Generated with Claude Code