Add frame generation through AMD's FSR SDK 2.4 as a setting to try with FSR 4, and never generate a frame without the HUD-less picture.

runtime/vk_fg4.cpp makes the frame generation swapchain and context with the libraries FSR 4 comes with
(amd_fidelityfx_loader_vk.dll and amd_fidelityfx_framegeneration_vk.dll beside the executable). vk_fg.cpp takes
that path only with fsr4_fg = 1 while FSR 4 is the upscaler; the default stays the FSR 3.1 library. The loader
picks the version for the card: the machine-learned FSR Frame Generation 4 on Radeon RX 9000 cards with Windows 11,
which is untested, and 3.1.6 elsewhere. On an RX 7900 XT (driver 26.10.1) it lists frame generation 3.1.6 and the
swapchains 4.0.0, which the driver brings and the loader chooses, and 3.1.7. The swapchain in place is wanted only
while its library is the one to use, so a change of the setting or of the upscaler, or a failure of this path,
takes it down as switching frame generation off does and the next present makes it with the other library.

The preparation gives this library the camera's position and axes, which FSR Frame Generation 4 requires, and a
scene scale of one metre a unit: with the 0.01 the FSR 3.1 path uses, version 3.1.6 drew grey translucent shapes
into the sky of its frames while the camera turned (160 captures of the screen during a camera sweep; clean with 1).

Both paths now generate a frame only when the picture without the HUD is there for it: generated from the
presented picture alone, the HUD would be warped with the scene behind it. In four configurations (21:9 with either
library, a 16:9 picture in a 21:9 window, a 1080 picture without HDR) every generated frame had it, and the log
counts the frames without. On screen, of the 6,404 pixels of the HUD's item button that stayed fixed through a
camera sweep with the FSR 3.1 library, 6,162 stayed fixed with this one.

Standing in Hyrule Field at 3440x1440 with FSR 4 Quality the game draws 43.0 frames a second with this path and
42.2 with the FSR 3.1 library, each shown twice over. One run changed the present mode, HDR, fullscreen, frame
generation, FSR 4, this setting and the upscaler in turn: 216 screenshots without a bad frame, and no failure.

The SDK's frame generation headers join runtime/third_party/ffx_sdk, unmodified. tools/make_kit.py and
tools/make_launcher.py take the third library from the --ffx4 folder when it is there, and tools/make_game.py
copies it beside the game.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
epicmeme546
2026-11-11 04:49:01 -05:00
parent 5833ad8e18
commit 5bdf583331
18 changed files with 1144 additions and 47 deletions

View File

@@ -165,7 +165,8 @@ beside the game.
`py -I tools\make_game.py --rebuild --out "C:\Games\Ocarina"` to draw them again (it skips everything else).
- The build copies NVIDIA's DLSS library `nvngx_dlss.dll` (with `nvngx_dlss-NOTICE.txt`, which names its licence)
and FSR 3.1's `amd_fidelityfx_vk.dll` beside `ocarina.exe` from the kit's `bin\`, and FSR 4's
`amd_fidelityfx_loader_vk.dll` and `amd_fidelityfx_upscaler_vk.dll` when the kit has both. To use another DLSS version, put
`amd_fidelityfx_loader_vk.dll` and `amd_fidelityfx_upscaler_vk.dll` when the kit has both (and
`amd_fidelityfx_framegeneration_vk.dll` for `fsr4_fg`). To use another DLSS version, put
your own `nvngx_dlss.dll` there: later builds keep it. On Linux the library is `libnvidia-ngx-dlss.so.<version>`
(see "Linux").
- A kit with `bin\dlssg\` (made with `tools/make_kit.py --dlssg`) also brings DLSS Frame Generation on GeForce RTX 40

View File

@@ -359,6 +359,7 @@ game folder is the default `<launcher>\game`. The dump is never touched.
`--ffx` puts AMD's signed `amd_fidelityfx_vk.dll` (FidelityFX SDK 1.1.4) in the release for FSR 3.1.
`--ffx4 <folder>` puts AMD's signed `amd_fidelityfx_loader_vk.dll` and `amd_fidelityfx_upscaler_vk.dll` (FSR SDK
2.4.0, the files of its `Kits/FidelityFX/signedbin/`) in the release for FSR 4; without it the menu offers no FSR 4.
`amd_fidelityfx_framegeneration_vk.dll` goes along when it is in that folder (`fsr4_fg`).
NVIDIA's `nvngx_dlss.dll` goes in by itself: the script downloads the version `tools/dlss_pin.py` pins from
NVIDIA's DLSS SDK repository (cached in `toolchain/launcher-dl/`), checks its size and sha256, and puts it in
`bin/` with `nvngx_dlss-NOTICE.txt`; `make_game.py` copies both beside the game. `--dlss FILE` takes a copy on disk

View File

@@ -28,6 +28,13 @@ Draft notes for the release after 0.7.1. The version number is not decided yet.
`amd_fidelityfx_upscaler_vk.dll`), which ask the driver whether the card can run FSR 4: the rows appear only
where it can, and the log names the version (`ffx4:`). It works together with FSR 3.1 frame generation, and you
can switch between FSR 3.1 and FSR 4 while playing.
- **Frame generation from AMD's newer library, to try** (`fsr4_fg = 1` in `nx2navi.ini`, with FSR 4 upscaling and
frame generation on): the frames are then generated by the library FSR 4 comes with (FSR SDK 2.4,
`amd_fidelityfx_framegeneration_vk.dll`) instead of the FSR 3.1 library. It picks the version for your card: on a
Radeon RX 9000 with Windows 11 that is AMD's machine-learned FSR Frame Generation 4, **which nobody has tested in
this game yet**; on every other card it is version 3.1.6, which on an RX 7900 XT runs at the same frame rate as
before and showed clean frames in a fast camera turn. It is off unless you set it, and when it fails the FSR 3.1
library takes over. Please report how it looks on an RX 9000.
- **Add to Steam** in Customize Launcher (Windows): adds the game to your Steam library as *The Legend of Zelda
Ocarina of Time*, with Navi as its icon and the title screen's artwork and logo. Starting it from Steam starts the
game. Steam restarts once while it is added.
@@ -36,6 +43,12 @@ Draft notes for the release after 0.7.1. The version number is not decided yet.
## Fixed
- A crash with frame generation (AMD FSR 3.1) set: switching Upscaling to a choice without FSR or DLSS and back, which
the Upscaling row does on its way through its choices, ended the game in AMD's driver. Frame generation was handed
the depth picture of the last frame before the switch, which the game had replaced by then.
- Frame generation never generates a frame from a picture with the HUD in it any more: a frame for which the picture
without the HUD is missing is shown as it is, so the HUD cannot be warped along with the scene behind it. On screen
the item button stayed pixel for pixel in place through a fast camera turn, with both frame generation libraries.
- Your own background picture in the launcher is no longer partly hidden under the top bar: it now starts right
below it, and keeps its shape.