build(vk): vendor AMD's FSR 3.1 passes and the script that compiles them #1313

Closed
notquiteog wants to merge 1 commit from pr/fsr-sdk-passes into main
notquiteog commented 2026-11-09 21:32:27 +00:00 (Migrated from github.com)

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/ 76 files of AMD's GPU sources from FidelityFX SDK v1.1.4 (c6efa6bf): the common core, fsr3upscaler, frameinterpolation, opticalflow, spd, fsr1. Unmodified, MIT, with LICENSE.txt and a PROVENANCE.md saying what each folder is and where it came from
scripts/fsr3_shaders.py compiles the passes into gpu/vk/shaders/fsr3_*_spv.h with the one option set the renderer will record them under; --check compares instead of writing
gpu/vk/shaders/fsr3_*_spv.h the 28 compiled headers, checked in like every other shader there, so a clone builds without glslang
tests/test_fsr3_shaders.py recompiles every pass and fails if a checked-in header no longer matches its source. In run_all.py with a {glslang} tool, skipped on Windows (as the spirv-val checks are); source-regressions.yml installs glslang-tools for it

No 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

  • Every vendored file compared byte for byte with AMD's repository at c6efa6bf7f2027b3ec94f28578bb5965eabb9e55: 76 of 76 identical.
  • python -I tests/run_all.py tests/test_fsr3_shaders.py with 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 of run_all.py and the workflow.

🤖 Generated with Claude Code

## 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/` | 76 files of AMD's GPU sources from FidelityFX SDK **v1.1.4** (`c6efa6bf`): the common core, `fsr3upscaler`, `frameinterpolation`, `opticalflow`, `spd`, `fsr1`. Unmodified, MIT, with `LICENSE.txt` and a `PROVENANCE.md` saying what each folder is and where it came from | | `scripts/fsr3_shaders.py` | compiles the passes into `gpu/vk/shaders/fsr3_*_spv.h` with the one option set the renderer will record them under; `--check` compares instead of writing | | `gpu/vk/shaders/fsr3_*_spv.h` | the 28 compiled headers, checked in like every other shader there, so a clone builds without glslang | | `tests/test_fsr3_shaders.py` | recompiles every pass and fails if a checked-in header no longer matches its source. In `run_all.py` with a `{glslang}` tool, skipped on Windows (as the `spirv-val` checks are); `source-regressions.yml` installs `glslang-tools` for it | No 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 - Every vendored file compared byte for byte with AMD's repository at `c6efa6bf7f2027b3ec94f28578bb5965eabb9e55`: **76 of 76 identical**. - `python -I tests/run_all.py tests/test_fsr3_shaders.py` with 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 of `run_all.py` and the workflow. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
hckrman101 (Migrated from github.com) reviewed 2026-11-09 23:24:54 +00:00
hckrman101 (Migrated from github.com) left a 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.

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.
NotRexed commented 2026-11-10 02:07:40 +00:00 (Migrated from github.com)

Superseded by #1386, which carries the same vendored FidelityFX SDK (v1.1.4, MIT) and compile script together with the FSR 3.1 upscaler and frame generation that use them. Closing so review happens in one place. Thanks!

Superseded by #1386, which carries the same vendored FidelityFX SDK (v1.1.4, MIT) and compile script together with the FSR 3.1 upscaler and frame generation that use them. Closing so review happens in one place. Thanks!
Commenting is not possible because the repository is archived.
No description provided.