mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-24 13:45:57 +00:00
Merge pull request #1245: AMD FSR 4 upscales the 3D scene on Windows through AMD's signed FSR SDK 2.4 libraries (scene_upscaler = fsr4, off by default), and the setup can download them (codexx-dev) (#1409)
FSR 4 is a fourth engine of the scene upscaler beside DLSS and FSR 3.1 and takes their frame point, jitter, per-object motion vectors, mip bias, fsr_sharpness, FXAA skip and dynamic resolution hold. The PR's dlaa_backend setting, its FSR 3 through the DLL and its separate Upscalers row are left out: dev builds FSR 3.1 from the SDK 1.1.4 sources. Checked on an RX 9070: FSR 4.1.2 at quality, 1280x720 -> 1920x1080, picture clean; without the DLLs the upscaler stays off with a log line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
f1ec56b592
37 files changed
+1183
-133
No files matched your search
@@ -22,6 +22,9 @@ Report problems as issues, following [CONTRIBUTING.md](CONTRIBUTING.md).
|
||||
- Custom resolutions (1080p, 2k...), supersampling and AMD FSR 1 upscaling
|
||||
- NVIDIA DLSS / DLAA on RTX GPUs: the setup downloads `nvngx_dlss.dll` from NVIDIA's DLSS SDK repository
|
||||
(github.com/NVIDIA/DLSS, NVIDIA RTX SDK license) when it finds an RTX GPU; untick it in the setup to skip it
|
||||
- AMD FSR 3.1 on any GPU, and AMD FSR 4 on Windows on the Radeon GPUs AMD's FSR SDK libraries support, in the same
|
||||
modes as DLSS: for FSR 4 the setup downloads AMD's signed FSR SDK libraries
|
||||
(github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK, AMD FSR SDK license), ticked by default with an AMD GPU
|
||||
- HDR10 output with peak, game and HUD brightness settings
|
||||
- 16:10 (Steam Deck, handhelds), 3:2 (Surface, Framework), 21:9 and 32:9 (ultrawide) game resolutions, with the camera and the interface in that shape
|
||||
- Anisotropic texture filtering up to 16x, for sharp ground into the distance
|
||||
@@ -77,7 +80,8 @@ Requirements: Windows 10 or later, an x86-64 CPU with SSE4.2 (AVX2/FMA machines
|
||||
2. Start `TotK-Setup.exe`. If SmartScreen warns about an unsigned app, choose *More info*, then *Run anyway*.
|
||||
3. Pick your game files, the language and an install folder, and press *Start*. The setup builds the game once. With
|
||||
an NVIDIA RTX GPU it also downloads NVIDIA DLSS, unless you untick *Download NVIDIA DLSS*; turn DLSS on in the
|
||||
menu (F1).
|
||||
menu (F1). With *Download AMD FSR 4* ticked (the default with an AMD GPU) it downloads AMD's FSR SDK libraries;
|
||||
in the menu, pick *AMD FSR 4* as the *3D scene upscaler*.
|
||||
4. Play `totk.exe` from the install folder.
|
||||
|
||||
### Linux
|
||||
|
||||
@@ -41,6 +41,8 @@ Code copied or adapted from another project is listed here with its source, the
|
||||
| MacNativeGames host movie decoder (`movie::Decoder` for VP9 over libvpx: entry list, buffer and event semantics, NV12 output format, PTS pacing) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/totk/runtime/movie_host.c`, `movie_host.h`), Copyright (c) 2026 MacNativeGames contributors | MIT | `runtime/ov_movie.c`, `runtime/movie.h` |
|
||||
| libvpx 1.17.0 (MSYS2 `mingw-w64-ucrt-x86_64-libvpx`), static link (`libvpx.a`), no DLL shipped; the release notices must carry its BSD licence text and the WebM Project's `PATENTS` grant | https://chromium.googlesource.com/webm/libvpx, Copyright (c) 2010, The WebM Project authors | BSD-3-Clause | `runtime/ov_movie.c` (VP9 decoding of the `Event/Movie` WebM files) |
|
||||
| MacNativeGames TotK resolution patches: output, swapchain and scene size sites and instruction words for 1.2.1 and 1.4.3, the data-page layout, the HeapDef heap names and sizes | https://github.com/ly05010419/MacNativeGames @ `aaf6ba1f494fabaa209d049e528d6f923dfe822a` (`games/totk/runtime/game_patches.c`, `game_patches_v143.c`, `game_version.h`, `games/totk/scripts/make_output_res_overlay.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `recomp/patches-v121.txt`, `recomp/patches-v143.txt`, `runtime/resolution.c` |
|
||||
| AMD FSR SDK ffx-api declarations (`ffx_api.h`, `ffx_api_types.h`, `vk/ffx_api_vk.h`, `upscalers/include/ffx_upscale.h`, trimmed to the declarations used, layouts unchanged) | https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK @ tag `v2.4.0`, Copyright (C) 2026 Advanced Micro Devices, Inc. | MIT | `runtime/ffx_api_min.h` |
|
||||
| AMD FSR SDK signed binaries `amd_fidelityfx_loader_vk.dll` and `amd_fidelityfx_upscaler_vk.dll` (not in this repository or the release: the setup's `--fsr` step downloads AMD's copies into the install folder) | https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK @ tag `v2.4.0` (`Kits/FidelityFX/signedbin/`), Copyright (C) 2026 Advanced Micro Devices, Inc. | AMD FSR SDK license (`docs/license.md` of that tag): redistribution in binary form with its notice, no reverse engineering | loaded at run time by `runtime/vk_ffx.c` |
|
||||
| AMD FidelityFX Super Resolution 1.0 (`ffx_a.h`, `ffx_fsr1.h`, unmodified; licence text in `runtime/shaders/ffx/LICENSE.txt`) | https://github.com/GPUOpen-Effects/FidelityFX-FSR @ `a21ffb8f6c13233ba336352bdff293894c706575`, Copyright (c) 2021 Advanced Micro Devices, Inc. | MIT | `runtime/shaders/ffx/`, `runtime/shaders/fsr_easu.comp`, `runtime/shaders/fsr_rcas.comp` (compiled into `runtime/fsr_easu_spv.h`, `runtime/fsr_rcas_spv.h`) |
|
||||
| AMD Display Library (ADL) declarations: `AdapterInfo`, `ADLSingleSensorData`, `ADLPMLogDataOutput`, the `ADL_PMLOG_*` sensor numbers and the `ADL2_*` function signatures | https://github.com/GPUOpen-LibrariesAndSDKs/display-library @ `84c881cb2136f04287eb3af12de00a9e2867aa9e` (`include/adl_structures.h`, `include/adl_defines.h`, `include/adl_sdk.h`), Copyright (c) 2016 - 2022 Advanced Micro Devices, Inc. | MIT | `runtime/perfmon.c` |
|
||||
| Zstandard 1.5.7 (MSYS2 `mingw-w64-ucrt-x86_64-zstd`), static link | https://github.com/facebook/zstd, Copyright (c) Meta Platforms, Inc. and affiliates | BSD-3-Clause | `runtime/resolution.c` (the HeapDef table), `runtime/ov_zstd.c` (the game's zstd frames decoded on the host) |
|
||||
|
||||
@@ -139,6 +139,18 @@ Every guest thread is a host thread. TotK assumes Horizon's scheduler: three app
|
||||
that computes last frame's position from last frame's blocks (the game writes them into two copies that take turns;
|
||||
the uniform snapshot keeps both) and writes the difference into the motion image. `TOTK_MV_CHECK` measures the
|
||||
vectors against the picture, `TOTK_DLAA_TIMES` times the passes on the GPU. `fxaa` switches the game's own FXAA pass.
|
||||
- AMD FSR (`scene_upscaler = fsr3` or `fsr4`). The same frame, jitter and motion vectors (with the per-object pass)
|
||||
go to AMD's FSR instead of DLSS: `vk_dlaa.c` `evaluate` calls `fsr_evaluate` where it would call NGX, and everything
|
||||
around it is shared, including the texture bias (AMD's log2(scene / output) - 1), `fsr_sharpness` (FSR's own RCAS in
|
||||
place of the FXAA's sharpening), the skip of the game's FXAA and of its copy of the scene onto itself, and the dynamic
|
||||
resolution held at 100 %. The camera's planes and field of view come from the scene camera block (`vk_fg.cpp`
|
||||
`vk_fg_camera`). FSR 3.1 (`vk_fsr3.cpp`) is compiled from the FidelityFX SDK 1.1.4 sources and runs on any GPU. FSR 4
|
||||
(`vk_ffx.c`, Windows) is AMD's FSR SDK 2.4 signed libraries: `amd_fidelityfx_loader_vk.dll` is loaded at run time from
|
||||
the executable's folder and finds `amd_fidelityfx_upscaler_vk.dll` next to it; only the descriptor layouts of
|
||||
`ffx_api_min.h` are compiled in. At start the upscaler versions the libraries offer for the device are listed and the
|
||||
newest FSR 4 is pinned; without one the scene upscaler stays off (no FSR 3 from the libraries). `vk_device.c` enables
|
||||
`VK_KHR_cooperative_matrix` and `VK_EXT_shader_float8` with their features when FSR 4 is picked and the device has
|
||||
them. Both hold one context per output size, made again when it changes.
|
||||
- Occlusion queries never block the CPU; a result that is not ready counts as visible.
|
||||
- ASTC textures are uploaded as they are where the device reports `textureCompressionASTC_LDR`, and decoded by a compute shader everywhere else (`vk_astc.c`, `TOTK_ASTC`). The CPU decoder (`tex_astc*.c`) is the fallback and the test oracle.
|
||||
- Draw state. A draw whose program, bound state and textures repeat reuses the previous draw's shaders and skips rebuilding its descriptor sets; descriptor sets are written through update templates (`vk_exec_draw.c`, `vk_pipeline.c`).
|
||||
|
||||
+10
-1
@@ -26,6 +26,7 @@ The install folder (`main.c` `portable_paths()` reads this layout; it stays port
|
||||
<install folder>/
|
||||
totk.exe, SDL3.dll, libopus-0.dll, totk_xlate.exe
|
||||
nvngx_dlss.dll NVIDIA DLSS, downloaded by the setup's DLSS step when the player keeps it ticked
|
||||
amd_fidelityfx_*_vk.dll AMD FSR 4 (loader and upscaler), downloaded by the setup's FSR step likewise
|
||||
totk.ini language; the other keys as commented defaults (totk.ini.example)
|
||||
exefs/, romfs/ extracted from the player's files
|
||||
shared-fonts/ the Switch system fonts, with Chinese, Korean or Traditional Chinese text
|
||||
@@ -123,7 +124,15 @@ loads the saves 1.4.3 wrote.
|
||||
the library; NGX loads it from the folder of totk.exe for `dlaa` and the DLSS modes. A DLSS library already in the
|
||||
folder (a newer one the player put there) is kept. Without an RTX GPU the step only logs and does nothing; a failed
|
||||
download warns, the game runs without DLSS, and the next run of the setup tries again.
|
||||
10. **Clean up** the temp folder, except the generated C and the objects (about 1.3 GB), and write
|
||||
10. **FSR** (the window's tick box, on by default when Windows lists an AMD display adapter, `screens.py`
|
||||
`windows_adapter_names`; or `--fsr`; Windows): download
|
||||
`amd_fidelityfx_loader_vk.dll` and `amd_fidelityfx_upscaler_vk.dll` from AMD's FSR SDK repository
|
||||
(github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK, tag `v2.4.0`, `Kits/FidelityFX/signedbin/`, AMD FSR SDK
|
||||
license) into the install folder and check their sizes and SHA-256 (`steps.py`, `Fsr`). Both go in only when both
|
||||
downloaded and matched. `scene_upscaler = fsr4` loads them from the folder of totk.exe and runs FSR 4 where they
|
||||
offer it for the GPU. Libraries already in the folder are kept; a failed download warns, the game runs without FSR
|
||||
4, and the next run tries again.
|
||||
11. **Clean up** the temp folder, except the generated C and the objects (about 1.3 GB), and write
|
||||
`build-cache/rebuild.txt` in the install folder.
|
||||
|
||||
A cancelled or failed setup resumes from the last finished step (`totk-install.json`).
|
||||
|
||||
@@ -196,6 +196,7 @@ Many rows below are developer tools that only act together with another setting
|
||||
| `dlss_reactive` (default `0`) | `1` builds a reactive mask for DLSS where it ran. | Changes how DLSS blends moving areas; a test setting. | Caution |
|
||||
| `fsr3_debug` (default `0`) | With `scene_upscaler = fsr3`: `1` creates the FSR 3.1 context with the SDK's input checks, whose warnings go to the log (the first 32). | Adds checks to every FSR 3.1 dispatch and log lines. | Caution |
|
||||
| `fsr3_view` (default `0`) | With `scene_upscaler = fsr3`: `1` shows FSR 3.1's own debug view of its inputs and state in place of the picture. | The frame shows a debug image while it is set. | Caution |
|
||||
| `fsr4_debug` (default `0`) | With `scene_upscaler = fsr4`: `1` creates the FSR 4 context with the AMD libraries' input checks, whose findings go to the log. | Adds checks to every FSR 4 dispatch and log lines. | Caution |
|
||||
| `mv_check` | Frame interval; every that many DLSS frames copies the light target and motion images to host memory and logs how well the vectors explain the picture. | Costs a GPU-to-host copy and a comparison on the completion thread at each interval. | Caution |
|
||||
| `mv_survey` (default `0`) | `1` notes the uniform blocks of each scene draw and compares them with those of earlier frames. | Adds per-draw work and log output. | Caution |
|
||||
| `mvobj_all` (default `0`) | `1` also lists draws for object motion that read no object blocks (terrain and grass). | More draws are checked and listed, which costs time. | Caution |
|
||||
|
||||
+6
-2
@@ -1,5 +1,5 @@
|
||||
"""Command line: python -m installer --base FILE --update FILE --keys FILE --lang CODE --dest DIR [--firmware DIR]
|
||||
[--root DIR] [--temp DIR] [--verify] [--dlss]
|
||||
[--root DIR] [--temp DIR] [--verify] [--dlss] [--fsr]
|
||||
|
||||
A first install needs every option. --firmware names the Switch firmware folder (an unpacked firmware or an emulator's
|
||||
Contents/registered); the setup extracts the system shared fonts from it when the language is Chinese, Korean or
|
||||
@@ -9,7 +9,9 @@ extraction has to run again. Prints JSON events on stdout (events.py). Exit code
|
||||
line, 3 cancelled (Ctrl+C or Ctrl+Break).
|
||||
|
||||
--dlss downloads NVIDIA's DLSS library (nvngx_dlss.dll) from NVIDIA's DLSS SDK repository into the install folder on
|
||||
Windows with an NVIDIA RTX GPU (steps.py, Dlss).
|
||||
Windows with an NVIDIA RTX GPU (steps.py, Dlss). --fsr downloads AMD's FSR loader and upscaler
|
||||
(amd_fidelityfx_loader_vk.dll, amd_fidelityfx_upscaler_vk.dll) from AMD's FSR SDK repository into the install folder on
|
||||
Windows, for scene_upscaler = fsr4; the libraries decide which GPUs get FSR 4 (steps.py, Fsr).
|
||||
"""
|
||||
import argparse
|
||||
import signal
|
||||
@@ -51,6 +53,8 @@ def main(argv=None):
|
||||
ap.add_argument('--verify', action='store_true', help='hash every kept file, also those this release made')
|
||||
ap.add_argument('--dlss', action='store_true', help="download NVIDIA's nvngx_dlss.dll (NVIDIA RTX SDK license) next "
|
||||
'to the game, for dlaa and the DLSS modes')
|
||||
ap.add_argument('--fsr', action='store_true', help="download AMD's FSR loader and upscaler DLLs (AMD FSR SDK "
|
||||
'license) next to the game, for scene_upscaler = fsr4')
|
||||
args = ap.parse_args(argv)
|
||||
|
||||
# The window cancels with Ctrl+Break to the installer's process group (CREATE_NEW_PROCESS_GROUP), which also reaches
|
||||
|
||||
+13
-4
@@ -38,8 +38,10 @@ except ImportError:
|
||||
from . import ini
|
||||
from . import layout as layouts
|
||||
from . import recent
|
||||
from . import screens
|
||||
from .guilogic import (DONE, FAILED, PENDING, RUNNING, SKIPPED, UI_LANGUAGE_LABELS, UI_LANGUAGES, Catalog, Form, Model,
|
||||
Process, amount, default_game_language, describe_event, parse_line, windows_ui_language)
|
||||
Process, amount, default_game_language, describe_event, fsr_default, parse_line,
|
||||
windows_ui_language)
|
||||
|
||||
POLL_MS = 100
|
||||
GLYPH = {PENDING: '\u25cb', RUNNING: '\u25b6', DONE: '\u2714', SKIPPED: '\u2013', FAILED: '\u2716'}
|
||||
@@ -437,6 +439,12 @@ class App:
|
||||
dlss = ttk.Checkbutton(content, variable=self.dlss_var)
|
||||
self.bind_text(dlss, 'text', 'ui.dlss')
|
||||
dlss.pack(anchor='w', pady=(dpi.px(12), 0))
|
||||
# Ticked by default with an AMD display adapter only (guilogic.fsr_default); the player can tick it on any GPU.
|
||||
# Its source and licence line follows DLSS's under More details.
|
||||
self.fsr_var = tk.BooleanVar(value=fsr_default(screens.windows_adapter_names()))
|
||||
fsr = ttk.Checkbutton(content, variable=self.fsr_var)
|
||||
self.bind_text(fsr, 'text', 'ui.fsr')
|
||||
fsr.pack(anchor='w', pady=(dpi.px(4), 0))
|
||||
# The explanations stay out of the way until asked for: a link opens them under it
|
||||
self.details_toggle = ttk.Label(content, style='Link.TLabel', cursor='hand2', takefocus=True)
|
||||
self.bind_text(self.details_toggle, 'text', 'ui.more_details')
|
||||
@@ -445,7 +453,8 @@ class App:
|
||||
self.details_toggle.pack(anchor='w', pady=(dpi.px(8), 0))
|
||||
self.details = ttk.Frame(content) # packed after the link when open; no holder frame, as an emptied Tk frame keeps
|
||||
# the height its last child gave it
|
||||
for id in ('ui.dlss_help', 'ui.formats_help', 'ui.compressed_help', 'ui.firmware_help', 'ui.keys_private'):
|
||||
for id in ('ui.dlss_help', 'ui.fsr_help', 'ui.formats_help', 'ui.compressed_help', 'ui.firmware_help',
|
||||
'ui.keys_private'):
|
||||
self.label(self.details, id, style='Muted.TLabel', wraplength=WRAP - dpi.px(16),
|
||||
justify='left').pack(anchor='w', pady=(dpi.px(6), 0))
|
||||
self.details_open = False
|
||||
@@ -527,7 +536,7 @@ class App:
|
||||
def form(self):
|
||||
return Form(base=self.vars['base'].get(), update=self.vars['update'].get(), keys=self.vars['keys'].get(),
|
||||
firmware=self.vars['firmware'].get(), lang=self.selected_lang(), dest=self.vars['dest'].get(),
|
||||
dlss=self.dlss_var.get())
|
||||
dlss=self.dlss_var.get(), fsr=self.fsr_var.get())
|
||||
|
||||
def set_prefill(self, name, value):
|
||||
self.programmatic = True
|
||||
@@ -803,7 +812,7 @@ class App:
|
||||
# ---- self test ---------------------------------------------------------------------------------------------------
|
||||
|
||||
SAMPLE_START = {'type': 'start', 'release': 'selftest', 'mode': 'install', 'dest': 'Z:/selftest/TotK', 'log': 'D:\\log.txt',
|
||||
'steps': ['check', 'fonts', 'extract', 'lift', 'compile', 'prepare', 'pc_prompts', 'shapes', 'dlss', 'cleanup']}
|
||||
'steps': ['check', 'fonts', 'extract', 'lift', 'compile', 'prepare', 'pc_prompts', 'shapes', 'dlss', 'fsr', 'cleanup']}
|
||||
SAMPLE_RUN = [
|
||||
SAMPLE_START,
|
||||
{'type': 'plan', 'run': ['check', 'fonts', 'extract'], 'skip': {}},
|
||||
|
||||
+12
-1
@@ -30,7 +30,7 @@ UI_LANGUAGE_LABELS = {'en': 'English', 'ru': 'Русский', 'pt-BR': 'Portugu
|
||||
'de': 'Deutsch', 'fr': 'Français', 'es': 'Español', 'it': 'Italiano', 'nl': 'Nederlands',
|
||||
'ja': '日本語', 'ko': '한국어'}
|
||||
STEP_ORDER = ('check', 'kit', 'fonts', 'extract', 'lift', 'compile', 'prepare', 'pc_prompts', 'shapes', 'dlss',
|
||||
'cleanup')
|
||||
'fsr', 'cleanup')
|
||||
# message parameter -> catalog id prefix of the names that replace its raw values
|
||||
PARAM_NAMES = {'lang': 'lang.', 'known': 'lang.', 'step': 'step.', 'input': 'param.input.'}
|
||||
LANG_PT_BR = 0x0416 # Portuguese (Brazil), the whole LANGID: Portugal's Portuguese stays English
|
||||
@@ -142,6 +142,14 @@ def amount(cat, done, total, unit):
|
||||
|
||||
# ---- the form ----------------------------------------------------------------------------------------------------
|
||||
|
||||
def fsr_default(adapters):
|
||||
"""Whether the window ticks Download AMD FSR at start: only with an AMD display adapter among adapters (their
|
||||
names, screens.windows_adapter_names). The step downloads on any GPU when ticked (steps.Fsr); on other GPUs, and
|
||||
when no adapter could be listed, the box starts unticked, so a player without an AMD GPU never downloads AMD's
|
||||
libraries (about 36 MB) without choosing to."""
|
||||
return any('AMD' in a.upper() or 'RADEON' in a.upper() for a in adapters)
|
||||
|
||||
|
||||
@dataclass
|
||||
class Form:
|
||||
base: str = ''
|
||||
@@ -151,6 +159,7 @@ class Form:
|
||||
lang: str = ''
|
||||
dest: str = ''
|
||||
dlss: bool = False
|
||||
fsr: bool = False
|
||||
|
||||
def installed_state(self):
|
||||
"""The recorded state of the install folder (totk-install.json), or None. Never raises."""
|
||||
@@ -203,6 +212,8 @@ class Form:
|
||||
cmd.append('--verify')
|
||||
if self.dlss:
|
||||
cmd.append('--dlss')
|
||||
if self.fsr:
|
||||
cmd.append('--fsr')
|
||||
return cmd
|
||||
|
||||
|
||||
|
||||
@@ -94,6 +94,28 @@ def windows_displays():
|
||||
return out
|
||||
|
||||
|
||||
def windows_adapter_names():
|
||||
"""The names of the display adapters Windows lists (EnumDisplayDevicesW, "AMD Radeon RX 9060 XT"), without
|
||||
starting Vulkan; [] elsewhere or when the call fails. The setup window decides its defaults by them before the host
|
||||
check has run."""
|
||||
if os.name != 'nt':
|
||||
return []
|
||||
try:
|
||||
user32 = ctypes.WinDLL('user32')
|
||||
out, i = [], 0
|
||||
while i < 64:
|
||||
dev = DISPLAY_DEVICEW()
|
||||
dev.cb = ctypes.sizeof(dev)
|
||||
if not user32.EnumDisplayDevicesW(None, i, ctypes.byref(dev), 0):
|
||||
break
|
||||
i += 1
|
||||
if dev.DeviceString and dev.DeviceString not in out:
|
||||
out.append(dev.DeviceString)
|
||||
return out
|
||||
except (OSError, AttributeError, ValueError):
|
||||
return []
|
||||
|
||||
|
||||
XRANDR = re.compile(r'\sconnected\s+(?:primary\s+)?(\d+)x(\d+)\+')
|
||||
|
||||
|
||||
|
||||
+87
-5
@@ -1,5 +1,5 @@
|
||||
"""The eleven setup steps of docs/installer.md: check, kit, fonts, extract, lift, compile, prepare, pc_prompts, shapes,
|
||||
dlss, cleanup.
|
||||
"""The twelve setup steps of docs/installer.md: check, kit, fonts, extract, lift, compile, prepare, pc_prompts,
|
||||
shapes, dlss, fsr, cleanup.
|
||||
|
||||
Extraction runs in this process through tools/extract.py (the package's sibling tools/, which ships with it); fonts
|
||||
runs the vendored extract_shared_fonts.py on the firmware folder; lift, compile and prepare run the bundled Python on
|
||||
@@ -8,7 +8,8 @@ recomp/gen.py, tools/build_game.py, tools/make_romfs_patches.py and tools/prepar
|
||||
with the bundled clang (hostcheck.c).
|
||||
|
||||
Install folder: exefs/, romfs/ (romfs.bin, index.json), profile/, shared-fonts/ (Chinese and Korean text), totk.exe
|
||||
and its DLLs, nvngx_dlss.dll (with --dlss), romfs-index.bin, romfs-patches/, romfs-patches-xbox/,
|
||||
and its DLLs, nvngx_dlss.dll (with --dlss), amd_fidelityfx_loader_vk.dll and amd_fidelityfx_upscaler_vk.dll (with
|
||||
--fsr), romfs-index.bin, romfs-patches/, romfs-patches-xbox/,
|
||||
romfs-patches-xbox-label/, romfs-patches-pc/, romfs-patches-<w>x<h>/ and romfs-patches-<style>-<w>x<h>/ (for the
|
||||
screen shapes and the prompts style this player needs, installer/screens.py), totk_xlate.exe, the
|
||||
shader state of totk.exe --prepare-shaders, totk.ini, totk-install.json, and on Windows build-kit/ (Kit): the release
|
||||
@@ -1761,7 +1762,87 @@ class Dlss(Step):
|
||||
return {'installed': DLSS_VERSION}
|
||||
|
||||
|
||||
# ---- 8. clean up
|
||||
# ---- 8. AMD FSR
|
||||
|
||||
# AMD's FSR 4 for scene_upscaler = fsr4 (runtime/vk_ffx.c): the ffx-api loader and the upscaler effect, which the
|
||||
# loader finds next to itself. AMD's FSR SDK license lets them be redistributed in binary form with its notice
|
||||
# (THIRD_PARTY_NOTICES.md); the setup still does not ship them: with --fsr it downloads AMD's signed copies from the SDK
|
||||
# repository at a pinned tag and checks their hashes. The game runs without them; scene_upscaler = fsr4 then does
|
||||
# nothing.
|
||||
FSR_VERSION = '2.4.0' # the FSR SDK release; the upscaler DLL is FSR 4.1.2 (FSR 3.1.6 inside goes unused)
|
||||
FSR_BASE = (f'https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK/v{FSR_VERSION}/'
|
||||
'Kits/FidelityFX/signedbin/')
|
||||
FSR_FILES = ( # name, size, SHA-256
|
||||
('amd_fidelityfx_loader_vk.dll', 39184, '38a56a01fb3565c0757d9f5c1e4e69de4b65e5f2e5769b323b200dc1f142bab9'),
|
||||
('amd_fidelityfx_upscaler_vk.dll', 36135696, '4a7e895af6e0b615d40a84d59eb8c2b1054ad91cdd0c739567940270d51bdab7'),
|
||||
)
|
||||
FSR_LICENSE = f'https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK/blob/v{FSR_VERSION}/docs/license.md'
|
||||
|
||||
|
||||
class Fsr(Step):
|
||||
"""With --fsr on Windows: AMD's FSR loader and upscaler next to totk.exe; the game pins FSR 4 where they offer it
|
||||
for the GPU. Libraries the player put there (other versions) are kept. A failed download warns and is tried again
|
||||
on the next run; the game runs without them."""
|
||||
|
||||
id = 'fsr'
|
||||
|
||||
def key(self, ctx):
|
||||
if not getattr(ctx.options, 'fsr', False):
|
||||
return fingerprint('fsr-2', 'off')
|
||||
return fingerprint('fsr-2', FSR_VERSION, *(sha for _, _, sha in FSR_FILES))
|
||||
|
||||
def current(self, ctx, record):
|
||||
if record.get('failed'):
|
||||
return False
|
||||
return not record.get('installed') or all((ctx.dest / name).is_file() for name, _, _ in FSR_FILES)
|
||||
|
||||
def run(self, ctx):
|
||||
if not getattr(ctx.options, 'fsr', False):
|
||||
return {}
|
||||
if os.name != 'nt':
|
||||
return {'skipped': 'not_windows'}
|
||||
rep = ctx.reporter
|
||||
present = [ctx.dest / name for name, _, _ in FSR_FILES if (ctx.dest / name).is_file()]
|
||||
if present:
|
||||
if all((ctx.dest / name).is_file() and file_sha256(ctx.dest / name) == sha for name, _, sha in FSR_FILES):
|
||||
return {'installed': FSR_VERSION}
|
||||
# A set the player put there (or half of one): kept as it is, the loader and its effect belong together
|
||||
rep.warning('warn.fsr_kept', path=str(present[0]))
|
||||
return {'kept': True}
|
||||
total, done = sum(size for _, size, _ in FSR_FILES), 0
|
||||
rep.progress('fsr', 'download', 0, total, 'bytes', force=True)
|
||||
rep.log(f'fsr: {FSR_BASE} (license {FSR_LICENSE})')
|
||||
parts = []
|
||||
try:
|
||||
for name, size, sha in FSR_FILES:
|
||||
url, part = FSR_BASE + name, ctx.temp / (name + '.part')
|
||||
parts.append(part)
|
||||
part.parent.mkdir(parents=True, exist_ok=True)
|
||||
h, got = hashlib.sha256(), 0
|
||||
with urllib.request.urlopen(url, timeout=60) as r, open(part, 'wb') as f:
|
||||
while block := r.read(1 << 20):
|
||||
f.write(block)
|
||||
h.update(block)
|
||||
got += len(block)
|
||||
rep.progress('fsr', 'download', min(done + got, total), total, 'bytes')
|
||||
if got != size or h.hexdigest() != sha:
|
||||
raise OSError(f'{name}: {got} bytes, SHA-256 {h.hexdigest()[:16]}, not the expected file')
|
||||
done += size
|
||||
# both downloaded and checked: only then into the install folder, so it never holds half a set
|
||||
for (name, _, _), part in zip(FSR_FILES, parts):
|
||||
replace_file(part, ctx.dest / name)
|
||||
remove(part)
|
||||
# urllib's errors, timeouts and a bad file; a connection cut mid-file raises http.client.IncompleteRead,
|
||||
# which is not an OSError
|
||||
except (OSError, http.client.HTTPException) as e:
|
||||
for part in parts:
|
||||
remove(part)
|
||||
rep.warning('warn.fsr_download_failed', url=FSR_BASE, detail=str(e)[:300])
|
||||
return {'failed': True}
|
||||
return {'installed': FSR_VERSION}
|
||||
|
||||
|
||||
# ---- 9. clean up
|
||||
|
||||
class Cleanup(Step):
|
||||
id = 'cleanup'
|
||||
@@ -1843,4 +1924,5 @@ def romfs_problem(romfs, expected):
|
||||
|
||||
|
||||
def all_steps():
|
||||
return [Check(), Kit(), Fonts(), Extract(), Lift(), Compile(), Prepare(), PcPrompts(), Shapes(), Dlss(), Cleanup()]
|
||||
return [Check(), Kit(), Fonts(), Extract(), Lift(), Compile(), Prepare(), PcPrompts(), Shapes(), Dlss(), Fsr(),
|
||||
Cleanup()]
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "Tastatur- und Maussymbole zeichnen",
|
||||
"step.shapes": "Spielbildschirme für deine Monitore anordnen",
|
||||
"step.dlss": "NVIDIA DLSS herunterladen",
|
||||
"step.fsr": "AMD FSR 4 herunterladen",
|
||||
"step.cleanup": "Aufräumen",
|
||||
"phase.check.host": "Prozessor und Grafikkarte prüfen",
|
||||
"phase.check.verify": "Bereits installierte Dateien prüfen",
|
||||
@@ -39,6 +40,7 @@
|
||||
"phase.prepare.pack": "Shader-Cache in eine Datei packen",
|
||||
"phase.shapes.layouts": "Bildschirmlayouts und Tastensymbole für jedes Bildschirmformat schreiben",
|
||||
"phase.dlss.download": "nvngx_dlss.dll aus NVIDIAs DLSS SDK herunterladen",
|
||||
"phase.fsr.download": "Die FSR-4-Bibliotheken aus AMDs FSR SDK herunterladen",
|
||||
"phase.cleanup.ini": "totk.ini schreiben",
|
||||
"phase.cleanup.temp": "Temporäre Dateien entfernen",
|
||||
"cli.usage": "Ungültige Befehlszeile: {detail}",
|
||||
@@ -117,6 +119,8 @@
|
||||
"warn.kernel_old": "Linux {version} fehlt das Schreib-Tracking, auf das das Spiel angewiesen ist (6.7 oder neuer); das Spiel kann sehr langsam laufen. Ein Systemupdate behebt das.",
|
||||
"warn.dlss_kept": "Im Installationsordner liegt bereits eine DLSS-Bibliothek ({path}); das Setup behält sie.",
|
||||
"warn.dlss_download_failed": "NVIDIA DLSS konnte nicht von {url} heruntergeladen werden: {detail}. Das Spiel läuft ohne; der nächste Setup-Lauf versucht es erneut.",
|
||||
"warn.fsr_kept": "Im Installationsordner liegt bereits eine FSR-Bibliothek ({path}); das Setup behält die Bibliotheken dort.",
|
||||
"warn.fsr_download_failed": "AMD FSR 4 konnte nicht von {url} heruntergeladen werden: {detail}. Das Spiel läuft ohne; der nächste Setup-Lauf versucht es erneut.",
|
||||
"ui.title": "TotK-Setup",
|
||||
"ui.rebuild_title": "Spiel für deine Mods neu bauen",
|
||||
"ui.start_game": "Spiel starten",
|
||||
@@ -139,6 +143,8 @@
|
||||
"ui.firmware_help": "Für chinesischen, koreanischen und traditionell chinesischen Text: der Ordner Contents/registered der Firmware, zum Beispiel aus Ryujinx oder Yuzu. Das Setup kopiert daraus die Systemschriften der Switch in den Installationsordner.",
|
||||
"ui.dlss": "NVIDIA DLSS (nvngx_dlss.dll) für NVIDIA-RTX-Grafikkarten herunterladen",
|
||||
"ui.dlss_help": "Aus NVIDIAs DLSS SDK auf GitHub, unter NVIDIAs RTX-SDK-Lizenz (github.com/NVIDIA/DLSS). Damit funktionieren die Einstellungen dlaa und DLSS; ohne die Datei bewirken sie nichts.",
|
||||
"ui.fsr": "AMD FSR 4 (AMDs FSR-SDK-Bibliotheken) für AMD-Radeon-Grafikkarten herunterladen",
|
||||
"ui.fsr_help": "Aus AMDs FSR SDK auf GitHub, unter AMDs FSR-SDK-Lizenz (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). Damit funktioniert die Wahl AMD FSR 4 beim 3D-Szenen-Upscaler auf den Radeon-Karten, für die AMDs Bibliotheken FSR 4 anbieten; ohne sie bewirkt diese Wahl nichts. Beim Start angehakt, wenn der Computer eine AMD-Grafikkarte hat.",
|
||||
"ui.compressed_help": "Komprimierte NSZ- und XCZ-Dateien funktionieren direkt: Das Setup entpackt sie selbst (bis die Spieldaten extrahiert sind, braucht das so viel freien Speicher, wie die entpackten Dateien belegen).",
|
||||
"ui.section_files": "Spieldateien",
|
||||
"ui.section_install": "Installation",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "Drawing the keyboard and mouse prompts",
|
||||
"step.shapes": "Laying out the game screens for your displays",
|
||||
"step.dlss": "Downloading NVIDIA DLSS",
|
||||
"step.fsr": "Downloading AMD FSR 4",
|
||||
"step.cleanup": "Cleaning up",
|
||||
|
||||
"phase.check.host": "Checking the processor and the graphics card",
|
||||
@@ -40,6 +41,7 @@
|
||||
"phase.prepare.pack": "Packing the shader cache into one file",
|
||||
"phase.shapes.layouts": "Writing the screen layouts and button prompts for each display shape",
|
||||
"phase.dlss.download": "Downloading nvngx_dlss.dll from NVIDIA's DLSS SDK",
|
||||
"phase.fsr.download": "Downloading the FSR 4 libraries from AMD's FSR SDK",
|
||||
"phase.cleanup.ini": "Writing totk.ini",
|
||||
"phase.cleanup.temp": "Removing temporary files",
|
||||
|
||||
@@ -122,6 +124,8 @@
|
||||
"warn.kernel_old": "Linux {version} lacks the write tracking the game relies on (6.7 or later); the game may run very slowly. Updating the system fixes this.",
|
||||
"warn.dlss_kept": "A DLSS library is already in the install folder ({path}); the setup keeps it.",
|
||||
"warn.dlss_download_failed": "NVIDIA DLSS could not be downloaded from {url}: {detail}. The game runs without it; the next setup run tries again.",
|
||||
"warn.fsr_kept": "An FSR library is already in the install folder ({path}); the setup keeps the libraries there.",
|
||||
"warn.fsr_download_failed": "AMD FSR 4 could not be downloaded from {url}: {detail}. The game runs without it; the next setup run tries again.",
|
||||
|
||||
"ui.title": "TotK Setup",
|
||||
"ui.rebuild_title": "Rebuilding the game for your mods",
|
||||
@@ -145,6 +149,8 @@
|
||||
"ui.firmware_help": "For Chinese, Korean and Traditional Chinese text: the firmware's Contents/registered folder, for example from Ryujinx or Yuzu. The setup copies the Switch system fonts from it into the install folder.",
|
||||
"ui.dlss": "Download NVIDIA DLSS (nvngx_dlss.dll) for NVIDIA RTX graphics cards",
|
||||
"ui.dlss_help": "From NVIDIA's DLSS SDK on GitHub, under NVIDIA's RTX SDK license (github.com/NVIDIA/DLSS). It makes the dlaa and DLSS settings work; without it they do nothing.",
|
||||
"ui.fsr": "Download AMD FSR 4 (AMD's FSR SDK libraries) for AMD Radeon graphics cards",
|
||||
"ui.fsr_help": "From AMD's FSR SDK on GitHub, under AMD's FSR SDK license (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). It makes the AMD FSR 4 choice of the 3D scene upscaler work on the Radeon cards AMD's libraries offer FSR 4 for; without it that choice does nothing. Ticked at start when the computer has an AMD graphics card.",
|
||||
"ui.compressed_help": "Compressed NSZ and XCZ files work as they are: the setup unpacks them by itself (until the game data is extracted, that needs as much free space as the unpacked files take).",
|
||||
"ui.section_files": "Game files",
|
||||
"ui.section_install": "Install",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "Dibujando los iconos de teclado y ratón",
|
||||
"step.shapes": "Ajustando las pantallas del juego a tus monitores",
|
||||
"step.dlss": "Descargando NVIDIA DLSS",
|
||||
"step.fsr": "Descargando AMD FSR 4",
|
||||
"step.cleanup": "Limpiando",
|
||||
"phase.check.host": "Comprobando el procesador y la tarjeta gráfica",
|
||||
"phase.check.verify": "Comprobando los archivos ya instalados",
|
||||
@@ -39,6 +40,7 @@
|
||||
"phase.prepare.pack": "Empaquetando la caché de shaders en un archivo",
|
||||
"phase.shapes.layouts": "Escribiendo las disposiciones de pantalla y los iconos de botones para cada formato de pantalla",
|
||||
"phase.dlss.download": "Descargando nvngx_dlss.dll del DLSS SDK de NVIDIA",
|
||||
"phase.fsr.download": "Descargando las bibliotecas de FSR 4 del FSR SDK de AMD",
|
||||
"phase.cleanup.ini": "Escribiendo totk.ini",
|
||||
"phase.cleanup.temp": "Eliminando los archivos temporales",
|
||||
"cli.usage": "Línea de comandos no válida: {detail}",
|
||||
@@ -117,6 +119,8 @@
|
||||
"warn.kernel_old": "Linux {version} no tiene el seguimiento de escrituras del que depende el juego (6.7 o posterior); el juego puede ir muy lento. Actualizar el sistema lo soluciona.",
|
||||
"warn.dlss_kept": "Ya hay una biblioteca DLSS en la carpeta de instalación ({path}); el instalador la conserva.",
|
||||
"warn.dlss_download_failed": "No se pudo descargar NVIDIA DLSS desde {url}: {detail}. El juego funciona sin él; la próxima ejecución del instalador lo intentará de nuevo.",
|
||||
"warn.fsr_kept": "Ya hay una biblioteca FSR en la carpeta de instalación ({path}); el instalador conserva las bibliotecas que hay.",
|
||||
"warn.fsr_download_failed": "No se pudo descargar AMD FSR 4 desde {url}: {detail}. El juego funciona sin él; la próxima ejecución del instalador lo intentará de nuevo.",
|
||||
"ui.title": "Instalador de TotK",
|
||||
"ui.rebuild_title": "Reconstruyendo el juego para tus mods",
|
||||
"ui.start_game": "Iniciar el juego",
|
||||
@@ -139,6 +143,8 @@
|
||||
"ui.firmware_help": "Para texto en chino, coreano y chino tradicional: la carpeta Contents/registered del firmware, por ejemplo de Ryujinx o Yuzu. El instalador copia de ella las fuentes del sistema de Switch a la carpeta de instalación.",
|
||||
"ui.dlss": "Descargar NVIDIA DLSS (nvngx_dlss.dll) para tarjetas gráficas NVIDIA RTX",
|
||||
"ui.dlss_help": "Del DLSS SDK de NVIDIA en GitHub, bajo la licencia RTX SDK de NVIDIA (github.com/NVIDIA/DLSS). Hace que funcionen los ajustes dlaa y DLSS; sin él no hacen nada.",
|
||||
"ui.fsr": "Descargar AMD FSR 4 (bibliotecas del FSR SDK de AMD) para tarjetas gráficas AMD Radeon",
|
||||
"ui.fsr_help": "Del FSR SDK de AMD en GitHub, bajo la licencia FSR SDK de AMD (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). Hace que funcione la opción AMD FSR 4 del escalador de la escena 3D en las tarjetas Radeon para las que las bibliotecas de AMD ofrecen FSR 4; sin ellas esa opción no hace nada. Viene marcada si el equipo tiene una tarjeta gráfica AMD.",
|
||||
"ui.compressed_help": "Los archivos comprimidos NSZ y XCZ funcionan tal cual: el instalador los descomprime por sí mismo (hasta que se extraen los datos del juego, necesita tanto espacio libre como ocupan los archivos descomprimidos).",
|
||||
"ui.section_files": "Archivos del juego",
|
||||
"ui.section_install": "Instalación",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "Dessin des icônes du clavier et de la souris",
|
||||
"step.shapes": "Mise en page des écrans du jeu pour vos moniteurs",
|
||||
"step.dlss": "Téléchargement de NVIDIA DLSS",
|
||||
"step.fsr": "Téléchargement d'AMD FSR 4",
|
||||
"step.cleanup": "Nettoyage",
|
||||
"phase.check.host": "Vérification du processeur et de la carte graphique",
|
||||
"phase.check.verify": "Vérification des fichiers déjà installés",
|
||||
@@ -39,6 +40,7 @@
|
||||
"phase.prepare.pack": "Regroupement du cache de shaders en un fichier",
|
||||
"phase.shapes.layouts": "Écriture des mises en page et des icônes de boutons pour chaque format d’écran",
|
||||
"phase.dlss.download": "Téléchargement de nvngx_dlss.dll depuis le DLSS SDK de NVIDIA",
|
||||
"phase.fsr.download": "Téléchargement des bibliothèques FSR 4 depuis le FSR SDK d'AMD",
|
||||
"phase.cleanup.ini": "Écriture de totk.ini",
|
||||
"phase.cleanup.temp": "Suppression des fichiers temporaires",
|
||||
"cli.usage": "Ligne de commande invalide : {detail}",
|
||||
@@ -117,6 +119,8 @@
|
||||
"warn.kernel_old": "Linux {version} ne dispose pas du suivi des écritures dont le jeu dépend (6.7 ou plus récent) ; le jeu peut être très lent. Mettre à jour le système corrige cela.",
|
||||
"warn.dlss_kept": "Une bibliothèque DLSS se trouve déjà dans le dossier d'installation ({path}) ; l'installation la conserve.",
|
||||
"warn.dlss_download_failed": "NVIDIA DLSS n'a pas pu être téléchargé depuis {url} : {detail}. Le jeu fonctionne sans ; la prochaine installation réessaiera.",
|
||||
"warn.fsr_kept": "Une bibliothèque FSR se trouve déjà dans le dossier d'installation ({path}) ; l'installation conserve les bibliothèques présentes.",
|
||||
"warn.fsr_download_failed": "AMD FSR 4 n'a pas pu être téléchargé depuis {url} : {detail}. Le jeu fonctionne sans ; la prochaine installation réessaiera.",
|
||||
"ui.title": "Installation de TotK",
|
||||
"ui.rebuild_title": "Reconstruction du jeu pour vos mods",
|
||||
"ui.start_game": "Lancer le jeu",
|
||||
@@ -139,6 +143,8 @@
|
||||
"ui.firmware_help": "Pour le texte en chinois, en coréen et en chinois traditionnel : le dossier Contents/registered du firmware, par exemple celui de Ryujinx ou de Yuzu. L'installation en copie les polices système de la Switch dans le dossier d'installation.",
|
||||
"ui.dlss": "Télécharger NVIDIA DLSS (nvngx_dlss.dll) pour les cartes graphiques NVIDIA RTX",
|
||||
"ui.dlss_help": "Depuis le DLSS SDK de NVIDIA sur GitHub, sous la licence RTX SDK de NVIDIA (github.com/NVIDIA/DLSS). Il fait fonctionner les réglages dlaa et DLSS ; sans lui, ils n'ont aucun effet.",
|
||||
"ui.fsr": "Télécharger AMD FSR 4 (bibliothèques du FSR SDK d'AMD) pour les cartes graphiques AMD Radeon",
|
||||
"ui.fsr_help": "Depuis le FSR SDK d'AMD sur GitHub, sous la licence FSR SDK d'AMD (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). Il fait fonctionner le choix AMD FSR 4 de l'upscaler de la scène 3D sur les cartes Radeon pour lesquelles les bibliothèques d'AMD proposent FSR 4 ; sans elles, ce choix n'a aucun effet. Coché au départ quand l'ordinateur a une carte graphique AMD.",
|
||||
"ui.compressed_help": "Les fichiers compressés NSZ et XCZ fonctionnent tels quels : l'installation les décompresse elle-même (jusqu'à l'extraction des données du jeu, il faut autant d'espace libre que les fichiers décompressés).",
|
||||
"ui.section_files": "Fichiers du jeu",
|
||||
"ui.section_install": "Installation",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "Disegno delle icone di tastiera e mouse",
|
||||
"step.shapes": "Impaginazione delle schermate del gioco per i tuoi monitor",
|
||||
"step.dlss": "Download di NVIDIA DLSS",
|
||||
"step.fsr": "Download di AMD FSR 4",
|
||||
"step.cleanup": "Pulizia",
|
||||
"phase.check.host": "Controllo del processore e della scheda grafica",
|
||||
"phase.check.verify": "Controllo dei file già installati",
|
||||
@@ -39,6 +40,7 @@
|
||||
"phase.prepare.pack": "Raccolta della cache degli shader in un file",
|
||||
"phase.shapes.layouts": "Scrittura dei layout dello schermo e delle icone dei pulsanti per ogni formato di schermo",
|
||||
"phase.dlss.download": "Download di nvngx_dlss.dll dal DLSS SDK di NVIDIA",
|
||||
"phase.fsr.download": "Download delle librerie FSR 4 dal FSR SDK di AMD",
|
||||
"phase.cleanup.ini": "Scrittura di totk.ini",
|
||||
"phase.cleanup.temp": "Rimozione dei file temporanei",
|
||||
"cli.usage": "Riga di comando non valida: {detail}",
|
||||
@@ -117,6 +119,8 @@
|
||||
"warn.kernel_old": "Linux {version} non ha il tracciamento delle scritture su cui si basa il gioco (6.7 o successivo); il gioco potrebbe essere molto lento. Aggiornare il sistema risolve il problema.",
|
||||
"warn.dlss_kept": "Nella cartella di installazione c'è già una libreria DLSS ({path}); l'installazione la mantiene.",
|
||||
"warn.dlss_download_failed": "Impossibile scaricare NVIDIA DLSS da {url}: {detail}. Il gioco funziona senza; la prossima esecuzione dell'installazione riproverà.",
|
||||
"warn.fsr_kept": "Nella cartella di installazione c'è già una libreria FSR ({path}); l'installazione mantiene le librerie presenti.",
|
||||
"warn.fsr_download_failed": "Impossibile scaricare AMD FSR 4 da {url}: {detail}. Il gioco funziona senza; la prossima esecuzione dell'installazione riproverà.",
|
||||
"ui.title": "Installazione di TotK",
|
||||
"ui.rebuild_title": "Ricostruzione del gioco per le tue mod",
|
||||
"ui.start_game": "Avvia il gioco",
|
||||
@@ -139,6 +143,8 @@
|
||||
"ui.firmware_help": "Per il testo in cinese, coreano e cinese tradizionale: la cartella Contents/registered del firmware, ad esempio da Ryujinx o Yuzu. L'installazione ne copia i font di sistema di Switch nella cartella di installazione.",
|
||||
"ui.dlss": "Scarica NVIDIA DLSS (nvngx_dlss.dll) per le schede grafiche NVIDIA RTX",
|
||||
"ui.dlss_help": "Dal DLSS SDK di NVIDIA su GitHub, con la licenza RTX SDK di NVIDIA (github.com/NVIDIA/DLSS). Fa funzionare le impostazioni dlaa e DLSS; senza, non hanno effetto.",
|
||||
"ui.fsr": "Scarica AMD FSR 4 (librerie del FSR SDK di AMD) per le schede grafiche AMD Radeon",
|
||||
"ui.fsr_help": "Dal FSR SDK di AMD su GitHub, con la licenza FSR SDK di AMD (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). Fa funzionare la scelta AMD FSR 4 dell'upscaler della scena 3D sulle schede Radeon per cui le librerie di AMD offrono FSR 4; senza, quella scelta non ha effetto. Selezionata all'avvio se il computer ha una scheda grafica AMD.",
|
||||
"ui.compressed_help": "I file compressi NSZ e XCZ funzionano così come sono: l'installazione li decomprime da sé (finché i dati del gioco non sono estratti, serve tanto spazio libero quanto occupano i file decompressi).",
|
||||
"ui.section_files": "File del gioco",
|
||||
"ui.section_install": "Installazione",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "キーボードとマウスのボタン表示の作成",
|
||||
"step.shapes": "ディスプレイに合わせたゲーム画面のレイアウト",
|
||||
"step.dlss": "NVIDIA DLSS のダウンロード",
|
||||
"step.fsr": "AMD FSR 4 のダウンロード",
|
||||
"step.cleanup": "後片付け",
|
||||
"phase.check.host": "プロセッサーとグラフィックカードを確認しています",
|
||||
"phase.check.verify": "インストール済みのファイルを確認しています",
|
||||
@@ -39,6 +40,7 @@
|
||||
"phase.prepare.pack": "シェーダーキャッシュを 1 つのファイルにまとめています",
|
||||
"phase.shapes.layouts": "画面の形ごとに画面レイアウトとボタン表示を書き込んでいます",
|
||||
"phase.dlss.download": "NVIDIA の DLSS SDK から nvngx_dlss.dll をダウンロードしています",
|
||||
"phase.fsr.download": "AMD の FSR SDK から FSR 4 のライブラリをダウンロードしています",
|
||||
"phase.cleanup.ini": "totk.ini を書き込んでいます",
|
||||
"phase.cleanup.temp": "一時ファイルを削除しています",
|
||||
"cli.usage": "コマンドラインが無効です: {detail}",
|
||||
@@ -117,6 +119,8 @@
|
||||
"warn.kernel_old": "Linux {version} には、ゲームが必要とする書き込み追跡 (6.7 以降) がありません。ゲームが非常に遅くなることがあります。システムを更新すると解決します。",
|
||||
"warn.dlss_kept": "インストール先フォルダーには既に DLSS ライブラリがあります ({path})。セットアップはそれを残します。",
|
||||
"warn.dlss_download_failed": "NVIDIA DLSS を {url} からダウンロードできませんでした: {detail}。ゲームはなしで動作します。次回のセットアップ実行時に再試行します。",
|
||||
"warn.fsr_kept": "インストール先フォルダーには既に FSR ライブラリがあります ({path})。セットアップはそれらを残します。",
|
||||
"warn.fsr_download_failed": "AMD FSR 4 を {url} からダウンロードできませんでした: {detail}。ゲームはなしで動作します。次回のセットアップ実行時に再試行します。",
|
||||
"ui.title": "TotK セットアップ",
|
||||
"ui.rebuild_title": "Mod に合わせてゲームを再ビルドしています",
|
||||
"ui.start_game": "ゲームを開始",
|
||||
@@ -139,6 +143,8 @@
|
||||
"ui.firmware_help": "中国語、韓国語、繁体字中国語のテキスト用: ファームウェアの Contents/registered フォルダー (例: Ryujinx や Yuzu のもの)。セットアップはそこから Switch のシステムフォントをインストール先フォルダーにコピーします。",
|
||||
"ui.dlss": "NVIDIA RTX グラフィックカード用に NVIDIA DLSS (nvngx_dlss.dll) をダウンロードする",
|
||||
"ui.dlss_help": "GitHub 上の NVIDIA の DLSS SDK から、NVIDIA の RTX SDK ライセンスのもとで取得します (github.com/NVIDIA/DLSS)。これで dlaa と DLSS の設定が機能します。ない場合、これらの設定は効果がありません。",
|
||||
"ui.fsr": "AMD Radeon グラフィックカード用に AMD FSR 4 (AMD の FSR SDK ライブラリ) をダウンロードする",
|
||||
"ui.fsr_help": "GitHub 上の AMD の FSR SDK から、AMD の FSR SDK ライセンスのもとで取得します (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK)。これで、AMD のライブラリが FSR 4 を提供する Radeon カードで、3D シーンのアップスケーラーの AMD FSR 4 が機能します。ない場合、この選択は効果がありません。AMD のグラフィックカードがあるときは最初からチェックされています。",
|
||||
"ui.compressed_help": "圧縮された NSZ / XCZ ファイルはそのまま使えます。セットアップが自分で展開します(ゲームデータの展開が終わるまで、展開後のファイルと同じだけの空き容量が必要です)。",
|
||||
"ui.section_files": "ゲームファイル",
|
||||
"ui.section_install": "インストール",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "키보드 및 마우스 버튼 표시 그리기",
|
||||
"step.shapes": "모니터에 맞게 게임 화면 배치",
|
||||
"step.dlss": "NVIDIA DLSS 다운로드",
|
||||
"step.fsr": "AMD FSR 4 다운로드",
|
||||
"step.cleanup": "정리",
|
||||
"phase.check.host": "프로세서와 그래픽 카드를 확인하는 중",
|
||||
"phase.check.verify": "이미 설치된 파일을 확인하는 중",
|
||||
@@ -39,6 +40,7 @@
|
||||
"phase.prepare.pack": "셰이더 캐시를 파일 하나로 묶는 중",
|
||||
"phase.shapes.layouts": "화면 형태마다 화면 레이아웃과 버튼 표시 쓰는 중",
|
||||
"phase.dlss.download": "NVIDIA DLSS SDK에서 nvngx_dlss.dll을 다운로드하는 중",
|
||||
"phase.fsr.download": "AMD FSR SDK에서 FSR 4 라이브러리를 다운로드하는 중",
|
||||
"phase.cleanup.ini": "totk.ini를 쓰는 중",
|
||||
"phase.cleanup.temp": "임시 파일을 삭제하는 중",
|
||||
"cli.usage": "잘못된 명령줄: {detail}",
|
||||
@@ -117,6 +119,8 @@
|
||||
"warn.kernel_old": "Linux {version}에는 게임이 사용하는 쓰기 추적(6.7 이상)이 없습니다. 게임이 매우 느릴 수 있습니다. 시스템을 업데이트하면 해결됩니다.",
|
||||
"warn.dlss_kept": "설치 폴더에 이미 DLSS 라이브러리가 있습니다({path}). 설치 프로그램은 그대로 둡니다.",
|
||||
"warn.dlss_download_failed": "{url}에서 NVIDIA DLSS를 다운로드할 수 없습니다: {detail}. 게임은 없이도 실행되며, 다음 설치 실행 때 다시 시도합니다.",
|
||||
"warn.fsr_kept": "설치 폴더에 이미 FSR 라이브러리가 있습니다({path}). 설치 프로그램은 그대로 둡니다.",
|
||||
"warn.fsr_download_failed": "{url}에서 AMD FSR 4를 다운로드할 수 없습니다: {detail}. 게임은 없이도 실행되며, 다음 설치 실행 때 다시 시도합니다.",
|
||||
"ui.title": "TotK 설치",
|
||||
"ui.rebuild_title": "모드에 맞게 게임을 다시 빌드하는 중",
|
||||
"ui.start_game": "게임 시작",
|
||||
@@ -139,6 +143,8 @@
|
||||
"ui.firmware_help": "중국어, 한국어, 번체 중국어 텍스트용: 펌웨어의 Contents/registered 폴더(예: Ryujinx 또는 Yuzu의 폴더). 설치 프로그램이 여기에서 Switch 시스템 글꼴을 설치 폴더로 복사합니다.",
|
||||
"ui.dlss": "NVIDIA RTX 그래픽 카드용 NVIDIA DLSS (nvngx_dlss.dll) 다운로드",
|
||||
"ui.dlss_help": "GitHub의 NVIDIA DLSS SDK에서, NVIDIA RTX SDK 라이선스에 따라 받습니다(github.com/NVIDIA/DLSS). 이 파일이 있어야 dlaa 및 DLSS 설정이 작동하며, 없으면 아무 효과가 없습니다.",
|
||||
"ui.fsr": "AMD Radeon 그래픽 카드용 AMD FSR 4 (AMD FSR SDK 라이브러리) 다운로드",
|
||||
"ui.fsr_help": "GitHub의 AMD FSR SDK에서, AMD FSR SDK 라이선스에 따라 받습니다(github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). 이 라이브러리가 있어야 AMD 라이브러리가 FSR 4를 제공하는 Radeon 카드에서 3D 장면 업스케일러의 AMD FSR 4 선택이 작동하며, 없으면 아무 효과가 없습니다. AMD 그래픽 카드가 있는 컴퓨터에서는 처음부터 체크되어 있습니다.",
|
||||
"ui.compressed_help": "압축된 NSZ 및 XCZ 파일은 그대로 사용할 수 있습니다. 설치 프로그램이 직접 압축을 풉니다(게임 데이터를 추출할 때까지 압축을 푼 파일만큼의 여유 공간이 필요합니다).",
|
||||
"ui.section_files": "게임 파일",
|
||||
"ui.section_install": "설치",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "Toetsenbord- en muispictogrammen tekenen",
|
||||
"step.shapes": "De spelschermen voor je beeldschermen indelen",
|
||||
"step.dlss": "NVIDIA DLSS downloaden",
|
||||
"step.fsr": "AMD FSR 4 downloaden",
|
||||
"step.cleanup": "Opruimen",
|
||||
"phase.check.host": "Processor en videokaart controleren",
|
||||
"phase.check.verify": "Al geïnstalleerde bestanden controleren",
|
||||
@@ -39,6 +40,7 @@
|
||||
"phase.prepare.pack": "Shadercache in één bestand verpakken",
|
||||
"phase.shapes.layouts": "Schermindelingen en knoppictogrammen voor elke schermvorm schrijven",
|
||||
"phase.dlss.download": "nvngx_dlss.dll downloaden uit NVIDIA's DLSS SDK",
|
||||
"phase.fsr.download": "De FSR 4-bibliotheken downloaden uit AMD's FSR SDK",
|
||||
"phase.cleanup.ini": "totk.ini schrijven",
|
||||
"phase.cleanup.temp": "Tijdelijke bestanden verwijderen",
|
||||
"cli.usage": "Ongeldige opdrachtregel: {detail}",
|
||||
@@ -117,6 +119,8 @@
|
||||
"warn.kernel_old": "Linux {version} mist de schrijftracering waar het spel op rekent (6.7 of nieuwer); het spel kan erg traag zijn. Het systeem bijwerken lost dit op.",
|
||||
"warn.dlss_kept": "Er staat al een DLSS-bibliotheek in de installatiemap ({path}); de installatie laat die staan.",
|
||||
"warn.dlss_download_failed": "NVIDIA DLSS kon niet worden gedownload van {url}: {detail}. Het spel werkt zonder; de volgende installatieronde probeert het opnieuw.",
|
||||
"warn.fsr_kept": "Er staat al een FSR-bibliotheek in de installatiemap ({path}); de installatie laat de bibliotheken daar staan.",
|
||||
"warn.fsr_download_failed": "AMD FSR 4 kon niet worden gedownload van {url}: {detail}. Het spel werkt zonder; de volgende installatieronde probeert het opnieuw.",
|
||||
"ui.title": "TotK-installatie",
|
||||
"ui.rebuild_title": "Spel opnieuw bouwen voor je mods",
|
||||
"ui.start_game": "Spel starten",
|
||||
@@ -139,6 +143,8 @@
|
||||
"ui.firmware_help": "Voor Chinese, Koreaanse en traditioneel Chinese tekst: de map Contents/registered van de firmware, bijvoorbeeld uit Ryujinx of Yuzu. De installatie kopieert daaruit de systeemlettertypen van de Switch naar de installatiemap.",
|
||||
"ui.dlss": "NVIDIA DLSS (nvngx_dlss.dll) downloaden voor NVIDIA RTX-videokaarten",
|
||||
"ui.dlss_help": "Uit NVIDIA's DLSS SDK op GitHub, onder NVIDIA's RTX SDK-licentie (github.com/NVIDIA/DLSS). Hiermee werken de instellingen dlaa en DLSS; zonder doen ze niets.",
|
||||
"ui.fsr": "AMD FSR 4 (AMD's FSR SDK-bibliotheken) downloaden voor AMD Radeon-videokaarten",
|
||||
"ui.fsr_help": "Uit AMD's FSR SDK op GitHub, onder AMD's FSR SDK-licentie (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). Hiermee werkt de keuze AMD FSR 4 van de 3D-scène-upscaler op de Radeon-kaarten waarvoor AMD's bibliotheken FSR 4 bieden; zonder doet die keuze niets. Aangevinkt bij de start als de computer een AMD-videokaart heeft.",
|
||||
"ui.compressed_help": "Gecomprimeerde NSZ- en XCZ-bestanden werken zoals ze zijn: de installatie pakt ze zelf uit (tot de spelgegevens zijn uitgepakt, is daarvoor evenveel vrije ruimte nodig als de uitgepakte bestanden innemen).",
|
||||
"ui.section_files": "Spelbestanden",
|
||||
"ui.section_install": "Installatie",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "Desenhando os ícones de teclado e mouse",
|
||||
"step.shapes": "Ajustando as telas do jogo aos seus monitores",
|
||||
"step.dlss": "Baixando o NVIDIA DLSS",
|
||||
"step.fsr": "Baixando o AMD FSR 4",
|
||||
"step.cleanup": "Finalizando",
|
||||
|
||||
"phase.check.host": "Verificando o processador e a placa de vídeo",
|
||||
@@ -40,6 +41,7 @@
|
||||
"phase.prepare.pack": "Juntando o cache de shaders num único arquivo",
|
||||
"phase.shapes.layouts": "Gravando os layouts de tela e os botões para cada formato de monitor",
|
||||
"phase.dlss.download": "Baixando o nvngx_dlss.dll do DLSS SDK da NVIDIA",
|
||||
"phase.fsr.download": "Baixando as bibliotecas do FSR 4 do FSR SDK da AMD",
|
||||
"phase.cleanup.ini": "Gravando o totk.ini",
|
||||
"phase.cleanup.temp": "Removendo os arquivos temporários",
|
||||
|
||||
@@ -122,6 +124,8 @@
|
||||
"warn.kernel_old": "O Linux {version} não tem o rastreamento de escrita de que o jogo depende (6.7 ou mais novo); o jogo pode rodar muito devagar. Atualizar o sistema resolve.",
|
||||
"warn.dlss_kept": "Já existe uma biblioteca DLSS na pasta de instalação ({path}); a instalação a mantém.",
|
||||
"warn.dlss_download_failed": "Não foi possível baixar o NVIDIA DLSS de {url}: {detail}. O jogo funciona sem ele; a próxima execução da instalação tenta de novo.",
|
||||
"warn.fsr_kept": "Já existe uma biblioteca FSR na pasta de instalação ({path}); a instalação mantém as bibliotecas que estão lá.",
|
||||
"warn.fsr_download_failed": "Não foi possível baixar o AMD FSR 4 de {url}: {detail}. O jogo funciona sem ele; a próxima execução da instalação tenta de novo.",
|
||||
|
||||
"ui.title": "Instalação do TotK",
|
||||
"ui.rebuild_title": "Recompilando o jogo para os seus mods",
|
||||
@@ -145,6 +149,8 @@
|
||||
"ui.firmware_help": "Para textos em chinês, coreano e chinês tradicional: a pasta Contents/registered do firmware, por exemplo do Ryujinx ou do Yuzu. A instalação copia dela as fontes do sistema do Switch para a pasta de instalação.",
|
||||
"ui.dlss": "Baixar o NVIDIA DLSS (nvngx_dlss.dll) para placas de vídeo NVIDIA RTX",
|
||||
"ui.dlss_help": "Do DLSS SDK da NVIDIA no GitHub, sob a licença NVIDIA RTX SDK (github.com/NVIDIA/DLSS). Sem ele as opções dlaa e DLSS não fazem nada.",
|
||||
"ui.fsr": "Baixar o AMD FSR 4 (bibliotecas do FSR SDK da AMD) para placas de vídeo AMD Radeon",
|
||||
"ui.fsr_help": "Do FSR SDK da AMD no GitHub, sob a licença do AMD FSR SDK (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). Elas fazem a opção AMD FSR 4 do upscaler da cena 3D funcionar nas placas Radeon para as quais as bibliotecas da AMD oferecem o FSR 4; sem elas essa opção não faz nada. Vem marcada quando o computador tem uma placa de vídeo AMD.",
|
||||
"ui.compressed_help": "Arquivos compactados NSZ e XCZ funcionam do jeito que estão: a instalação os descompacta sozinha (para isso, até os dados do jogo serem extraídos, ela precisa de tanto espaço livre quanto ocupam os arquivos descompactados).",
|
||||
"ui.section_files": "Arquivos do jogo",
|
||||
"ui.section_install": "Instalação",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "Рисование подсказок клавиатуры и мыши",
|
||||
"step.shapes": "Раскладка экранов игры под ваши мониторы",
|
||||
"step.dlss": "Загрузка NVIDIA DLSS",
|
||||
"step.fsr": "Загрузка AMD FSR 4",
|
||||
"step.cleanup": "Уборка",
|
||||
|
||||
"phase.check.host": "Проверка процессора и видеокарты",
|
||||
@@ -40,6 +41,7 @@
|
||||
"phase.prepare.pack": "Упаковка кэша шейдеров в один файл",
|
||||
"phase.shapes.layouts": "Запись раскладок экрана и кнопок для каждой формы монитора",
|
||||
"phase.dlss.download": "Загрузка nvngx_dlss.dll из DLSS SDK от NVIDIA",
|
||||
"phase.fsr.download": "Загрузка библиотек FSR 4 из FSR SDK от AMD",
|
||||
"phase.cleanup.ini": "Запись totk.ini",
|
||||
"phase.cleanup.temp": "Удаление временных файлов",
|
||||
|
||||
@@ -122,6 +124,8 @@
|
||||
"warn.kernel_old": "В Linux {version} нет отслеживания записи, на которое опирается игра (нужна версия 6.7 или новее); игра может работать очень медленно. Обновление системы это исправит.",
|
||||
"warn.dlss_kept": "В папке установки уже есть библиотека DLSS ({path}); установка её оставляет.",
|
||||
"warn.dlss_download_failed": "Не удалось загрузить NVIDIA DLSS с {url}: {detail}. Игра работает и без него; при следующем запуске установка попробует снова.",
|
||||
"warn.fsr_kept": "В папке установки уже есть библиотека FSR ({path}); установка оставляет имеющиеся библиотеки.",
|
||||
"warn.fsr_download_failed": "Не удалось загрузить AMD FSR 4 с {url}: {detail}. Игра работает и без него; при следующем запуске установка попробует снова.",
|
||||
|
||||
"ui.title": "Установка TotK",
|
||||
"ui.rebuild_title": "Пересборка игры под ваши моды",
|
||||
@@ -145,6 +149,8 @@
|
||||
"ui.firmware_help": "Для текста на китайском и корейском: папка Contents/registered прошивки, например из Ryujinx или Yuzu. Установка скопирует из неё системные шрифты Switch в папку установки.",
|
||||
"ui.dlss": "Загрузить NVIDIA DLSS (nvngx_dlss.dll) для видеокарт NVIDIA RTX",
|
||||
"ui.dlss_help": "Из DLSS SDK от NVIDIA на GitHub, по лицензии NVIDIA RTX SDK (github.com/NVIDIA/DLSS). Без него настройки dlaa и DLSS ничего не делают.",
|
||||
"ui.fsr": "Загрузить AMD FSR 4 (библиотеки FSR SDK от AMD) для видеокарт AMD Radeon",
|
||||
"ui.fsr_help": "Из FSR SDK от AMD на GitHub, по лицензии AMD FSR SDK (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). С ними работает вариант AMD FSR 4 в апскейлере 3D-сцены на тех видеокартах Radeon, для которых библиотеки AMD предлагают FSR 4; без них этот выбор ничего не делает. Отмечено по умолчанию, если в компьютере есть видеокарта AMD.",
|
||||
"ui.compressed_help": "Сжатые файлы NSZ и XCZ подходят как есть: установка сама их распакует (для этого, пока извлекаются данные игры, нужно столько свободного места, сколько занимают распакованные файлы).",
|
||||
"ui.section_files": "Файлы игры",
|
||||
"ui.section_install": "Установка",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"step.pc_prompts": "绘制键盘和鼠标按键提示",
|
||||
"step.shapes": "为你的显示器调整游戏画面布局",
|
||||
"step.dlss": "下载 NVIDIA DLSS",
|
||||
"step.fsr": "下载 AMD FSR 4",
|
||||
"step.cleanup": "清理",
|
||||
|
||||
"phase.check.host": "检查处理器和显卡",
|
||||
@@ -40,6 +41,7 @@
|
||||
"phase.prepare.pack": "将着色器缓存打包成一个文件",
|
||||
"phase.shapes.layouts": "为每种显示器比例写入画面布局和按键提示",
|
||||
"phase.dlss.download": "从 NVIDIA 的 DLSS SDK 下载 nvngx_dlss.dll",
|
||||
"phase.fsr.download": "从 AMD 的 FSR SDK 下载 FSR 4 库",
|
||||
"phase.cleanup.ini": "写入 totk.ini",
|
||||
"phase.cleanup.temp": "删除临时文件",
|
||||
|
||||
@@ -122,6 +124,8 @@
|
||||
"warn.kernel_old": "Linux {version} 缺少游戏依赖的写入跟踪功能(需要 6.7 或更新版本);游戏可能运行得很慢。更新系统即可解决。",
|
||||
"warn.dlss_kept": "安装文件夹中已有 DLSS 库({path});安装程序将保留它。",
|
||||
"warn.dlss_download_failed": "无法从 {url} 下载 NVIDIA DLSS:{detail}。游戏无需它也能运行;下次运行安装程序时会重试。",
|
||||
"warn.fsr_kept": "安装文件夹中已有 FSR 库({path});安装程序将保留其中的库。",
|
||||
"warn.fsr_download_failed": "无法从 {url} 下载 AMD FSR 4:{detail}。游戏无需它也能运行;下次运行安装程序时会重试。",
|
||||
|
||||
"ui.title": "TotK 安装程序",
|
||||
"ui.rebuild_title": "正在为你的模组重新构建游戏",
|
||||
@@ -145,6 +149,8 @@
|
||||
"ui.firmware_help": "用于中文、韩文和繁体中文文本:固件的 Contents/registered 文件夹,例如来自 Ryujinx 或 Yuzu。安装程序会从中把 Switch 系统字体复制到安装文件夹。",
|
||||
"ui.dlss": "为 NVIDIA RTX 显卡下载 NVIDIA DLSS(nvngx_dlss.dll)",
|
||||
"ui.dlss_help": "来自 GitHub 上 NVIDIA 的 DLSS SDK,遵循 NVIDIA RTX SDK 许可(github.com/NVIDIA/DLSS)。没有它,dlaa 和 DLSS 设置不起作用。",
|
||||
"ui.fsr": "为 AMD Radeon 显卡下载 AMD FSR 4(AMD 的 FSR SDK 库)",
|
||||
"ui.fsr_help": "来自 GitHub 上 AMD 的 FSR SDK,遵循 AMD FSR SDK 许可(github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK)。有了这些库,3D 场景超分中的 AMD FSR 4 选项才能在 AMD 库提供 FSR 4 的 Radeon 显卡上工作;没有它们,该选项不起作用。电脑装有 AMD 显卡时默认勾选。",
|
||||
"ui.compressed_help": "压缩的 NSZ 和 XCZ 文件可以直接使用:安装程序会自行解压(在游戏数据提取完成之前,需要与解压后文件大小相同的可用空间)。",
|
||||
"ui.section_files": "游戏文件",
|
||||
"ui.section_install": "安装",
|
||||
|
||||
+4
-4
@@ -44,7 +44,7 @@ static const char *const known[] = {
|
||||
"DESC_TEMPLATE", "DESWIZZLE", "DEVICE_PROFILE", "DIALOGUE_CLICK", "DISCORD_APP_ID", "DISCORD_IMAGE", "DISCORD_RPC", "DLAA", "DLAA_CAM_JITTER", "DLAA_EFFECTS_AFTER", "DLAA_JITTER", "DLAA_MV", "DLAA_MASKDEBUG", "DLAA_MVDEBUG", "DLAA_OBJMV", "DLAA_SURVEY", "DLAA_TIMES", "DLSS", "DLSS_CHAR_MASK", "DLSS_FIXED_EXPOSURE", "DLSS_PRESET", "DLSS_REACTIVE", "DUMP", "DUMP_BUF", "DUMP_DIR",
|
||||
"DUMP_LOG", "DYNAMIC_RES", "DYN_DELTA", "EXEFS", "FEEDBACK", "FG_DEBUG", "FG_OBJECTS", "FG_SHOT", "FG_SHOT_DIR", "FG_TEST", "FG_TIMES", "FIXED_RES_PATCH", "FIX_C0", "FIX_ZERO", "FLIGHT", "FLIGHT_AT", "FLIGHT_DIR", "FLIGHT_FRAMES",
|
||||
"FLIGHT_SPIKE_MS", "FLIGHT_THUMBS", "FLUSH_SPAN", "FOV", "FOV_PATCH", "FPS60", "FPS_LIMIT", "FRAME_GEN", "FRAME_QUEUE", "FREECAM_KEY", "FREECAM_PAD", "FREECAM_PATCH",
|
||||
"FREEZE_IDLE", "FREE_CORES", "FSR3_DEBUG", "FSR3_VIEW", "FSR_SHARPNESS",
|
||||
"FREEZE_IDLE", "FREE_CORES", "FSR3_DEBUG", "FSR3_VIEW", "FSR4_DEBUG", "FSR_SHARPNESS",
|
||||
"FULLSCREEN", "FXAA",
|
||||
"GAMEPLAY_DISTANCE_SENSITIVITY", "GAMEPLAY_ITEM_AD", "GAMEPLAY_ITEM_SENSITIVITY", "GAMEPLAY_ITEM_WHEEL",
|
||||
"GAMEPLAY_MAP_ZOOM", "GAMEPLAY_MAP_ZOOM_SENSITIVITY", "GAMEPLAY_ROTATION_SENSITIVITY", "GAMEPLAY_TWEAKS_ENABLED",
|
||||
@@ -142,7 +142,7 @@ static const CfgMeta metas[] = {
|
||||
{"HUD_WIDTH", "full", "full|21:9|16:9", RESTART},
|
||||
{"DYNAMIC_RES", "1", "0|1", LIVE}, // resolution.c res_dynres_live
|
||||
{"UPSCALER", "fsr", "fsr|bilinear", LIVE}, {"SHARPNESS", "80", "0..100", LIVE},
|
||||
{"SCENE_UPSCALER", "off", "off|dlss|fsr3", RESTART}, {"DLAA", "0", "0|1", RESTART},
|
||||
{"SCENE_UPSCALER", "off", "off|dlss|fsr3|fsr4", RESTART}, {"DLAA", "0", "0|1", RESTART},
|
||||
{"DLSS", "dlaa", "dlaa|quality|balanced|performance|ultra_performance", LIVE},
|
||||
{"FSR_SHARPNESS", "80", "0..100", LIVE}, // vk_dlaa.c fsr_evaluate
|
||||
{"DLSS_PRESET", "default", "default|k|j", LIVE}, {"DLSS_FIXED_EXPOSURE", "0", "0|1", LIVE}, {"DLAA_EFFECTS_AFTER", "0", "0|1", LIVE},
|
||||
@@ -863,9 +863,9 @@ void cfg_init(void) {
|
||||
}
|
||||
|
||||
// scene_upscaler, or for a totk.ini that predates it the dlaa switch it replaced: dlaa = 1 is DLSS, anything else off.
|
||||
// FSR 3.1 is never the answer for a player who did not pick it. An unknown value is off.
|
||||
// FSR is never the answer for a player who did not pick it. An unknown value is off.
|
||||
const char *cfg_scene_upscaler(void) {
|
||||
if (!cfg_is_set("TOTK_SCENE_UPSCALER")) return cfg_bool("TOTK_DLAA") ? "dlss" : "off";
|
||||
const char *v = cfg_value("TOTK_SCENE_UPSCALER");
|
||||
return !strcmp(v, "dlss") ? "dlss" : !strcmp(v, "fsr3") ? "fsr3" : "off";
|
||||
return !strcmp(v, "dlss") ? "dlss" : !strcmp(v, "fsr3") ? "fsr3" : !strcmp(v, "fsr4") ? "fsr4" : "off";
|
||||
}
|
||||
+5
-3
@@ -69,14 +69,16 @@ const char *cfg_value(const char *name);
|
||||
int cfg_int(const char *name);
|
||||
double cfg_double(const char *name);
|
||||
int cfg_bool(const char *name);
|
||||
// The 3D scene upscaler the settings name now: "off", "dlss" or "fsr3" (scene_upscaler; without it dlaa = 1 is "dlss").
|
||||
// The 3D scene upscaler the settings name now: "off", "dlss", "fsr3" or "fsr4" (scene_upscaler; without it dlaa = 1 is
|
||||
// "dlss").
|
||||
// The engine in use is the one named at start (vk_dlaa.c vk_upscaler_engine).
|
||||
const char *cfg_scene_upscaler(void);
|
||||
// vk_dlaa.c, the 3D scene upscaler (scene_upscaler): the engine picked at start (UPSCALER_*),
|
||||
// 1 while the settings still name it (the menu switches it off at once), the engine that is running (it
|
||||
// ran and has not failed; 0 none), and why an engine cannot run here (UPSCALER_MISSING_*, 0 it can).
|
||||
enum { UPSCALER_OFF, UPSCALER_DLSS, UPSCALER_FSR3 };
|
||||
enum { UPSCALER_MISSING_GPU = 1, UPSCALER_MISSING_DLL };
|
||||
// UPSCALER_FSR4 is AMD's FSR 4 from its FSR SDK libraries (vk_ffx.c), Windows only (UPSCALER_MISSING_OS elsewhere).
|
||||
enum { UPSCALER_OFF, UPSCALER_DLSS, UPSCALER_FSR3, UPSCALER_FSR4 };
|
||||
enum { UPSCALER_MISSING_GPU = 1, UPSCALER_MISSING_DLL, UPSCALER_MISSING_OS };
|
||||
int vk_upscaler_engine(void);
|
||||
int vk_upscaler_on(void);
|
||||
int vk_upscaler_running(void);
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
// The part of AMD's FSR API (ffx-api) that vk_ffx.c uses: the entry points of amd_fidelityfx_loader_vk.dll, the
|
||||
// Vulkan backend descriptor and the upscaler's create and dispatch descriptors. Copied from the FidelityFX SDK v2.4.0
|
||||
// (GPUOpen-LibrariesAndSDKs/FidelityFX-SDK, Kits/FidelityFX/api/include/ffx_api.h, ffx_api_types.h, vk/ffx_api_vk.h
|
||||
// and Kits/FidelityFX/upscalers/include/ffx_upscale.h), trimmed to those declarations; the layouts and values are
|
||||
// unchanged. The SDK's headers use a C++ attribute for deprecations, so they are not included as they are.
|
||||
//
|
||||
// This file is part of the FidelityFX SDK.
|
||||
//
|
||||
// Copyright (C) 2026 Advanced Micro Devices, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files(the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and /or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions :
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
#pragma once
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
// ---- ffx_api.h
|
||||
enum FfxApiReturnCodes {
|
||||
FFX_API_RETURN_OK = 0,
|
||||
FFX_API_RETURN_ERROR = 1,
|
||||
FFX_API_RETURN_ERROR_UNKNOWN_DESCTYPE = 2,
|
||||
FFX_API_RETURN_ERROR_RUNTIME_ERROR = 3,
|
||||
FFX_API_RETURN_NO_PROVIDER = 4,
|
||||
FFX_API_RETURN_ERROR_MEMORY = 5,
|
||||
FFX_API_RETURN_ERROR_PARAMETER = 6,
|
||||
FFX_API_RETURN_PROVIDER_NO_SUPPORT_NEW_DESCTYPE = 7,
|
||||
};
|
||||
|
||||
typedef void *ffxContext;
|
||||
typedef uint32_t ffxReturnCode_t;
|
||||
|
||||
#define FFX_API_EFFECT_MASK 0x00ff0000u
|
||||
#define FFX_API_BACKEND_MASK 0xff000000u
|
||||
|
||||
typedef uint64_t ffxStructType_t;
|
||||
typedef struct ffxApiHeader {
|
||||
ffxStructType_t type;
|
||||
struct ffxApiHeader *pNext;
|
||||
} ffxApiHeader;
|
||||
|
||||
typedef ffxApiHeader ffxCreateContextDescHeader;
|
||||
typedef ffxApiHeader ffxConfigureDescHeader;
|
||||
typedef ffxApiHeader ffxQueryDescHeader;
|
||||
typedef ffxApiHeader ffxDispatchDescHeader;
|
||||
|
||||
enum FfxApiMsgType { FFX_API_MESSAGE_TYPE_ERROR = 0, FFX_API_MESSAGE_TYPE_WARNING = 1 };
|
||||
typedef void (*ffxApiMessage)(uint32_t type, const wchar_t *message);
|
||||
|
||||
#define FFX_API_QUERY_DESC_TYPE_GET_VERSIONS 4u
|
||||
struct ffxQueryDescGetVersions {
|
||||
ffxQueryDescHeader header;
|
||||
uint64_t createDescType;
|
||||
void *device; // Vulkan: a VkDeviceContext *
|
||||
uint64_t *outputCount;
|
||||
uint64_t *versionIds;
|
||||
const char **versionNames;
|
||||
};
|
||||
|
||||
#define FFX_API_DESC_TYPE_OVERRIDE_VERSION 5u
|
||||
struct ffxOverrideVersion {
|
||||
ffxApiHeader header;
|
||||
uint64_t versionId;
|
||||
};
|
||||
|
||||
#define FFX_API_QUERY_DESC_TYPE_GET_PROVIDER_VERSION 6u
|
||||
struct ffxQueryGetProviderVersion {
|
||||
ffxQueryDescHeader header;
|
||||
uint64_t versionId;
|
||||
const char *versionName;
|
||||
};
|
||||
|
||||
typedef struct ffxAllocationCallbacks ffxAllocationCallbacks;
|
||||
typedef ffxReturnCode_t (*PfnFfxCreateContext)(ffxContext *context, ffxCreateContextDescHeader *desc,
|
||||
const ffxAllocationCallbacks *memCb);
|
||||
typedef ffxReturnCode_t (*PfnFfxDestroyContext)(ffxContext *context, const ffxAllocationCallbacks *memCb);
|
||||
typedef ffxReturnCode_t (*PfnFfxQuery)(ffxContext *context, ffxQueryDescHeader *desc);
|
||||
typedef ffxReturnCode_t (*PfnFfxDispatch)(ffxContext *context, const ffxDispatchDescHeader *desc);
|
||||
|
||||
#define FFX_API_EFFECT_ID_UPSCALE 0x00010000u
|
||||
#define FFX_API_MAKE_EFFECT_SUB_ID(effectId, subversion) ((effectId & FFX_API_EFFECT_MASK) | (subversion & ~FFX_API_EFFECT_MASK))
|
||||
#define FFX_API_BACKEND_ID_VK 0x01000000u
|
||||
#define FFX_API_MAKE_BACKEND_SUB_ID(backendId, subversion) ((backendId & FFX_API_BACKEND_MASK) | (subversion & ~FFX_API_BACKEND_MASK))
|
||||
|
||||
// ---- ffx_api_types.h
|
||||
enum FfxApiSurfaceFormat {
|
||||
FFX_API_SURFACE_FORMAT_UNKNOWN,
|
||||
FFX_API_SURFACE_FORMAT_R32G32B32A32_TYPELESS,
|
||||
FFX_API_SURFACE_FORMAT_R32G32B32A32_UINT,
|
||||
FFX_API_SURFACE_FORMAT_R32G32B32A32_FLOAT,
|
||||
FFX_API_SURFACE_FORMAT_R16G16B16A16_FLOAT,
|
||||
FFX_API_SURFACE_FORMAT_R32G32B32_FLOAT,
|
||||
FFX_API_SURFACE_FORMAT_R32G32_FLOAT,
|
||||
FFX_API_SURFACE_FORMAT_R8_UINT,
|
||||
FFX_API_SURFACE_FORMAT_R32_UINT,
|
||||
FFX_API_SURFACE_FORMAT_R8G8B8A8_TYPELESS,
|
||||
FFX_API_SURFACE_FORMAT_R8G8B8A8_UNORM,
|
||||
FFX_API_SURFACE_FORMAT_R8G8B8A8_SNORM,
|
||||
FFX_API_SURFACE_FORMAT_R8G8B8A8_SRGB,
|
||||
FFX_API_SURFACE_FORMAT_B8G8R8A8_TYPELESS,
|
||||
FFX_API_SURFACE_FORMAT_B8G8R8A8_UNORM,
|
||||
FFX_API_SURFACE_FORMAT_B8G8R8A8_SRGB,
|
||||
FFX_API_SURFACE_FORMAT_R11G11B10_FLOAT,
|
||||
FFX_API_SURFACE_FORMAT_R10G10B10A2_UNORM,
|
||||
FFX_API_SURFACE_FORMAT_R16G16_FLOAT,
|
||||
FFX_API_SURFACE_FORMAT_R16G16_UINT,
|
||||
FFX_API_SURFACE_FORMAT_R16G16_SINT,
|
||||
FFX_API_SURFACE_FORMAT_R16_FLOAT,
|
||||
FFX_API_SURFACE_FORMAT_R16_UINT,
|
||||
FFX_API_SURFACE_FORMAT_R16_UNORM,
|
||||
FFX_API_SURFACE_FORMAT_R16_SNORM,
|
||||
FFX_API_SURFACE_FORMAT_R8_UNORM,
|
||||
FFX_API_SURFACE_FORMAT_R8G8_UNORM,
|
||||
FFX_API_SURFACE_FORMAT_R8G8_UINT,
|
||||
FFX_API_SURFACE_FORMAT_R32_FLOAT,
|
||||
};
|
||||
|
||||
enum FfxApiResourceUsage {
|
||||
FFX_API_RESOURCE_USAGE_READ_ONLY = 0,
|
||||
FFX_API_RESOURCE_USAGE_RENDERTARGET = (1 << 0),
|
||||
FFX_API_RESOURCE_USAGE_UAV = (1 << 1),
|
||||
FFX_API_RESOURCE_USAGE_DEPTHTARGET = (1 << 2),
|
||||
};
|
||||
|
||||
enum FfxApiResourceState {
|
||||
FFX_API_RESOURCE_STATE_COMMON = (1 << 0),
|
||||
FFX_API_RESOURCE_STATE_UNORDERED_ACCESS = (1 << 1),
|
||||
FFX_API_RESOURCE_STATE_COMPUTE_READ = (1 << 2),
|
||||
FFX_API_RESOURCE_STATE_PIXEL_READ = (1 << 3),
|
||||
FFX_API_RESOURCE_STATE_COPY_SRC = (1 << 4),
|
||||
FFX_API_RESOURCE_STATE_GENERIC_READ = (FFX_API_RESOURCE_STATE_COPY_SRC | FFX_API_RESOURCE_STATE_COMPUTE_READ),
|
||||
};
|
||||
|
||||
enum FfxApiResourceType { FFX_API_RESOURCE_TYPE_BUFFER, FFX_API_RESOURCE_TYPE_TEXTURE1D, FFX_API_RESOURCE_TYPE_TEXTURE2D };
|
||||
|
||||
struct FfxApiDimensions2D {
|
||||
uint32_t width, height;
|
||||
};
|
||||
struct FfxApiFloatCoords2D {
|
||||
float x, y;
|
||||
};
|
||||
|
||||
struct FfxApiResourceDescription {
|
||||
uint32_t type;
|
||||
uint32_t format;
|
||||
uint32_t width; // union with size (buffers)
|
||||
uint32_t height; // union with stride
|
||||
uint32_t depth; // union with alignment
|
||||
uint32_t mipCount;
|
||||
uint32_t flags;
|
||||
uint32_t usage;
|
||||
};
|
||||
|
||||
struct FfxApiResource {
|
||||
void *resource; // Vulkan: the VkImage
|
||||
struct FfxApiResourceDescription description;
|
||||
uint32_t state;
|
||||
};
|
||||
|
||||
// ---- vk/ffx_api_vk.h
|
||||
typedef struct VkDeviceContext {
|
||||
VkDevice vkDevice;
|
||||
VkPhysicalDevice vkPhysicalDevice;
|
||||
PFN_vkGetDeviceProcAddr vkDeviceProcAddr;
|
||||
} VkDeviceContext;
|
||||
|
||||
#define FFX_API_CREATE_CONTEXT_DESC_TYPE_BACKEND_VK FFX_API_MAKE_BACKEND_SUB_ID(FFX_API_BACKEND_ID_VK, 0x03)
|
||||
struct ffxCreateBackendVKDesc {
|
||||
ffxCreateContextDescHeader header;
|
||||
VkDeviceContext deviceContext;
|
||||
};
|
||||
|
||||
// ---- upscalers/include/ffx_upscale.h
|
||||
#define FFX_UPSCALER_MAKE_VERSION(major, minor, patch) (((major) << 22) | ((minor) << 12) | (patch))
|
||||
#define FFX_UPSCALER_VERSION FFX_UPSCALER_MAKE_VERSION(4, 1, 2)
|
||||
|
||||
enum FfxApiCreateContextUpscaleFlags {
|
||||
FFX_UPSCALE_ENABLE_HIGH_DYNAMIC_RANGE = (1 << 0),
|
||||
FFX_UPSCALE_ENABLE_DISPLAY_RESOLUTION_MOTION_VECTORS = (1 << 1),
|
||||
FFX_UPSCALE_ENABLE_MOTION_VECTORS_JITTER_CANCELLATION = (1 << 2),
|
||||
FFX_UPSCALE_ENABLE_DEPTH_INVERTED = (1 << 3),
|
||||
FFX_UPSCALE_ENABLE_DEPTH_INFINITE = (1 << 4),
|
||||
FFX_UPSCALE_ENABLE_AUTO_EXPOSURE = (1 << 5),
|
||||
FFX_UPSCALE_ENABLE_DYNAMIC_RESOLUTION = (1 << 6),
|
||||
FFX_UPSCALE_ENABLE_DEBUG_CHECKING = (1 << 7),
|
||||
};
|
||||
|
||||
#define FFX_API_CREATE_CONTEXT_DESC_TYPE_UPSCALE FFX_API_MAKE_EFFECT_SUB_ID(FFX_API_EFFECT_ID_UPSCALE, 0x00)
|
||||
struct ffxCreateContextDescUpscale {
|
||||
ffxCreateContextDescHeader header;
|
||||
uint32_t flags;
|
||||
struct FfxApiDimensions2D maxRenderSize;
|
||||
struct FfxApiDimensions2D maxUpscaleSize;
|
||||
ffxApiMessage fpMessage;
|
||||
};
|
||||
|
||||
#define FFX_API_DISPATCH_DESC_TYPE_UPSCALE FFX_API_MAKE_EFFECT_SUB_ID(FFX_API_EFFECT_ID_UPSCALE, 0x01)
|
||||
struct ffxDispatchDescUpscale {
|
||||
ffxDispatchDescHeader header;
|
||||
void *commandList; // Vulkan: the VkCommandBuffer
|
||||
struct FfxApiResource color;
|
||||
struct FfxApiResource depth;
|
||||
struct FfxApiResource motionVectors;
|
||||
struct FfxApiResource exposure;
|
||||
struct FfxApiResource reactive;
|
||||
struct FfxApiResource transparencyAndComposition;
|
||||
struct FfxApiResource output;
|
||||
struct FfxApiFloatCoords2D jitterOffset;
|
||||
struct FfxApiFloatCoords2D motionVectorScale;
|
||||
struct FfxApiDimensions2D renderSize;
|
||||
struct FfxApiDimensions2D upscaleSize;
|
||||
bool enableSharpening;
|
||||
float sharpness;
|
||||
float frameTimeDelta; // milliseconds
|
||||
float preExposure;
|
||||
bool reset;
|
||||
float cameraNear;
|
||||
float cameraFar;
|
||||
float cameraFovAngleVertical; // radians
|
||||
float viewSpaceToMetersFactor;
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
#define FFX_API_CREATE_CONTEXT_DESC_TYPE_UPSCALE_VERSION FFX_API_MAKE_EFFECT_SUB_ID(FFX_API_EFFECT_ID_UPSCALE, 0x0b)
|
||||
struct ffxCreateContextDescUpscaleVersion {
|
||||
ffxCreateContextDescHeader header;
|
||||
uint32_t version; // FFX_UPSCALER_VERSION
|
||||
};
|
||||
@@ -313,6 +313,7 @@ void res_init(void); // after rt_patches_i
|
||||
float res_dlss_lod_bias(void); // TOTK_DLSS upscaling: texture LOD bias (<= 0)
|
||||
int res_dlss_mode(const char *mode); // TOTK_DLSS changed while running: new scene size
|
||||
int res_dlss_dll(void); // the DLSS library is next to the executable
|
||||
int res_ffx_dlls(void); // AMD's two FSR 4 libraries are (Windows; 0 elsewhere)
|
||||
void res_fn_hit(uint64_t addr, uint64_t x0); // main.c fnprof_hit: catches the renderer at start
|
||||
void res_present(Cpu *c); // nvnQueuePresentTexture: applies a pending scene size
|
||||
void res_sizes(unsigned out[2], unsigned scene[2]); // the output and scene sizes in effect (the game's own
|
||||
|
||||
+39
-10
@@ -102,11 +102,35 @@ int res_dlss_dll(void) {
|
||||
return dll;
|
||||
}
|
||||
|
||||
// The engine picked at start can run, as far as is known before the device exists: DLSS needs its DLL (dlss_dll); FSR
|
||||
// 3.1 is built in (vk_fsr3.cpp). Off: nothing to run.
|
||||
// AMD's FSR 4 (vk_ffx.c) loads amd_fidelityfx_loader_vk.dll from the folder of totk.exe, which finds
|
||||
// amd_fidelityfx_upscaler_vk.dll next to itself; both come from the setup's FSR step. Windows only: AMD ships no Linux
|
||||
// libraries.
|
||||
static int ffx_dlls(void) {
|
||||
#ifdef _WIN32
|
||||
char exe[1024], path[1024 + 48];
|
||||
if (!plat_exe_path(exe, sizeof exe)) return 1;
|
||||
char *last = plat_last_sep(exe);
|
||||
if (!last) return 1;
|
||||
snprintf(path, sizeof path, "%.*s/amd_fidelityfx_loader_vk.dll", (int)(last - exe), exe);
|
||||
if (!plat_file_exists(path)) return 0;
|
||||
snprintf(path, sizeof path, "%.*s/amd_fidelityfx_upscaler_vk.dll", (int)(last - exe), exe);
|
||||
return plat_file_exists(path);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int res_ffx_dlls(void) {
|
||||
static int dlls = -1;
|
||||
if (dlls < 0) dlls = ffx_dlls();
|
||||
return dlls;
|
||||
}
|
||||
|
||||
// The engine picked at start can run, as far as is known before the device exists: DLSS needs its DLL (dlss_dll), FSR
|
||||
// 4 AMD's two libraries (ffx_dlls); FSR 3.1 is built in (vk_fsr3.cpp). Off: nothing to run.
|
||||
static int upscaler_ready(void) {
|
||||
int e = vk_upscaler_engine();
|
||||
return e == UPSCALER_DLSS ? res_dlss_dll() : e == UPSCALER_FSR3;
|
||||
return e == UPSCALER_DLSS ? res_dlss_dll() : e == UPSCALER_FSR4 ? res_ffx_dlls() : e == UPSCALER_FSR3;
|
||||
}
|
||||
|
||||
static uint64_t shadow_kib(void);
|
||||
@@ -143,8 +167,12 @@ static double dlss_share(const char *m) {
|
||||
int ready = upscaler_ready();
|
||||
if (!ready && !told++) {
|
||||
#ifdef _WIN32
|
||||
rt_log("resolution: DLSS %s needs nvngx_dlss.dll next to totk.exe, which is missing: the scene follows "
|
||||
"render_scale", m);
|
||||
if (vk_upscaler_engine() == UPSCALER_FSR4)
|
||||
rt_log("resolution: FSR 4 %s needs amd_fidelityfx_loader_vk.dll and amd_fidelityfx_upscaler_vk.dll "
|
||||
"next to totk.exe, which are missing: the scene follows render_scale", m);
|
||||
else
|
||||
rt_log("resolution: DLSS %s needs nvngx_dlss.dll next to totk.exe, which is missing: the scene "
|
||||
"follows render_scale", m);
|
||||
#else
|
||||
rt_log("resolution: DLSS %s needs libnvidia-ngx-dlss.so.<version> next to totk, which is missing: the "
|
||||
"scene follows render_scale", m);
|
||||
@@ -208,7 +236,7 @@ static void decide(void) {
|
||||
else rt_log("resolution: TOTK_SHADOW_RES=%s is not game or a size 256..4096 (a multiple of 8); game", sr);
|
||||
}
|
||||
// A DLSS mode other than dlaa sets the scene size instead. On 1.4.3 with the scene upscaler able to run (DLSS with
|
||||
// its DLL there, or FSR 3.1 in the build)
|
||||
// its DLL there, FSR 4 with AMD's libraries there, or FSR 3.1 in the build)
|
||||
// the mode can change while the game runs (res_dlss_mode): the scene patch is then always on and the heap is sized
|
||||
// for the largest scene the modes ask for. Everyone else keeps the game's own scene size and its dynamic resolution
|
||||
// unless render_scale or a DLSS mode asks for another, and a heap sized for that scene alone.
|
||||
@@ -674,8 +702,8 @@ void res_fov_live(void) {
|
||||
// 2867-wide scene stays at 100 %, one wider than about 2970 does not, and a 4267-wide one (5120x1440 at render_scale
|
||||
// 83) fits no tier and falls back to 80 % every frame, whatever the GPU's load. 1 (the default) leaves the game's own
|
||||
// stepping and the set off. Runs on a settings change (gfx_present.c window_settings_live), like res_fov_live.
|
||||
// FSR 3.1 as the scene upscaler holds it at 100 % whatever dynamic_res says, as codexx-dev's pull request #1245 does
|
||||
// for its FSR: each tier is a scene of another size, so every step starts FSR's history again, and below 100 % the
|
||||
// FSR 3.1 or FSR 4 as the scene upscaler holds it at 100 % whatever dynamic_res says, as codexx-dev's pull request
|
||||
// #1245 does for its FSR: each tier is a scene of another size, so every step starts FSR's history again, and below 100 % the
|
||||
// game ends its frame another way (a frame log on 1.4.3: its copy shader scales the scene straight into the
|
||||
// output-sized target instead of the scaling FXAA draw), which #1245 measured as a picture that went soft and sharp in
|
||||
// turns at a 2560x1440 scene. A 1280x720 scene (1080p, quality) stayed at 100 % through a 70 s town run, so it gains
|
||||
@@ -683,7 +711,8 @@ void res_fov_live(void) {
|
||||
void res_dynres_live(void) {
|
||||
static int set = -2, shown = -1;
|
||||
if (set == -2) set = rt_patch_set("fixres");
|
||||
int fsr = vk_upscaler_on() && vk_upscaler_engine() == UPSCALER_FSR3;
|
||||
int e = vk_upscaler_engine();
|
||||
int fsr = vk_upscaler_on() && (e == UPSCALER_FSR3 || e == UPSCALER_FSR4);
|
||||
int dyn = cfg_bool("TOTK_DYNAMIC_RES") && !fsr;
|
||||
int state = dyn | fsr << 1;
|
||||
if (state == shown) return;
|
||||
@@ -695,7 +724,7 @@ void res_dynres_live(void) {
|
||||
rt_patch_switch(set, !dyn);
|
||||
rt_log("resolution: dynamic resolution %s",
|
||||
dyn ? "on: the game's own 100, 90 or 80 %"
|
||||
: fsr ? "off while FSR 3.1 upscales the scene: the scene stays at 100 %"
|
||||
: fsr ? "off while FSR upscales the scene: the scene stays at 100 %"
|
||||
: "off: the scene stays at 100 %");
|
||||
}
|
||||
|
||||
|
||||
+24
-14
@@ -616,22 +616,30 @@ static void row_hud_width(void) {
|
||||
opt_choice_list("TOTK_HUD_WIDTH", UI_MENU_HUD_WIDTH, vals, names, n, UI_MENU_HUD_WIDTH_DESC);
|
||||
}
|
||||
|
||||
// The 3D scene upscaler (vk_dlaa.c): off, NVIDIA DLSS or AMD FSR 3.1. An engine that cannot run here is left out of
|
||||
// the steps, and the note under the value says why; a totk.ini that names it anyway shows it, with the same note.
|
||||
// Returns the value the settings name ("off", "dlss", "fsr3"; without scene_upscaler, dlaa = 1 is "dlss").
|
||||
// The 3D scene upscaler (vk_dlaa.c): off, NVIDIA DLSS, AMD FSR 3.1 or AMD FSR 4. An engine that cannot run here is
|
||||
// left out of the steps, and the note under the value says why; a totk.ini that names it anyway shows it, with the
|
||||
// same note. FSR 4 is Windows only (AMD ships no Linux libraries): elsewhere it is left out without a note.
|
||||
// Returns the value the settings name ("off", "dlss", "fsr3", "fsr4"; without scene_upscaler, dlaa = 1 is "dlss").
|
||||
static const char *row_scene_upscaler(void) {
|
||||
static const char *const all[] = {"off", "dlss", "fsr3"};
|
||||
static const int engines[] = {UPSCALER_OFF, UPSCALER_DLSS, UPSCALER_FSR3};
|
||||
static const UiTextId ids[] = {UI_MENU_SCENE_UPSCALER_OFF, UI_MENU_SCENE_UPSCALER_DLSS, UI_MENU_SCENE_UPSCALER_FSR3};
|
||||
enum { N = 4 };
|
||||
static const char *const all[N] = {"off", "dlss", "fsr3", "fsr4"};
|
||||
static const int engines[N] = {UPSCALER_OFF, UPSCALER_DLSS, UPSCALER_FSR3, UPSCALER_FSR4};
|
||||
static const UiTextId ids[N] = {UI_MENU_SCENE_UPSCALER_OFF, UI_MENU_SCENE_UPSCALER_DLSS, UI_MENU_SCENE_UPSCALER_FSR3,
|
||||
UI_MENU_SCENE_UPSCALER_FSR4};
|
||||
const char *now = cfg_scene_upscaler();
|
||||
const char *vals[3], *names[3];
|
||||
const char *vals[N], *names[N];
|
||||
static char note[256];
|
||||
note[0] = 0;
|
||||
int n = 0, cur = -1;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int i = 0; i < N; i++) {
|
||||
int why = vk_upscaler_missing(engines[i]);
|
||||
if (why) {
|
||||
UiTextId t = why == UPSCALER_MISSING_DLL ? UI_MENU_SCENE_UPSCALER_NO_DLSS_DLL : UI_MENU_SCENE_UPSCALER_NO_DLSS_GPU;
|
||||
if (why && (why != UPSCALER_MISSING_OS || !strcmp(now, all[i]))) {
|
||||
UiTextId t = engines[i] == UPSCALER_FSR4
|
||||
? (why == UPSCALER_MISSING_DLL ? UI_MENU_SCENE_UPSCALER_NO_FSR4_DLL
|
||||
: why == UPSCALER_MISSING_OS ? UI_MENU_SCENE_UPSCALER_NO_FSR4_OS
|
||||
: UI_MENU_SCENE_UPSCALER_NO_FSR4_GPU)
|
||||
: why == UPSCALER_MISSING_DLL ? UI_MENU_SCENE_UPSCALER_NO_DLSS_DLL
|
||||
: UI_MENU_SCENE_UPSCALER_NO_DLSS_GPU;
|
||||
size_t k = strlen(note);
|
||||
snprintf(note + k, sizeof note - k, "%s%s", k ? "; " : "", menu_text(t));
|
||||
}
|
||||
@@ -827,9 +835,9 @@ static void tab_screen(float scale) {
|
||||
UI_MENU_DLSS_PERFORMANCE, UI_MENU_DLSS_ULTRA};
|
||||
opt_choice("TOTK_DLSS", UI_MENU_DLSS, dlss, 5, UI_MENU_DLSS_DESC);
|
||||
}
|
||||
if (!strcmp(engine, "fsr3")) // FSR 3.1's own sharpening (vk_dlaa.c fsr_evaluate)
|
||||
opt_slider("TOTK_FSR_SHARPNESS", UI_MENU_FSR3_SHARPNESS, 0, 100, UI_MENU_FSR3_SHARPNESS_DESC, 5, "%.0f %%");
|
||||
if (!strcmp(engine, "dlss")) { // DLSS's model, its characters' mask and its other switches (FSR 3.1 has none)
|
||||
if (!strcmp(engine, "fsr3") || !strcmp(engine, "fsr4")) // FSR's own sharpening (vk_dlaa.c fsr_evaluate)
|
||||
opt_slider("TOTK_FSR_SHARPNESS", UI_MENU_FSR_SHARPNESS, 0, 100, UI_MENU_FSR_SHARPNESS_DESC, 5, "%.0f %%");
|
||||
if (!strcmp(engine, "dlss")) { // DLSS's model, its characters' mask and its other switches (FSR has none)
|
||||
static const UiTextId preset[] = {UI_MENU_DLSS_PRESET_DEFAULT, UI_MENU_DLSS_PRESET_K, UI_MENU_DLSS_PRESET_J};
|
||||
opt_choice("TOTK_DLSS_PRESET", UI_MENU_DLSS_PRESET, preset, 3, UI_MENU_DLSS_PRESET_DESC);
|
||||
static const UiTextId chars[] = {UI_MENU_DLSS_CHARS_OFF, UI_MENU_DLSS_CHARS_LIGHT, UI_MENU_DLSS_CHARS_MEDIUM,
|
||||
@@ -1779,7 +1787,9 @@ static void perf_picture(const MenuTarget *t, const ImVec4 &c) {
|
||||
: !strcmp(m, "ultra_performance") ? UI_MENU_DLSS_ULTRA
|
||||
: UI_MENU_DLSS_DLAA;
|
||||
snprintf(v[6], sizeof v[6], "%s, %s",
|
||||
menu_text(up == UPSCALER_FSR3 ? UI_MENU_SCENE_UPSCALER_FSR3 : UI_MENU_SCENE_UPSCALER_DLSS),
|
||||
menu_text(up == UPSCALER_FSR4 ? UI_MENU_SCENE_UPSCALER_FSR4
|
||||
: up == UPSCALER_FSR3 ? UI_MENU_SCENE_UPSCALER_FSR3
|
||||
: UI_MENU_SCENE_UPSCALER_DLSS),
|
||||
menu_text(mt));
|
||||
}
|
||||
// with frame generation: the pictures shown a second, of which the FPS row above counts the ones the game drew
|
||||
|
||||
+34
-16
@@ -34,6 +34,8 @@ typedef struct { const char *lang; const char *const *text; } Row;
|
||||
#define DLSS_FILE "libnvidia-ngx-dlss.so"
|
||||
#define EXE_FILE "totk"
|
||||
#endif
|
||||
// AMD's FSR 4 libraries (Windows only), as the setup downloads them next to the executable.
|
||||
#define FFX_FILES "amd_fidelityfx_loader_vk.dll, amd_fidelityfx_upscaler_vk.dll"
|
||||
|
||||
static const char *const text_en[UI_TEXT_COUNT] = {
|
||||
SWKBD("Text entry", "Enter a name", "Horse", "OK", "Cancel", "Controller: A = OK, B = Cancel"),
|
||||
@@ -182,15 +184,19 @@ static const char *const text_en[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_SCENE_UPSCALER] = "3D scene upscaler",
|
||||
[UI_MENU_SCENE_UPSCALER_DESC] = "A temporal upscaler for the 3D scene: smoother edges and less shimmer, and in a mode below Native it draws "
|
||||
"the scene smaller and scales it up, which saves GPU time. NVIDIA DLSS needs an NVIDIA "
|
||||
"RTX GPU and " DLSS_FILE " next to " EXE_FILE "; AMD FSR 3.1 runs on any GPU. Off keeps "
|
||||
"RTX GPU and " DLSS_FILE " next to " EXE_FILE "; AMD FSR 3.1 runs on any GPU; AMD FSR 4 "
|
||||
"(Windows) needs a Radeon GPU AMD offers it for and " FFX_FILES " next to " EXE_FILE ". Off keeps "
|
||||
"the game's own scaling and FXAA. The HUD is not touched; the upscaler and sharpness "
|
||||
"above still fit the game image to the window. Takes effect after a restart.",
|
||||
[UI_MENU_SCENE_UPSCALER_OFF] = "Off", [UI_MENU_SCENE_UPSCALER_DLSS] = "NVIDIA DLSS",
|
||||
[UI_MENU_SCENE_UPSCALER_FSR3] = "AMD FSR 3.1",
|
||||
[UI_MENU_SCENE_UPSCALER_FSR3] = "AMD FSR 3.1", [UI_MENU_SCENE_UPSCALER_FSR4] = "AMD FSR 4",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_GPU] = "FSR 4: not offered for this GPU",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_DLL] = "FSR 4: AMD's FSR libraries are missing",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_OS] = "FSR 4: Windows only",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_DLSS_GPU] = "DLSS: needs an NVIDIA RTX GPU",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_DLSS_DLL] = "DLSS: " DLSS_FILE " is missing",
|
||||
[UI_MENU_FSR3_SHARPNESS] = "FSR 3.1 sharpness",
|
||||
[UI_MENU_FSR3_SHARPNESS_DESC] = "Sharpening of the 3D scene after FSR 3.1; 0 turns it off.",
|
||||
[UI_MENU_FSR_SHARPNESS] = "FSR sharpness",
|
||||
[UI_MENU_FSR_SHARPNESS_DESC] = "Sharpening of the 3D scene after AMD FSR 3.1 or FSR 4; 0 turns it off.",
|
||||
|
||||
[UI_MENU_FPS_LIMIT] = "Frame rate limit",
|
||||
[UI_MENU_FPS_LIMIT_DESC] = "The most frames per second the game draws. Above 60 is experimental and needs Game speed "
|
||||
@@ -828,15 +834,19 @@ static const char *const text_ru[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_SCENE_UPSCALER_DESC] = "Временной апскейлер для 3D-сцены: ровнее края и меньше мерцания, а в режимах ниже «Родного» он "
|
||||
"рисует сцену меньше и увеличивает её, что экономит время видеокарты. NVIDIA DLSS "
|
||||
"нужна видеокарта NVIDIA RTX и " DLSS_FILE " рядом с " EXE_FILE "; AMD FSR 3.1 "
|
||||
"работает на любой видеокарте. «Выкл» оставляет собственное масштабирование игры и "
|
||||
"работает на любой видеокарте; AMD FSR 4 (Windows) нужна видеокарта Radeon, для "
|
||||
"которой AMD его предлагает, и " FFX_FILES " рядом с " EXE_FILE ". «Выкл» оставляет собственное масштабирование игры и "
|
||||
"FXAA. Интерфейс не затрагивается; масштабирование и резкость выше по-прежнему "
|
||||
"подгоняют изображение игры под окно. Действует после перезапуска.",
|
||||
[UI_MENU_SCENE_UPSCALER_OFF] = "Выкл", [UI_MENU_SCENE_UPSCALER_DLSS] = "NVIDIA DLSS",
|
||||
[UI_MENU_SCENE_UPSCALER_FSR3] = "AMD FSR 3.1",
|
||||
[UI_MENU_SCENE_UPSCALER_FSR3] = "AMD FSR 3.1", [UI_MENU_SCENE_UPSCALER_FSR4] = "AMD FSR 4",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_GPU] = "FSR 4: недоступен для этой видеокарты",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_DLL] = "FSR 4: нет библиотек FSR от AMD",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_OS] = "FSR 4: только Windows",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_DLSS_GPU] = "DLSS: нужна видеокарта NVIDIA RTX",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_DLSS_DLL] = "DLSS: нет " DLSS_FILE,
|
||||
[UI_MENU_FSR3_SHARPNESS] = "Резкость FSR 3.1",
|
||||
[UI_MENU_FSR3_SHARPNESS_DESC] = "Повышение резкости 3D-сцены после FSR 3.1; 0 выключает его.",
|
||||
[UI_MENU_FSR_SHARPNESS] = "Резкость FSR",
|
||||
[UI_MENU_FSR_SHARPNESS_DESC] = "Повышение резкости 3D-сцены после AMD FSR 3.1 или FSR 4; 0 выключает его.",
|
||||
|
||||
[UI_MENU_FPS_LIMIT] = "Ограничение частоты кадров",
|
||||
[UI_MENU_FPS_LIMIT_DESC] = "Наибольшее число кадров в секунду. Выше 60 — экспериментальный режим, нужна «Скорость "
|
||||
@@ -1941,15 +1951,19 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_SCENE_UPSCALER_DESC] = "Um upscaler temporal para a cena 3D: bordas mais suaves e menos cintilação, e nos modos abaixo do "
|
||||
"Nativo ele desenha a cena menor e a amplia, o que poupa tempo da GPU. O NVIDIA DLSS "
|
||||
"precisa de uma GPU NVIDIA RTX e do " DLSS_FILE " ao lado do " EXE_FILE "; o AMD FSR "
|
||||
"3.1 roda em qualquer GPU. Desligado mantém a escala e o FXAA do próprio jogo. O HUD "
|
||||
"3.1 roda em qualquer GPU; o AMD FSR 4 (Windows) precisa de uma GPU Radeon para a qual a AMD o "
|
||||
"oferece e de " FFX_FILES " ao lado do " EXE_FILE ". Desligado mantém a escala e o FXAA do próprio jogo. O HUD "
|
||||
"não é afetado; o upscaler e a nitidez acima continuam ajustando a imagem do jogo à "
|
||||
"janela. Vale após reiniciar.",
|
||||
[UI_MENU_SCENE_UPSCALER_OFF] = "Desligado", [UI_MENU_SCENE_UPSCALER_DLSS] = "NVIDIA DLSS",
|
||||
[UI_MENU_SCENE_UPSCALER_FSR3] = "AMD FSR 3.1",
|
||||
[UI_MENU_SCENE_UPSCALER_FSR3] = "AMD FSR 3.1", [UI_MENU_SCENE_UPSCALER_FSR4] = "AMD FSR 4",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_GPU] = "FSR 4: não oferecido para esta GPU",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_DLL] = "FSR 4: faltam as bibliotecas FSR da AMD",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_OS] = "FSR 4: só no Windows",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_DLSS_GPU] = "DLSS: precisa de uma GPU NVIDIA RTX",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_DLSS_DLL] = "DLSS: falta o " DLSS_FILE,
|
||||
[UI_MENU_FSR3_SHARPNESS] = "Nitidez do FSR 3.1",
|
||||
[UI_MENU_FSR3_SHARPNESS_DESC] = "Aumento de nitidez da cena 3D após o FSR 3.1; 0 desliga.",
|
||||
[UI_MENU_FSR_SHARPNESS] = "Nitidez do FSR",
|
||||
[UI_MENU_FSR_SHARPNESS_DESC] = "Aumento de nitidez da cena 3D após o AMD FSR 3.1 ou FSR 4; 0 desliga.",
|
||||
[UI_MENU_TAB_CHEATS] = "Cheats",
|
||||
[UI_MENU_CHEATS_NONE] = "Nenhum cheat para esta versão do jogo. Os cheats de um mod são um arquivo de cheats do "
|
||||
"Atmosphere na pasta cheats dele, com o nome da build do jogo: mods\\<mod>\\cheats\\%s. "
|
||||
@@ -2697,14 +2711,18 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_SCENE_UPSCALER] = "3D 场景超分",
|
||||
[UI_MENU_SCENE_UPSCALER_DESC] = "用于 3D 场景的时间性超分:边缘更平滑,闪烁更少;低于“原生”的模式会以更小的尺寸绘制场景再放大,以节省 GPU "
|
||||
"时间。NVIDIA DLSS 需要 NVIDIA RTX 显卡,并将 " DLSS_FILE " 放在 " EXE_FILE " 旁;AMD "
|
||||
"FSR 3.1 可在任何显卡上运行。“关”保留游戏自己的缩放和 FXAA。HUD 不受影响;上方的缩放"
|
||||
"FSR 3.1 可在任何显卡上运行;AMD FSR 4(Windows)需要 AMD 为其提供 FSR 4 的 Radeon 显卡,并将 " FFX_FILES
|
||||
" 放在 " EXE_FILE " 旁。“关”保留游戏自己的缩放和 FXAA。HUD 不受影响;上方的缩放"
|
||||
"方式和锐度仍负责把游戏画面适配到窗口。重启后生效。",
|
||||
[UI_MENU_SCENE_UPSCALER_OFF] = "关", [UI_MENU_SCENE_UPSCALER_DLSS] = "NVIDIA DLSS",
|
||||
[UI_MENU_SCENE_UPSCALER_FSR3] = "AMD FSR 3.1",
|
||||
[UI_MENU_SCENE_UPSCALER_FSR3] = "AMD FSR 3.1", [UI_MENU_SCENE_UPSCALER_FSR4] = "AMD FSR 4",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_GPU] = "FSR 4:此显卡不提供",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_DLL] = "FSR 4:缺少 AMD 的 FSR 库",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_FSR4_OS] = "FSR 4:仅限 Windows",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_DLSS_GPU] = "DLSS:需要 NVIDIA RTX 显卡",
|
||||
[UI_MENU_SCENE_UPSCALER_NO_DLSS_DLL] = "DLSS:缺少 " DLSS_FILE,
|
||||
[UI_MENU_FSR3_SHARPNESS] = "FSR 3.1 锐度",
|
||||
[UI_MENU_FSR3_SHARPNESS_DESC] = "FSR 3.1 之后 3D 场景的锐化强度;0 为关闭。",
|
||||
[UI_MENU_FSR_SHARPNESS] = "FSR 锐度",
|
||||
[UI_MENU_FSR_SHARPNESS_DESC] = "AMD FSR 3.1 或 FSR 4 之后 3D 场景的锐化强度;0 为关闭。",
|
||||
[UI_MENU_TAB_CHEATS] = "金手指",
|
||||
[UI_MENU_CHEATS_NONE] = "此游戏版本没有金手指。模组的金手指是它的 cheats 文件夹中以游戏构建命名的 Atmosphere "
|
||||
"金手指文件:mods\\<模组>\\cheats\\%s。重启游戏后才会读取。对于修改游戏代码的金手指,"
|
||||
|
||||
+3
-2
@@ -65,8 +65,9 @@ typedef enum {
|
||||
UI_MENU_DLSS_CHARS_OFF, UI_MENU_DLSS_CHARS_LIGHT, UI_MENU_DLSS_CHARS_MEDIUM, UI_MENU_DLSS_CHARS_FULL, UI_MENU_FXAA, UI_MENU_FXAA_DESC,
|
||||
UI_MENU_REFLEX, UI_MENU_REFLEX_DESC, UI_MENU_REFLEX_OFF, UI_MENU_REFLEX_ON, UI_MENU_REFLEX_BOOST,
|
||||
UI_MENU_SCENE_UPSCALER, UI_MENU_SCENE_UPSCALER_DESC, UI_MENU_SCENE_UPSCALER_OFF, UI_MENU_SCENE_UPSCALER_DLSS,
|
||||
UI_MENU_SCENE_UPSCALER_FSR3, UI_MENU_SCENE_UPSCALER_NO_DLSS_GPU, UI_MENU_SCENE_UPSCALER_NO_DLSS_DLL, UI_MENU_FSR3_SHARPNESS,
|
||||
UI_MENU_FSR3_SHARPNESS_DESC,
|
||||
UI_MENU_SCENE_UPSCALER_FSR3, UI_MENU_SCENE_UPSCALER_NO_DLSS_GPU, UI_MENU_SCENE_UPSCALER_NO_DLSS_DLL, UI_MENU_FSR_SHARPNESS,
|
||||
UI_MENU_FSR_SHARPNESS_DESC, UI_MENU_SCENE_UPSCALER_FSR4, UI_MENU_SCENE_UPSCALER_NO_FSR4_GPU,
|
||||
UI_MENU_SCENE_UPSCALER_NO_FSR4_DLL, UI_MENU_SCENE_UPSCALER_NO_FSR4_OS,
|
||||
|
||||
// Game
|
||||
UI_MENU_FPS_LIMIT, UI_MENU_FPS_LIMIT_DESC, UI_MENU_FPS_30, UI_MENU_FPS_40, UI_MENU_FPS_45, UI_MENU_FPS_60, UI_MENU_FPS_90,
|
||||
|
||||
+16
-1
@@ -13,6 +13,7 @@
|
||||
#include "platform/platform.h"
|
||||
#include "vk_dlaa.h"
|
||||
#include "vk_fg.h"
|
||||
#include "vk_ffx.h"
|
||||
#include "vk_fsr3.h"
|
||||
|
||||
static VkCtx g_vk;
|
||||
@@ -287,6 +288,10 @@ typedef struct {
|
||||
VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR lr;
|
||||
VkPhysicalDeviceAddressBindingReportFeaturesEXT abr;
|
||||
VkPhysicalDevicePresentIdFeaturesKHR pid;
|
||||
VkPhysicalDeviceCooperativeMatrixFeaturesKHR coop; // FSR 4 (vk_ffx.c)
|
||||
#ifdef VK_EXT_SHADER_FLOAT8_EXTENSION_NAME
|
||||
VkPhysicalDeviceShaderFloat8FeaturesEXT f8; // FSR 4 (vk_ffx.c)
|
||||
#endif
|
||||
} FeatureChain;
|
||||
|
||||
static int create_device(void) {
|
||||
@@ -345,7 +350,16 @@ static int create_device(void) {
|
||||
CHAIN(fbl, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT);
|
||||
CHAIN(lr, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR);
|
||||
}
|
||||
vk_dlaa_device_exts(ep, ne, ext, &n_ext, 40); // NGX's; the twelve slots after it stay for the nine below
|
||||
vk_dlaa_device_exts(ep, ne, ext, &n_ext, 40); // NGX's or FSR 4's; the twelve slots after it stay for the nine below
|
||||
// FSR 4's shader extensions (vk_ffx_device_exts) are enabled with their features, as far as the driver reports them
|
||||
for (uint32_t i = 0; i < n_ext; i++) {
|
||||
if (!strcmp(ext[i], VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
|
||||
CHAIN(coop, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR);
|
||||
#ifdef VK_EXT_SHADER_FLOAT8_EXTENSION_NAME
|
||||
else if (!strcmp(ext[i], VK_EXT_SHADER_FLOAT8_EXTENSION_NAME))
|
||||
CHAIN(f8, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT8_FEATURES_EXT);
|
||||
#endif
|
||||
}
|
||||
if (has_ext(ep, ne, VK_EXT_MEMORY_BUDGET_EXTENSION_NAME)) { g_vk.has_memory_budget = 1; ext[n_ext++] = VK_EXT_MEMORY_BUDGET_EXTENSION_NAME; }
|
||||
// GPU timestamps on the CPU clock (vk_sync.c): the perf line splits GPU idle time into waiting for a submission or not.
|
||||
if (has_ext(ep, ne, VK_KHR_CALIBRATED_TIMESTAMPS_EXTENSION_NAME)) { g_vk.has_calibrated = 2; ext[n_ext++] = VK_KHR_CALIBRATED_TIMESTAMPS_EXTENSION_NAME; }
|
||||
@@ -492,6 +506,7 @@ static void destroy_all(void) {
|
||||
if (g_vk.device) vkDeviceWaitIdle(g_vk.device);
|
||||
if (g_vk.device) vk_fg_release();
|
||||
if (g_vk.device) fsr3_release();
|
||||
if (g_vk.device) vk_ffx_release();
|
||||
if (g_vk.device) vk_astc_release();
|
||||
if (g_vk.device) vk_deswz_release();
|
||||
if (g_vk.device) vk_crumbs_release();
|
||||
|
||||
+114
-49
@@ -11,6 +11,10 @@
|
||||
// layout with a set-then-get round trip before anything relies on it.
|
||||
//
|
||||
// Where DLAA runs in the frame, the jitter and the motion vectors: see the sections below.
|
||||
//
|
||||
// The scene upscaler (scene_upscaler) is DLSS, AMD FSR 3.1 (vk_fsr3.cpp, built from the FidelityFX SDK 1.1.4 sources)
|
||||
// or AMD FSR 4 (vk_ffx.c, AMD's FSR SDK 2.4 libraries, Windows): the arming, the jitter, the motion vectors and the
|
||||
// copy of the result below are shared, and only the call that upscales differs (evaluate, fsr_evaluate).
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -25,6 +29,7 @@
|
||||
#include "input.h"
|
||||
#include "nvn_api.h"
|
||||
#include "vk_exec.h"
|
||||
#include "vk_ffx.h"
|
||||
#include "vk_fg.h"
|
||||
#include "vk_fsr3.h"
|
||||
#include "vk_rec.h"
|
||||
@@ -105,25 +110,43 @@ static int p_getp(const NgxParam *p, const char *n, void **v) { return NGX_OK(((
|
||||
#endif
|
||||
|
||||
// The scene upscaler picked at start (scene_upscaler; without it dlaa = 1 is DLSS): a restart applies another. AMD FSR
|
||||
// 3.1 (vk_fsr3.cpp) takes the same inputs at the same point of the frame as DLSS and runs on any GPU.
|
||||
// 3.1 (vk_fsr3.cpp) and FSR 4 (vk_ffx.c) take the same inputs at the same point of the frame as DLSS; FSR 3.1 runs on
|
||||
// any GPU, FSR 4 on Windows where AMD's libraries offer it for the GPU (vk_ffx_init). AMD ships those libraries for
|
||||
// Windows only, so elsewhere fsr4 is off.
|
||||
int vk_upscaler_engine(void) {
|
||||
static int e = -1;
|
||||
if (e < 0) {
|
||||
const char *v = cfg_scene_upscaler();
|
||||
e = !strcmp(v, "dlss") ? UPSCALER_DLSS : !strcmp(v, "fsr3") ? UPSCALER_FSR3 : UPSCALER_OFF;
|
||||
e = !strcmp(v, "dlss") ? UPSCALER_DLSS : !strcmp(v, "fsr3") ? UPSCALER_FSR3
|
||||
: !strcmp(v, "fsr4") ? UPSCALER_FSR4 : UPSCALER_OFF;
|
||||
#ifndef _WIN32
|
||||
if (e == UPSCALER_FSR4) {
|
||||
rt_log("dlaa: scene_upscaler = fsr4 runs on Windows only (AMD's FSR SDK has no Linux libraries): off");
|
||||
e = UPSCALER_OFF;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
// The setting's name of an engine, and the name the log gives it.
|
||||
static const char *engine_value(int e) {
|
||||
return e == UPSCALER_DLSS ? "dlss" : e == UPSCALER_FSR3 ? "fsr3" : e == UPSCALER_FSR4 ? "fsr4" : "off";
|
||||
}
|
||||
static const char *engine_name(int e) {
|
||||
return e == UPSCALER_DLSS ? "DLSS" : e == UPSCALER_FSR3 ? "FSR 3.1" : e == UPSCALER_FSR4 ? "FSR 4" : "none";
|
||||
}
|
||||
|
||||
// The engine picked at start while the settings still name it (the menu turns it off at once, as dlaa did).
|
||||
int vk_upscaler_on(void) {
|
||||
int e = vk_upscaler_engine();
|
||||
return e && !strcmp(cfg_scene_upscaler(), e == UPSCALER_DLSS ? "dlss" : "fsr3");
|
||||
return e && !strcmp(cfg_scene_upscaler(), engine_value(e));
|
||||
}
|
||||
|
||||
// NGX is brought up only when DLSS is the scene upscaler at start: its device extensions can only be asked for at
|
||||
// device creation, and loading the driver's NGX core on every NVIDIA machine would cost start time and change the device
|
||||
// with DLSS off. So the choice applies after a restart; with DLSS not picked (off or FSR 3.1), nothing of NGX runs.
|
||||
// with DLSS off. So the choice applies after a restart; with DLSS not picked (off or FSR), nothing of NGX runs. FSR
|
||||
// 4's device extensions are chosen at device creation as well (vk_ffx_device_exts).
|
||||
int vk_dlaa_wanted(void) {
|
||||
static int wanted = -1;
|
||||
if (wanted < 0) wanted = vk_upscaler_engine() == UPSCALER_DLSS;
|
||||
@@ -182,6 +205,7 @@ void vk_dlaa_device_exts(const VkExtensionProperties *have, uint32_t nhave, cons
|
||||
uint32_t max) {
|
||||
unsigned ni = 0, nd = 0;
|
||||
const char **ie = NULL, **de = NULL;
|
||||
vk_ffx_device_exts(have, nhave, ext, n, max); // FSR 4's, when it is the engine
|
||||
if (!vk_dlaa_wanted() || !core_load() || !NGX_OK(N.req_ext(&ni, &ie, &nd, &de))) return;
|
||||
for (unsigned i = 0; i < nd; i++) {
|
||||
int ok = 0;
|
||||
@@ -210,12 +234,18 @@ static int vtable_ok(void) {
|
||||
}
|
||||
|
||||
// The upscaler's half of the per-object motion's gate (vk_objmv_wanted, below the frame state): DLSS once NGX came up
|
||||
// with it (vk_dlaa_available), FSR 3.1 whenever it is the scene upscaler picked at start. Latched in vk_dlaa_init,
|
||||
// before the first frame: with no upscaler, or DLSS without NGX, it stays 0 as vk_dlaa_available does.
|
||||
// with it (vk_dlaa_available), FSR 3.1 whenever it is the scene upscaler picked at start, FSR 4 once AMD's libraries
|
||||
// offered it for the device (vk_ffx_available). Latched in vk_dlaa_init, before the first frame: with no upscaler, or
|
||||
// one that did not come up, it stays 0.
|
||||
static int objmv;
|
||||
|
||||
void vk_dlaa_init(void) {
|
||||
objmv = vk_upscaler_engine() == UPSCALER_FSR3;
|
||||
if (vk_upscaler_engine() == UPSCALER_FSR4) {
|
||||
vk_ffx_init();
|
||||
objmv = vk_ffx_available();
|
||||
return;
|
||||
}
|
||||
if (!vk_dlaa_wanted() || !core_load()) return;
|
||||
// The executable's folder, where NGX looks for the DLSS model library and writes its logs.
|
||||
wchar_t wdir[PLAT_PATH_MAX];
|
||||
@@ -338,26 +368,38 @@ static struct {
|
||||
VkExecTarget hud_t, win; // the output-sized target the scene is scaled into; the window texture
|
||||
float cam_dr[2]; // the viewport depth range of the draw cam_addr was noted at
|
||||
int fg_mv_ok; // the frame's motion is in the motion image (fg_motion)
|
||||
int fsr; // the engine is AMD FSR 3.1 (scene_upscaler = fsr3 at start), else DLSS
|
||||
int fsr; // the AMD FSR engine (UPSCALER_FSR3 or UPSCALER_FSR4, picked at start), 0: DLSS
|
||||
} D = {.mv_ok = -1, .cfg_seen = ~0u};
|
||||
#define DLSS_SIZES (sizeof D.sizes / sizeof D.sizes[0])
|
||||
|
||||
const VkTexImage *vk_dlaa_swap_img;
|
||||
VkImageView vk_dlaa_swap_view;
|
||||
|
||||
// DLSS needs NGX and its model, FSR 3.1 runs on any GPU the back end runs on: on already says the engine is there.
|
||||
// DLSS needs NGX and its model, FSR 4 AMD's libraries with FSR 4 for the GPU, FSR 3.1 runs on any GPU the back end
|
||||
// runs on: on already says the engine is there (vk_dlaa_frame).
|
||||
static int dl_active(void) { return !D.failed && D.on; }
|
||||
// The scene is followed (its G-buffer, light target, end and camera): for DLSS, or with DLSS off for frame generation.
|
||||
static int track(void) { return dl_active() || D.fg; }
|
||||
int vk_dlaa_fg_on; // D.fg for vk_exec_draw.c's per-draw test (vk_dlaa_hud)
|
||||
|
||||
int vk_upscaler_running(void) {
|
||||
return dl_active() && D.evals ? (D.fsr ? UPSCALER_FSR3 : UPSCALER_DLSS) : UPSCALER_OFF;
|
||||
return dl_active() && D.evals ? (D.fsr ? D.fsr : UPSCALER_DLSS) : UPSCALER_OFF;
|
||||
}
|
||||
|
||||
// For the menu. DLSS: after a start with it picked, what NGX said; before, an NVIDIA GPU and the DLL (an NVIDIA GPU
|
||||
// without RTX shows only once NGX came up). FSR 3.1 is built in.
|
||||
// without RTX shows only once NGX came up). FSR 4 likewise: Windows, AMD's two libraries, then after a start with it
|
||||
// picked what they offered for the device (vk_ffx_init), before one an AMD GPU (the libraries decide which Radeons get
|
||||
// FSR 4, so another Radeon shows only after that start). FSR 3.1 is built in.
|
||||
int vk_upscaler_missing(int engine) {
|
||||
if (engine == UPSCALER_FSR4) {
|
||||
#ifndef _WIN32
|
||||
return UPSCALER_MISSING_OS;
|
||||
#else
|
||||
if (!res_ffx_dlls()) return UPSCALER_MISSING_DLL;
|
||||
if (vk_ffx_tried()) return vk_ffx_available() ? 0 : UPSCALER_MISSING_GPU;
|
||||
return vk_ctx()->props.vendorID == 0x1002 ? 0 : UPSCALER_MISSING_GPU;
|
||||
#endif
|
||||
}
|
||||
if (engine != UPSCALER_DLSS) return 0;
|
||||
if (!res_dlss_dll()) return UPSCALER_MISSING_DLL;
|
||||
if (N.tried) return N.available ? 0 : UPSCALER_MISSING_GPU;
|
||||
@@ -377,7 +419,8 @@ static int fg_objects(void) {
|
||||
int vk_fg_objects_on(void) { return D.fg && fg_objects(); }
|
||||
|
||||
// The per-object motion's gates (vk_mvprev.c's tables, vk_usnap.c's host copy, vk_exec_draw.c's motion draws and
|
||||
// lock): the upscaler that reads the motion image (objmv: DLSS once NGX came up, or FSR 3.1 picked at start), or frame
|
||||
// lock): the upscaler that reads the motion image (objmv: DLSS once NGX came up, FSR 3.1 picked at start, or FSR 4
|
||||
// once it came up), or frame
|
||||
// generation following the scene with its objects. Frame generation is off with either upscaler, so the second term is
|
||||
// 0 whenever one runs.
|
||||
int vk_objmv_wanted(void) { return objmv || vk_fg_objects_on(); }
|
||||
@@ -1303,18 +1346,18 @@ static int scene_shaped(const VkExecTarget *c) {
|
||||
return a * 20 >= b * 19 && b * 20 >= a * 19;
|
||||
}
|
||||
|
||||
// FSR 3.1's half of evaluate (vk_fsr3.cpp), after the motion vectors and the recorder's drain: the camera, the time step
|
||||
// and the history reset, then the dispatch into e->out. 0 when it failed (DLAA is then off for the run). The camera
|
||||
// comes from the scene camera block's rows 0-10 (vk_fg.cpp vk_fg_camera, which frame generation reads too: FSR 3.1
|
||||
// wants the near and far planes and the vertical field of view for its depth tests); a cut there (a cutscene's camera
|
||||
// jump) starts a new history. The block's bytes are the snapshot's host copy, which vk_usnap.c keeps while the
|
||||
// per-object motion runs (vk_objmv_wanted, so with FSR 3.1).
|
||||
// FSR's half of evaluate (FSR 3.1: vk_fsr3.cpp, FSR 4: vk_ffx.c), after the motion vectors and the recorder's drain:
|
||||
// the camera, the time step and the history reset, then the dispatch into e->out. Both engines get the same inputs.
|
||||
// 0 when it failed (DLAA is then off for the run). The camera comes from the scene camera block's rows 0-10 (vk_fg.cpp
|
||||
// vk_fg_camera, which frame generation reads too: FSR wants the near and far planes and the vertical field of view
|
||||
// for its depth tests); a cut there (a cutscene's camera jump) starts a new history. The block's bytes are the
|
||||
// snapshot's host copy, which vk_usnap.c keeps while the per-object motion runs (vk_objmv_wanted, so with FSR).
|
||||
static int fsr_evaluate(VkExec *ex, struct Size *e, const VkExecTarget *t, const VkExecTarget *z, uint32_t ow,
|
||||
uint32_t oh, float jx, float jy, int timed) {
|
||||
static VkFgScene cam = {.near_m = 0.1f, .far_m = 25000.0f, .fov_y = 0.8727f}; // until the first camera read
|
||||
// the SDK takes whole images: the scene's targets are level 0, layer 0 of their own images
|
||||
if (t->level || t->base_layer || z->level || z->base_layer || z->format != VK_FORMAT_D32_SFLOAT)
|
||||
return dl_fail("FSR 3.1 input (not level 0, layer 0 of a colour and a D32F depth image)", 0), 0;
|
||||
return dl_fail("FSR input (not level 0, layer 0 of a colour and a D32F depth image)", 0), 0;
|
||||
const float *rows = D.cam_addr ? (const float *)vk_usnap_bytes(D.cam_addr, 11 * 16) : NULL;
|
||||
int cut = rows && vk_fg_camera(rows, nvn_depth_minus_w(), D.cam_dr, &cam);
|
||||
if (D.last_color != t->image) D.reset = 1, D.why[2]++, D.last_color = t->image;
|
||||
@@ -1326,19 +1369,31 @@ static int fsr_evaluate(VkExec *ex, struct Size *e, const VkExecTarget *t, const
|
||||
// without (vk_dlaa_skip_draw), so without it FSR's picture is softer than the game's own
|
||||
int sharp = cfg_int("TOTK_FSR_SHARPNESS");
|
||||
sharp = sharp < 0 ? 0 : sharp > 100 ? 100 : sharp;
|
||||
Fsr3Frame fr = {.color = t->image, .color_format = t->format, .depth = z->image, .mv = e->mv, .out = e->out,
|
||||
.w = t->width, .h = t->height, .ow = ow, .oh = oh, .jx = jx, .jy = jy, .near_m = cam.near_m,
|
||||
.far_m = cam.infinite || cam.far_m <= cam.near_m ? 1e5f : cam.far_m, .fov_y = cam.fov_y,
|
||||
.dt_ms = dt > 0 && dt < 100 ? (float)dt : 16.67f, .reset = D.reset, .sharpness = sharp / 100.0f,
|
||||
.fence = ex->fence};
|
||||
float far_m = cam.infinite || cam.far_m <= cam.near_m ? 1e5f : cam.far_m;
|
||||
float dt_ms = dt > 0 && dt < 100 ? (float)dt : 16.67f;
|
||||
uint64_t c0 = timed ? kern_now_ns() : 0;
|
||||
int ok = fsr3_dispatch(ex->cb, &fr);
|
||||
int ok;
|
||||
if (D.fsr == UPSCALER_FSR4) {
|
||||
VkFfxDispatch fd = {.color = {t->image, t->format, t->width, t->height},
|
||||
.depth = {z->image, z->format, t->width, t->height},
|
||||
.mv = {e->mv, VK_FORMAT_R16G16_SFLOAT, t->width, t->height},
|
||||
.out = {e->out, VK_FORMAT_R16G16B16A16_SFLOAT, ow, oh}, .jx = jx, .jy = jy,
|
||||
.dt_ms = dt_ms, .cam_near = cam.near_m, .cam_far = far_m, .fov_y = cam.fov_y,
|
||||
.sharpness = sharp / 100.0f, .reset = D.reset, .fence = ex->fence};
|
||||
ok = vk_ffx_dispatch(ex->cb, &fd);
|
||||
} else {
|
||||
Fsr3Frame fr = {.color = t->image, .color_format = t->format, .depth = z->image, .mv = e->mv, .out = e->out,
|
||||
.w = t->width, .h = t->height, .ow = ow, .oh = oh, .jx = jx, .jy = jy, .near_m = cam.near_m,
|
||||
.far_m = far_m, .fov_y = cam.fov_y, .dt_ms = dt_ms, .reset = D.reset,
|
||||
.sharpness = sharp / 100.0f, .fence = ex->fence};
|
||||
ok = fsr3_dispatch(ex->cb, &fr);
|
||||
}
|
||||
if (timed) T.cpu_ngx += kern_now_ns() - c0;
|
||||
if (!ok) {
|
||||
// the SDK may have bound a pipeline or descriptor sets of its own before it failed: the next draw binds
|
||||
// everything again, and the game's own scaling and FXAA run from the next frame (DLAA off for the run)
|
||||
vk_exec_draw_new_cb(ex);
|
||||
return dl_fail("FSR 3.1 dispatch", 0), 0;
|
||||
return dl_fail(D.fsr == UPSCALER_FSR4 ? "FSR 4 dispatch" : "FSR 3.1 dispatch", 0), 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -1487,7 +1542,7 @@ engine_done:
|
||||
rt_log("dlaa: %llu frames anti-aliased%s (scene %ux%u, output %ux%u; %llu before the effects, %llu frames without the "
|
||||
"DLAA point, %llu with camera motion, %llu with the characters' mask, %llu without a camera, %llu jitter "
|
||||
"holds; resets: %llu size, %llu camera, %llu target; reactive mask %llu, without its copy %llu)",
|
||||
(unsigned long long)D.evals, D.fsr ? " by FSR 3.1" : "", w, h, ow, oh, (unsigned long long)D.fx_frames, (unsigned long long)D.frames_missed,
|
||||
(unsigned long long)D.evals, D.fsr == UPSCALER_FSR4 ? " by FSR 4" : D.fsr ? " by FSR 3.1" : "", w, h, ow, oh, (unsigned long long)D.fx_frames, (unsigned long long)D.frames_missed,
|
||||
(unsigned long long)D.mv_frames, (unsigned long long)D.masked, (unsigned long long)D.mv_none,
|
||||
(unsigned long long)D.holds, (unsigned long long)D.why[0], (unsigned long long)D.why[1],
|
||||
(unsigned long long)D.why[2], (unsigned long long)R.made, (unsigned long long)R.missed);
|
||||
@@ -1832,9 +1887,9 @@ void vk_dlaa_pass(VkExec *ex) {
|
||||
}
|
||||
|
||||
// TOTK_DLSS, read at each present (the menu switches it live): the scene size of the mode (resolution.c) and the
|
||||
// texture bias that goes with it while the upscaler runs. DLSS takes NVIDIA's log2(scene / output); FSR 3.1 takes AMD's
|
||||
// log2(scene / output) - 1 (FidelityFX FSR 3 upscaler docs, "Mipmap biasing"), so -1 also in place. The bias follows
|
||||
// the mode and the upscaler going on or off; the engine is fixed for the run.
|
||||
// texture bias that goes with it while the upscaler runs. DLSS takes NVIDIA's log2(scene / output); FSR 3.1 and FSR 4
|
||||
// take AMD's log2(scene / output) - 1 (FidelityFX FSR 3 upscaler docs, "Mipmap biasing"), so -1 also in place. The
|
||||
// bias follows the mode and the upscaler going on or off; the engine is fixed for the run.
|
||||
static void dlss_mode(void) {
|
||||
static char mode[32];
|
||||
static float bias; // what the material samplers have (vk_texture.c starts at 0)
|
||||
@@ -1844,7 +1899,8 @@ static void dlss_mode(void) {
|
||||
res_dlss_mode(m);
|
||||
}
|
||||
float b = 0.0f;
|
||||
if (dl_active()) b = res_dlss_lod_bias() - (vk_upscaler_engine() == UPSCALER_FSR3 ? 1.0f : 0.0f);
|
||||
int e = vk_upscaler_engine();
|
||||
if (dl_active()) b = res_dlss_lod_bias() - (e == UPSCALER_FSR3 || e == UPSCALER_FSR4 ? 1.0f : 0.0f);
|
||||
if (b != bias) bias = b, vk_sampler_dlss_bias(b);
|
||||
}
|
||||
|
||||
@@ -1870,17 +1926,24 @@ void vk_dlaa_frame(void) {
|
||||
vk_dlaa_swap_img = NULL, vk_dlaa_swap_view = VK_NULL_HANDLE;
|
||||
dlss_mode();
|
||||
preset_check();
|
||||
int fsr = vk_upscaler_engine() == UPSCALER_FSR3; // fixed for the run: D.fsr never changes while on
|
||||
int on = (fsr || N.available) && vk_upscaler_on();
|
||||
// the engine is fixed for the run: D.fsr never changes while on. FSR 4 runs once AMD's libraries offered it for
|
||||
// the device (vk_ffx_init said why not otherwise, and the upscaler stays off)
|
||||
int e = vk_upscaler_engine();
|
||||
int fsr = e == UPSCALER_FSR3 || e == UPSCALER_FSR4 ? e : 0;
|
||||
int ready = e == UPSCALER_FSR3 || (e == UPSCALER_FSR4 ? vk_ffx_available() : N.available);
|
||||
int on = ready && vk_upscaler_on();
|
||||
vk_fg_frame();
|
||||
// frame generation with an upscaler is not built yet: with FSR 3.1 picked it stays off (said once)
|
||||
// frame generation with an upscaler is not built yet: with FSR picked it stays off (said once)
|
||||
static int fg_said;
|
||||
if (fsr && on && vk_fg_engine() != VK_FG_OFF && !fg_said++)
|
||||
rt_log("fg: frame generation off while FSR 3.1 upscales the scene (scene_upscaler = fsr3)");
|
||||
rt_log("fg: frame generation off while %s upscales the scene (scene_upscaler = %s)", engine_name(fsr),
|
||||
engine_value(fsr));
|
||||
int fg = fsr && on ? 0 : vk_fg_wanted(on && !D.failed);
|
||||
D.bloom = D.hud = D.hud_wait = D.fin = D.gen = D.fg_mv_ok = 0;
|
||||
if (on != D.on || fg != D.fg) {
|
||||
if (on != D.on) rt_log("dlaa: %s", on ? (fsr ? "on with FSR 3.1" : "on") : "off");
|
||||
if (on != D.on)
|
||||
rt_log("dlaa: %s%s%s", on ? "on" : "off", on && fsr ? " with " : "",
|
||||
on && fsr == UPSCALER_FSR4 ? vk_ffx_version() : on && fsr ? "FSR 3.1" : "");
|
||||
if (fg != D.fg) rt_log("dlaa: the scene is %s for frame generation", fg ? "followed" : "no longer followed");
|
||||
D.on = on, D.fg = vk_dlaa_fg_on = fg, D.fsr = fsr;
|
||||
// either way the next DLAA frame starts a new history from an unjittered frame
|
||||
@@ -1922,10 +1985,12 @@ void vk_dlaa_frame(void) {
|
||||
// stretched over the whole screen.
|
||||
static const uint64_t FXAA_FS[] = {0xf450003ebeb3dc52ull, 0x0a12f4bc2a9a4fbeull, 0x5c43ae18948d52cbull,
|
||||
0xaad42238801d31d8ull, 0xde20aef90fea4ce6ull, 0x755964e8dce7f34dull};
|
||||
// The fragment shader of the FXAA's first pass, the copy of the scene target into the scratch target (this build's
|
||||
// translator, seen in 1.4.3 frame logs; another hash leaves the draw alone). See vk_dlaa_skip_draw for why FSR 3.1's
|
||||
// frames skip it where it copies the scene target onto itself.
|
||||
static const uint64_t FXAA_COPY_FS[] = {0xa0fd34391f2af811ull};
|
||||
// The fragment shader of the FXAA's first pass, the copy of the scene target into the scratch target (another hash
|
||||
// leaves the draw alone): this build's translator, seen in 1.4.3 frame logs, and the one with patch 0017, whose two
|
||||
// support buffer fields change every fragment shader's hash (as with FXAA_FS above), read by codexx-dev from a 1.4.3
|
||||
// run with FSR on (pull request #1245). See vk_dlaa_skip_draw for why FSR's frames skip it where it copies the scene
|
||||
// target onto itself.
|
||||
static const uint64_t FXAA_COPY_FS[] = {0xa0fd34391f2af811ull, 0x9d065204aac9766bull};
|
||||
|
||||
// Chunks of one submission look shaders up side by side: an entry's hash is stored before its shader, and entries are
|
||||
// added under the lock.
|
||||
@@ -1970,14 +2035,14 @@ int vk_dlaa_skip_draw(VkExec *ex, const GfxShader *fs) {
|
||||
"FXAA_FS): the FXAA stays on", (unsigned long long)fx_off_frames);
|
||||
}
|
||||
}
|
||||
// FSR 3.1 in place (the scene as large as the output, so no scaling draw follows) goes without the game's FXAA
|
||||
// and its copy of the scene target onto itself on every frame, as codexx-dev found for FSR (pull request #1245,
|
||||
// vk_dlaa.c vk_dlaa_skip_draw there). Measured there on 1.4.3 at a 2560x1440 scene and output: with the upscaler on
|
||||
// the game ran its FXAA, which also sharpens, on 17 frames in every 96 and on the others drew its copy shader from
|
||||
// the scene target onto itself, so the picture went soft and sharp in turns. Here the dynamic resolution stays at
|
||||
// 100 % while FSR 3.1 runs (resolution.c res_dynres_live) and FSR sharpens its own output (fsr_sharpness,
|
||||
// fsr_evaluate) in place of the FXAA's sharpening. Scaled frames (D.up) need nothing more: there FSR's picture
|
||||
// already replaces the scaling FXAA draw below.
|
||||
// FSR 3.1 or FSR 4 in place (the scene as large as the output, so no scaling draw follows) goes without the game's
|
||||
// FXAA and its copy of the scene target onto itself on every frame, as codexx-dev found for FSR (pull request
|
||||
// #1245, vk_dlaa.c vk_dlaa_skip_draw there). Measured there on 1.4.3 at a 2560x1440 scene and output: with the
|
||||
// upscaler on the game ran its FXAA, which also sharpens, on 17 frames in every 96 and on the others drew its copy
|
||||
// shader from the scene target onto itself, so the picture went soft and sharp in turns. Here the dynamic
|
||||
// resolution stays at 100 % while FSR runs (resolution.c res_dynres_live) and FSR sharpens its own output
|
||||
// (fsr_sharpness, fsr_evaluate) in place of the FXAA's sharpening. Scaled frames (D.up) need nothing more: there
|
||||
// FSR's picture already replaces the scaling FXAA draw below.
|
||||
int fsr_in_place = D.done && !D.up && D.fsr;
|
||||
if (fxaa && !D.up && !fsr_in_place) return 0; // nothing to skip: no shader lookup per draw at the defaults
|
||||
if (!fs) return 0;
|
||||
@@ -2003,7 +2068,7 @@ int vk_dlaa_skip_draw(VkExec *ex, const GfxShader *fs) {
|
||||
static int logged_fxaa, logged_copy;
|
||||
if (known && ex->depth.image) {
|
||||
if (!logged_fxaa)
|
||||
logged_fxaa = 1, rt_log("dlaa: FSR 3.1 skips the game's FXAA (fragment shader %016llx) and sharpens its "
|
||||
logged_fxaa = 1, rt_log("dlaa: FSR skips the game's FXAA (fragment shader %016llx) and sharpens its "
|
||||
"own picture (fsr_sharpness)", (unsigned long long)h);
|
||||
return 1;
|
||||
}
|
||||
@@ -2011,7 +2076,7 @@ int vk_dlaa_skip_draw(VkExec *ex, const GfxShader *fs) {
|
||||
for (size_t i = 0; i < sizeof FXAA_COPY_FS / sizeof FXAA_COPY_FS[0]; i++) copy |= h == FXAA_COPY_FS[i];
|
||||
if (copy && ex->color[0].image == D.color.image && vk_exec_draw_samples(ex, fs, D.color.img)) {
|
||||
if (!logged_copy)
|
||||
logged_copy = 1, rt_log("dlaa: FSR 3.1 skips the game's copy of the scene target onto itself (fragment "
|
||||
logged_copy = 1, rt_log("dlaa: FSR skips the game's copy of the scene target onto itself (fragment "
|
||||
"shader %016llx)", (unsigned long long)h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
+6
-5
@@ -1,5 +1,5 @@
|
||||
// DLAA (vk_dlaa.c): the scene upscaler, NVIDIA DLSS or AMD FSR 3.1 (vk_fsr3.cpp), behind scene_upscaler (dlaa = 1 without
|
||||
// it: DLSS).
|
||||
// DLAA (vk_dlaa.c): the scene upscaler, NVIDIA DLSS, AMD FSR 3.1 (vk_fsr3.cpp) or AMD FSR 4 (vk_ffx.c, Windows), behind
|
||||
// scene_upscaler (dlaa = 1 without it: DLSS).
|
||||
#pragma once
|
||||
#include "vk.h"
|
||||
|
||||
@@ -15,9 +15,10 @@ void vk_dlaa_device_exts(const VkExtensionProperties *have, uint32_t nhave, cons
|
||||
void vk_dlaa_init(void);
|
||||
// 1 when dlaa is on and NGX came up with DLSS (after vk_dlaa_init): a DLSS mode's smaller scene is scaled up by DLSS.
|
||||
int vk_dlaa_available(void);
|
||||
// 1 when the per-object motion runs (DLSS's and FSR 3.1's half after vk_dlaa_init, frame generation's live): DLSS
|
||||
// with NGX up (vk_dlaa_available), FSR 3.1 picked as the scene upscaler, or frame generation following the scene with
|
||||
// its objects (vk_fg_objects_on: TOTK_FG_OBJECTS, default 1).
|
||||
// 1 when the per-object motion runs (the upscaler's half after vk_dlaa_init, frame generation's live): DLSS with NGX
|
||||
// up (vk_dlaa_available), FSR 3.1 picked as the scene upscaler, FSR 4 picked and offered for the device
|
||||
// (vk_ffx_available), or frame generation following the scene with its objects (vk_fg_objects_on: TOTK_FG_OBJECTS,
|
||||
// default 1).
|
||||
int vk_objmv_wanted(void);
|
||||
int vk_fg_objects_on(void);
|
||||
// vk_exec.c vk_exec_pass_begin, once the pass's targets are resolved and before its barrier: arms the frame on the
|
||||
|
||||
@@ -0,0 +1,296 @@
|
||||
// AMD FSR 4 for the scene upscaler (vk_ffx.h). The FSR SDK 2.4 ships its Vulkan effects as signed DLLs behind a
|
||||
// loader: amd_fidelityfx_loader_vk.dll exports the ffx-api entry points and finds the effect DLL
|
||||
// (amd_fidelityfx_upscaler_vk.dll) next to itself. Both are loaded from the executable's folder at run time; no SDK
|
||||
// code is compiled in, only the descriptor layouts of ffx_api_min.h.
|
||||
//
|
||||
// The upscaler DLL offers several versions (FSR 4.x, FSR 3.1.x) and decides by itself which ones a device can run:
|
||||
// vk_ffx_init lists them and pins the newest 4.x. A device the DLL offers no FSR 4 for runs without the upscaler (the
|
||||
// log and the menu say so): FSR 3.1 is scene_upscaler = fsr3, built from the SDK 1.1.4 sources (vk_fsr3.cpp), not a
|
||||
// fallback of this DLL. Every context is created with the pinned version (ffxOverrideVersion).
|
||||
//
|
||||
// What FSR 4 gets is what FSR 3.1 gets (vk_dlaa.c fsr_evaluate): the R11G11B10F light target as linear HDR colour, the
|
||||
// D32F scene depth (standard direction, the far plane finite), motion vectors at the render size in render pixels
|
||||
// pointing from this frame's position to last frame's without the jitter (motionVectorScale 1), the jitter the scene
|
||||
// was drawn with, the camera's planes and field of view. That is FSR's own convention: its guide derives the
|
||||
// projection offset as (2 jx / w, -2 jy / h), which moves the picture by (jx, jy) window pixels with y down, the way
|
||||
// vk_dlaa_viewport moves the viewport. The exposure is FSR's own (AUTO_EXPOSURE), as codexx-dev's pull request #1245
|
||||
// ran it on an RX 9070 XT.
|
||||
#include "vk_ffx.h"
|
||||
|
||||
#include "cfg.h"
|
||||
#include "host.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
int vk_ffx_wanted(void) { return 0; }
|
||||
void vk_ffx_device_exts(const VkExtensionProperties *have, uint32_t nhave, const char **ext, uint32_t *n, uint32_t max) {
|
||||
(void)have, (void)nhave, (void)ext, (void)n, (void)max;
|
||||
}
|
||||
void vk_ffx_init(void) {}
|
||||
int vk_ffx_tried(void) { return 0; }
|
||||
int vk_ffx_available(void) { return 0; }
|
||||
int vk_ffx_dispatch(VkCommandBuffer cb, const VkFfxDispatch *d) { return (void)cb, (void)d, 0; }
|
||||
void vk_ffx_release(void) {}
|
||||
const char *vk_ffx_version(void) { return ""; }
|
||||
#else
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ffx_api_min.h"
|
||||
|
||||
#define FFX_LOADER L"amd_fidelityfx_loader_vk.dll"
|
||||
#define FFX_MAX_VERSIONS 16
|
||||
// The SDK's Vulkan backend writes a dispatch's descriptor sets and constants into rings this deep and frees the views
|
||||
// of the dispatch that many back without knowing the GPU (FFX_MAX_QUEUED_FRAMES in the SDK's ffx_types.h, as
|
||||
// vk_fsr3.cpp wait_ring reads it for SDK 1.1.4).
|
||||
#define FFX_QUEUED 4
|
||||
|
||||
static struct {
|
||||
HMODULE dll;
|
||||
PfnFfxCreateContext create;
|
||||
PfnFfxDestroyContext destroy;
|
||||
PfnFfxQuery query;
|
||||
PfnFfxDispatch dispatch;
|
||||
int tried, loaded, available, failed;
|
||||
VkDeviceContext dev;
|
||||
uint64_t version_id;
|
||||
char version[48];
|
||||
ffxContext ctx; // the live context, made for ow x oh
|
||||
uint32_t ow, oh;
|
||||
uint64_t ring[FFX_QUEUED], n, waits; // the fences of the last dispatches (wait_ring)
|
||||
} F;
|
||||
|
||||
int vk_ffx_wanted(void) { return vk_upscaler_engine() == UPSCALER_FSR4; }
|
||||
|
||||
static int loader_load(void) {
|
||||
if (F.tried) return F.loaded;
|
||||
F.tried = 1;
|
||||
wchar_t path[MAX_PATH + 64];
|
||||
DWORD len = GetModuleFileNameW(NULL, path, MAX_PATH);
|
||||
while (len && path[len - 1] != L'\\') len--;
|
||||
path[len] = 0;
|
||||
wcscat(path, FFX_LOADER);
|
||||
// LOAD_WITH_ALTERED_SEARCH_PATH: the loader's own imports and the effect DLL resolve from the executable's folder
|
||||
F.dll = LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
if (!F.dll) {
|
||||
rt_log("fsr4: cannot load amd_fidelityfx_loader_vk.dll next to totk.exe (error %lu): the scene upscaler is off",
|
||||
GetLastError());
|
||||
return 0;
|
||||
}
|
||||
F.create = (PfnFfxCreateContext)(void *)GetProcAddress(F.dll, "ffxCreateContext");
|
||||
F.destroy = (PfnFfxDestroyContext)(void *)GetProcAddress(F.dll, "ffxDestroyContext");
|
||||
F.query = (PfnFfxQuery)(void *)GetProcAddress(F.dll, "ffxQuery");
|
||||
F.dispatch = (PfnFfxDispatch)(void *)GetProcAddress(F.dll, "ffxDispatch");
|
||||
if (!F.create || !F.destroy || !F.query || !F.dispatch) {
|
||||
rt_log("fsr4: amd_fidelityfx_loader_vk.dll lacks the ffx-api entry points: the scene upscaler is off");
|
||||
return 0;
|
||||
}
|
||||
return F.loaded = 1;
|
||||
}
|
||||
|
||||
static int has(const VkExtensionProperties *have, uint32_t nhave, const char *name) {
|
||||
for (uint32_t i = 0; i < nhave; i++)
|
||||
if (!strcmp(have[i].extensionName, name)) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void add(const VkExtensionProperties *have, uint32_t nhave, const char **ext, uint32_t *n, uint32_t max,
|
||||
const char *name) {
|
||||
for (uint32_t i = 0; i < *n; i++)
|
||||
if (!strcmp(ext[i], name)) return;
|
||||
if (has(have, nhave, name) && *n < max) ext[(*n)++] = name;
|
||||
}
|
||||
|
||||
// The extensions the FSR SDK's own sample enables for its effects (Cauldron2 device_vk.cpp): cooperative matrix and
|
||||
// 8-bit floats for FSR 4's network where the device has them. The rest it uses (16-bit floats and storage, integer
|
||||
// dot products, subgroup size control) is core Vulkan 1.3, which vk_device.c enables as far as the driver reports it.
|
||||
void vk_ffx_device_exts(const VkExtensionProperties *have, uint32_t nhave, const char **ext, uint32_t *n, uint32_t max) {
|
||||
if (!vk_ffx_wanted()) return;
|
||||
add(have, nhave, ext, n, max, VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME);
|
||||
#ifdef VK_EXT_SHADER_FLOAT8_EXTENSION_NAME
|
||||
add(have, nhave, ext, n, max, VK_EXT_SHADER_FLOAT8_EXTENSION_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
void vk_ffx_init(void) {
|
||||
if (!vk_ffx_wanted() || !loader_load()) return;
|
||||
const VkCtx *c = vk_ctx();
|
||||
F.dev = (VkDeviceContext){c->device, c->phys, vkGetDeviceProcAddr};
|
||||
uint64_t count = FFX_MAX_VERSIONS, ids[FFX_MAX_VERSIONS] = {0};
|
||||
const char *names[FFX_MAX_VERSIONS] = {0};
|
||||
struct ffxQueryDescGetVersions q = {.header = {FFX_API_QUERY_DESC_TYPE_GET_VERSIONS, NULL},
|
||||
.createDescType = FFX_API_CREATE_CONTEXT_DESC_TYPE_UPSCALE, .device = &F.dev,
|
||||
.outputCount = &count, .versionIds = ids, .versionNames = names};
|
||||
ffxReturnCode_t r = F.query(NULL, &q.header);
|
||||
if (r != FFX_API_RETURN_OK || !count) {
|
||||
rt_log("fsr4: no upscaler for this device (query %u, %llu versions; is amd_fidelityfx_upscaler_vk.dll next to "
|
||||
"totk.exe?): the scene upscaler is off", (unsigned)r, (unsigned long long)count);
|
||||
return;
|
||||
}
|
||||
if (count > FFX_MAX_VERSIONS) count = FFX_MAX_VERSIONS;
|
||||
char list[256] = "";
|
||||
// The newest 4.x the DLL offers for this device; the DLL leaves FSR 4 out for GPUs it does not run on
|
||||
int best = -1, best_minor = 0, best_patch = 0;
|
||||
for (uint64_t i = 0; i < count; i++) {
|
||||
const char *nm = names[i] ? names[i] : "?";
|
||||
size_t used = strlen(list);
|
||||
snprintf(list + used, sizeof list - used, "%s%s", i ? ", " : "", nm);
|
||||
int ma = 0, mi = 0, pa = 0;
|
||||
if (sscanf(nm, "%d.%d.%d", &ma, &mi, &pa) < 1 || ma != 4) continue;
|
||||
if (best < 0 || mi > best_minor || (mi == best_minor && pa > best_patch))
|
||||
best = (int)i, best_minor = mi, best_patch = pa;
|
||||
}
|
||||
if (best < 0) {
|
||||
rt_log("fsr4: the FSR libraries offer %s for this device, no FSR 4: the scene upscaler is off", list);
|
||||
return;
|
||||
}
|
||||
F.version_id = ids[best];
|
||||
snprintf(F.version, sizeof F.version, "FSR %s", names[best]);
|
||||
F.available = 1;
|
||||
rt_log("fsr4: upscaler versions for this device: %s; using %s", list, F.version);
|
||||
}
|
||||
|
||||
int vk_ffx_tried(void) { return F.tried; }
|
||||
|
||||
int vk_ffx_available(void) { return vk_ffx_wanted() && F.available; }
|
||||
|
||||
const char *vk_ffx_version(void) { return F.available ? F.version : ""; }
|
||||
|
||||
// Messages from the upscaler (errors and warnings), in UTF-16; into the log as UTF-8.
|
||||
static void on_message(uint32_t type, const wchar_t *msg) {
|
||||
char s[512];
|
||||
if (!msg || !WideCharToMultiByte(CP_UTF8, 0, msg, -1, s, (int)sizeof s, NULL, NULL)) return;
|
||||
rt_log("fsr4: %s: %s", type == FFX_API_MESSAGE_TYPE_ERROR ? "error" : "warning", s);
|
||||
}
|
||||
|
||||
// The context for an ow x oh output, any scene up to that size (DYNAMIC_RESOLUTION: the modes and the game's tiers
|
||||
// change the scene without a new context), as vk_fsr3.cpp create makes FSR 3.1's.
|
||||
static int create(uint32_t ow, uint32_t oh) {
|
||||
struct ffxOverrideVersion ov = {.header = {FFX_API_DESC_TYPE_OVERRIDE_VERSION, NULL}, .versionId = F.version_id};
|
||||
struct ffxCreateContextDescUpscaleVersion ver = {
|
||||
.header = {FFX_API_CREATE_CONTEXT_DESC_TYPE_UPSCALE_VERSION, &ov.header}, .version = FFX_UPSCALER_VERSION};
|
||||
struct ffxCreateBackendVKDesc be = {.header = {FFX_API_CREATE_CONTEXT_DESC_TYPE_BACKEND_VK, &ver.header},
|
||||
.deviceContext = F.dev};
|
||||
// Linear HDR scene light with the upscaler's own exposure; standard depth with a finite far plane, as FSR 3.1's
|
||||
uint32_t flags = FFX_UPSCALE_ENABLE_HIGH_DYNAMIC_RANGE | FFX_UPSCALE_ENABLE_AUTO_EXPOSURE |
|
||||
FFX_UPSCALE_ENABLE_DYNAMIC_RESOLUTION;
|
||||
if (rt_knob("FSR4_DEBUG", "0")) flags |= FFX_UPSCALE_ENABLE_DEBUG_CHECKING; // TOTK_FSR4_DEBUG=1: API checks
|
||||
struct ffxCreateContextDescUpscale cd = {.header = {FFX_API_CREATE_CONTEXT_DESC_TYPE_UPSCALE, &be.header},
|
||||
.flags = flags, .maxRenderSize = {ow, oh}, .maxUpscaleSize = {ow, oh},
|
||||
.fpMessage = on_message};
|
||||
ffxContext ctx = NULL;
|
||||
ffxReturnCode_t r = F.create(&ctx, &cd.header, NULL);
|
||||
if (r != FFX_API_RETURN_OK || !ctx) {
|
||||
rt_log("fsr4: context creation failed (%u) at %ux%u: FSR 4 off for this run", (unsigned)r, ow, oh);
|
||||
return 0;
|
||||
}
|
||||
struct ffxQueryGetProviderVersion pv = {.header = {FFX_API_QUERY_DESC_TYPE_GET_PROVIDER_VERSION, NULL}};
|
||||
F.query(&ctx, &pv.header);
|
||||
rt_log("fsr4: context up to %ux%u -> %ux%u with %s (flags %#x)", ow, oh, ow, oh,
|
||||
pv.versionName ? pv.versionName : F.version, flags);
|
||||
F.ctx = ctx, F.ow = ow, F.oh = oh, F.n = 0;
|
||||
memset(F.ring, 0, sizeof F.ring);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void destroy(void) {
|
||||
if (F.ctx) F.destroy(&F.ctx, NULL);
|
||||
F.ctx = NULL;
|
||||
}
|
||||
|
||||
static uint32_t surface_format(VkFormat f) {
|
||||
switch (f) {
|
||||
case VK_FORMAT_B10G11R11_UFLOAT_PACK32: return FFX_API_SURFACE_FORMAT_R11G11B10_FLOAT;
|
||||
case VK_FORMAT_R16G16B16A16_SFLOAT: return FFX_API_SURFACE_FORMAT_R16G16B16A16_FLOAT;
|
||||
case VK_FORMAT_R16G16_SFLOAT: return FFX_API_SURFACE_FORMAT_R16G16_FLOAT;
|
||||
case VK_FORMAT_D32_SFLOAT: return FFX_API_SURFACE_FORMAT_R32_FLOAT;
|
||||
default: return FFX_API_SURFACE_FORMAT_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
// Every image of the scene upscaler stays in VK_IMAGE_LAYOUT_GENERAL: GENERIC_READ and UNORDERED_ACCESS are the
|
||||
// states the Vulkan backend maps to that layout (ffx_vk.cpp getVKImageLayoutFromResourceState), and it puts each
|
||||
// resource back into the state it was given at the end of the dispatch.
|
||||
static struct FfxApiResource resource(const VkFfxImage *im, uint32_t usage, uint32_t state) {
|
||||
struct FfxApiResource r;
|
||||
memset(&r, 0, sizeof r);
|
||||
if (!im->image) return r;
|
||||
r.resource = (void *)im->image;
|
||||
r.description = (struct FfxApiResourceDescription){.type = FFX_API_RESOURCE_TYPE_TEXTURE2D,
|
||||
.format = surface_format(im->format), .width = im->width,
|
||||
.height = im->height, .depth = 1, .mipCount = 1, .usage = usage};
|
||||
r.state = state;
|
||||
return r;
|
||||
}
|
||||
|
||||
// With the game's two or three frames in flight the dispatch FFX_QUEUED - 1 back is long done; should it not be, its
|
||||
// submission is waited for here (counted), as vk_fsr3.cpp wait_ring does for FSR 3.1.
|
||||
static void wait_ring(uint64_t fence) {
|
||||
if (F.n >= FFX_QUEUED - 1) {
|
||||
uint64_t back = F.ring[(F.n + 1) % FFX_QUEUED];
|
||||
if (back && vk_sync_fence_done() < back) {
|
||||
if (!F.waits++) rt_log("fsr4: waiting for the submission of a dispatch %d back (more frames in flight than "
|
||||
"the SDK's rings hold)", FFX_QUEUED - 1);
|
||||
vk_sync_fence_wait(back, 2000000000ull);
|
||||
}
|
||||
}
|
||||
F.ring[F.n % FFX_QUEUED] = fence;
|
||||
}
|
||||
|
||||
int vk_ffx_dispatch(VkCommandBuffer cb, const VkFfxDispatch *d) {
|
||||
if (!F.available || F.failed) return 0;
|
||||
uint32_t ow = d->out.width, oh = d->out.height;
|
||||
if (!F.ctx || ow != F.ow || oh != F.oh) {
|
||||
if (F.ctx) {
|
||||
vkDeviceWaitIdle(vk_ctx()->device); // what the old context recorded is queued or submitted
|
||||
destroy();
|
||||
}
|
||||
if (!create(ow, oh)) return F.failed = 1, 0;
|
||||
}
|
||||
if (d->color.width > F.ow || d->color.height > F.oh) {
|
||||
rt_log("fsr4: a %ux%u scene is larger than the %ux%u output: FSR 4 off for this run", d->color.width,
|
||||
d->color.height, F.ow, F.oh);
|
||||
return F.failed = 1, 0;
|
||||
}
|
||||
wait_ring(d->fence);
|
||||
struct ffxDispatchDescUpscale u;
|
||||
memset(&u, 0, sizeof u);
|
||||
u.header.type = FFX_API_DISPATCH_DESC_TYPE_UPSCALE;
|
||||
u.commandList = (void *)cb;
|
||||
u.color = resource(&d->color, FFX_API_RESOURCE_USAGE_READ_ONLY, FFX_API_RESOURCE_STATE_GENERIC_READ);
|
||||
u.depth = resource(&d->depth, FFX_API_RESOURCE_USAGE_DEPTHTARGET, FFX_API_RESOURCE_STATE_GENERIC_READ);
|
||||
u.motionVectors = resource(&d->mv, FFX_API_RESOURCE_USAGE_READ_ONLY, FFX_API_RESOURCE_STATE_GENERIC_READ);
|
||||
u.output = resource(&d->out, FFX_API_RESOURCE_USAGE_UAV, FFX_API_RESOURCE_STATE_UNORDERED_ACCESS);
|
||||
// (no reactive or transparency mask: FSR 3.1 gets none either)
|
||||
u.jitterOffset = (struct FfxApiFloatCoords2D){d->jx, d->jy};
|
||||
u.motionVectorScale = (struct FfxApiFloatCoords2D){1.0f, 1.0f}; // render pixels already
|
||||
u.renderSize = (struct FfxApiDimensions2D){d->color.width, d->color.height};
|
||||
u.upscaleSize = (struct FfxApiDimensions2D){ow, oh};
|
||||
u.enableSharpening = d->sharpness > 0;
|
||||
u.sharpness = d->sharpness > 1.0f ? 1.0f : d->sharpness;
|
||||
u.frameTimeDelta = d->dt_ms;
|
||||
u.preExposure = 1.0f;
|
||||
u.reset = d->reset != 0;
|
||||
u.cameraNear = d->cam_near;
|
||||
u.cameraFar = d->cam_far;
|
||||
u.cameraFovAngleVertical = d->fov_y;
|
||||
u.viewSpaceToMetersFactor = 1.0f; // TotK's world units are metres
|
||||
ffxReturnCode_t r = F.dispatch(&F.ctx, &u.header);
|
||||
F.n++;
|
||||
if (r != FFX_API_RETURN_OK) {
|
||||
rt_log("fsr4: dispatch failed (%u) at %ux%u -> %ux%u: FSR 4 off for this run", (unsigned)r, d->color.width,
|
||||
d->color.height, ow, oh);
|
||||
return F.failed = 1, 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void vk_ffx_release(void) {
|
||||
const VkCtx *c = vk_ctx();
|
||||
if (!F.ctx || !c || !c->device) return;
|
||||
vkDeviceWaitIdle(c->device);
|
||||
if (F.waits) rt_log("fsr4: %llu dispatches waited for an earlier one's submission", (unsigned long long)F.waits);
|
||||
destroy();
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,41 @@
|
||||
// AMD FSR 4 (vk_ffx.c), the fourth engine of vk_dlaa.c's scene upscaler (scene_upscaler = fsr4): the frame DLSS and
|
||||
// FSR 3.1 get goes to FSR 4 through AMD's FSR SDK 2.4 signed libraries, amd_fidelityfx_loader_vk.dll and
|
||||
// amd_fidelityfx_upscaler_vk.dll next to the executable. Windows only; elsewhere every call does nothing.
|
||||
#pragma once
|
||||
#include "vk.h"
|
||||
|
||||
// FSR 4 is the scene upscaler picked at start (vk_dlaa.c vk_upscaler_engine); the device may still lack it.
|
||||
int vk_ffx_wanted(void);
|
||||
// vk_device.c, while it builds the device: the extensions FSR 4's shaders use (cooperative matrix, 8-bit floats) join
|
||||
// the list when the device has them; their feature structures are chained there.
|
||||
void vk_ffx_device_exts(const VkExtensionProperties *have, uint32_t nhave, const char **ext, uint32_t *n, uint32_t max);
|
||||
void vk_ffx_init(void); // vk_dlaa.c vk_dlaa_init, after the device exists: loads the loader and pins FSR 4
|
||||
int vk_ffx_tried(void); // vk_ffx_init ran (FSR 4 picked at start, on Windows)
|
||||
int vk_ffx_available(void); // vk_ffx_init found FSR 4 for this device
|
||||
|
||||
typedef struct { // one image FSR reads or writes, in VK_IMAGE_LAYOUT_GENERAL, level 0 and layer 0
|
||||
VkImage image;
|
||||
VkFormat format;
|
||||
uint32_t width, height;
|
||||
} VkFfxImage;
|
||||
|
||||
typedef struct {
|
||||
VkFfxImage color; // the scene's light (R11G11B10F or RGBA16F, linear), the render size
|
||||
VkFfxImage depth; // its D32F depth, standard direction (0 near), finite far plane
|
||||
VkFfxImage mv; // RG16F motion vectors as vk_fsr3.h Fsr3Frame.mv (render pixels, without the jitter)
|
||||
VkFfxImage out; // RGBA16F with storage, the output size
|
||||
float jx, jy; // this frame's jitter, render pixels (window x right, y down), as the scene was drawn
|
||||
float dt_ms; // time since the previous dispatch
|
||||
float cam_near, cam_far; // the camera's planes (m)
|
||||
float fov_y; // vertical field of view, radians
|
||||
float sharpness; // FSR's own sharpening pass (RCAS) on its output, 0..1; 0: none
|
||||
int reset; // a new history
|
||||
uint64_t fence; // the submission's timeline value (VkExec.fence)
|
||||
} VkFfxDispatch;
|
||||
|
||||
// Records FSR 4 into cb (every image in GENERAL, left so; no render pass open; recorder drained by the caller). The
|
||||
// context is made at the first call and again when the output size changes; the scene may be any size up to the
|
||||
// output. 0 when it failed (logged; FSR 4 stays off for the run). FSR binds pipelines and descriptors of its own.
|
||||
int vk_ffx_dispatch(VkCommandBuffer cb, const VkFfxDispatch *d);
|
||||
void vk_ffx_release(void); // vk_device.c destroy_all, before the device goes away; harmless when nothing was made
|
||||
const char *vk_ffx_version(void); // "FSR 4.1.2" once vk_ffx_init pinned it, "" before or without
|
||||
@@ -41,8 +41,8 @@ from installer.runner import Context # noqa: E402
|
||||
from installer.steps import Fonts, all_steps # noqa: E402
|
||||
from installer.guilogic import (DONE, FAILED, PENDING, RUNNING, SKIPPED, UI_LANGUAGE_LABELS, # noqa: E402
|
||||
UI_LANGUAGES, Catalog, Form, Model, Process, amount, default_game_language,
|
||||
describe_event, parse_line, ui_language_for_langid, ui_language_for_locale,
|
||||
windows_ui_language)
|
||||
describe_event, fsr_default, parse_line, ui_language_for_langid,
|
||||
ui_language_for_locale, windows_ui_language)
|
||||
|
||||
INSTALLED = ROOT / 'build' / 'install-test'
|
||||
FIXTURE = ROOT / 'build' / 'inst-gui' / 'e2e-install'
|
||||
@@ -182,6 +182,22 @@ class RunStatesTest(unittest.TestCase):
|
||||
self.assertEqual(m.result, 'ok')
|
||||
|
||||
|
||||
class FsrDefaultTest(unittest.TestCase):
|
||||
"""Download AMD FSR is ticked at start with an AMD adapter only: not with other GPUs, nor when no adapter could be
|
||||
listed."""
|
||||
|
||||
def test_amd(self):
|
||||
self.assertTrue(fsr_default(['AMD Radeon RX 9060 XT']))
|
||||
self.assertTrue(fsr_default(['Intel(R) UHD Graphics', 'AMD Radeon(TM) Graphics']))
|
||||
|
||||
def test_other_gpus(self):
|
||||
self.assertFalse(fsr_default(['NVIDIA GeForce RTX 4080 SUPER']))
|
||||
self.assertFalse(fsr_default(['Intel(R) Arc(TM) A770 Graphics', 'Microsoft Basic Render Driver']))
|
||||
|
||||
def test_unknown(self):
|
||||
self.assertFalse(fsr_default([]))
|
||||
|
||||
|
||||
class FormTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tmp = tempfile.TemporaryDirectory()
|
||||
|
||||
+86
-1
@@ -1297,7 +1297,7 @@ class FontsTest(unittest.TestCase):
|
||||
def test_all_steps_order(self):
|
||||
self.assertEqual([s.id for s in steps.all_steps()],
|
||||
['check', 'kit', 'fonts', 'extract', 'lift', 'compile', 'prepare', 'pc_prompts', 'shapes', 'dlss',
|
||||
'cleanup'])
|
||||
'fsr', 'cleanup'])
|
||||
|
||||
def test_extracts_into_the_install_folder(self):
|
||||
self.fake_tool()
|
||||
@@ -1612,5 +1612,90 @@ class HostProbeTest(unittest.TestCase):
|
||||
self.assertIn(part, text[key], f'{path.name} {key}')
|
||||
|
||||
|
||||
@unittest.skipUnless(steps.os.name == 'nt', 'FSR is Windows-only')
|
||||
class FsrTest(unittest.TestCase):
|
||||
"""The FSR step: off without --fsr, Windows-only, keeps a player's libraries, installs both files or none."""
|
||||
|
||||
NAMES = ('amd_fidelityfx_loader_vk.dll', 'amd_fidelityfx_upscaler_vk.dll')
|
||||
|
||||
def setUp(self):
|
||||
self.tmp = tempfile.TemporaryDirectory()
|
||||
base = Path(self.tmp.name)
|
||||
self.dest, temp, src = base / 'dest', base / 'temp', base / 'src'
|
||||
for d in (self.dest, temp, src):
|
||||
d.mkdir()
|
||||
files = []
|
||||
for i, name in enumerate(self.NAMES):
|
||||
(src / name).write_bytes(bytes([65 + i]) * (1000 + i))
|
||||
files.append((name, 1000 + i, steps.file_sha256(src / name)))
|
||||
self.src = src
|
||||
self.saved = steps.FSR_BASE, steps.FSR_FILES
|
||||
steps.FSR_BASE = src.as_uri() + '/' # urllib reads file: URLs as it reads https: ones
|
||||
steps.FSR_FILES = tuple(files)
|
||||
amd = {'devices': [{'name': 'AMD Radeon RX 9070 XT', 'api': [1, 4, 0], 'type': 2}]}
|
||||
self.ctx = SimpleNamespace(dest=self.dest, temp=temp, host=amd, reporter=Reporter(out=io.StringIO()),
|
||||
options=SimpleNamespace(fsr=True))
|
||||
|
||||
def tearDown(self):
|
||||
steps.FSR_BASE, steps.FSR_FILES = self.saved
|
||||
self.ctx.reporter.close()
|
||||
self.tmp.cleanup()
|
||||
|
||||
def warnings(self):
|
||||
return [json.loads(line)['id'] for line in self.ctx.reporter.out.getvalue().splitlines()
|
||||
if json.loads(line)['type'] == 'warning']
|
||||
|
||||
def test_off_without_the_option(self):
|
||||
self.ctx.options.fsr = False
|
||||
self.assertEqual(steps.Fsr().run(self.ctx), {})
|
||||
self.assertFalse(any((self.dest / n).exists() for n in self.NAMES))
|
||||
self.assertNotEqual(steps.Fsr().key(self.ctx), steps.Fsr().key(SimpleNamespace(options=SimpleNamespace(fsr=True))))
|
||||
|
||||
def test_downloads_and_checks_both_libraries(self):
|
||||
rec = steps.Fsr().run(self.ctx)
|
||||
self.assertEqual(rec, {'installed': steps.FSR_VERSION})
|
||||
for n in self.NAMES:
|
||||
self.assertEqual((self.dest / n).read_bytes(), (self.src / n).read_bytes())
|
||||
self.assertFalse(list(self.ctx.temp.iterdir()))
|
||||
self.assertTrue(steps.Fsr().current(self.ctx, rec))
|
||||
(self.dest / self.NAMES[1]).unlink()
|
||||
self.assertFalse(steps.Fsr().current(self.ctx, rec))
|
||||
|
||||
def test_a_wrong_file_installs_neither(self):
|
||||
name, size, _ = steps.FSR_FILES[1]
|
||||
steps.FSR_FILES = (steps.FSR_FILES[0], (name, size, '0' * 64))
|
||||
rec = steps.Fsr().run(self.ctx)
|
||||
self.assertEqual(rec, {'failed': True})
|
||||
self.assertFalse(any((self.dest / n).exists() for n in self.NAMES))
|
||||
self.assertFalse(list(self.ctx.temp.iterdir()))
|
||||
self.assertEqual(self.warnings(), ['warn.fsr_download_failed'])
|
||||
self.assertFalse(steps.Fsr().current(self.ctx, rec))
|
||||
|
||||
def test_keeps_the_players_libraries(self):
|
||||
(self.dest / self.NAMES[1]).write_bytes(b'newer')
|
||||
self.assertEqual(steps.Fsr().run(self.ctx), {'kept': True})
|
||||
self.assertEqual((self.dest / self.NAMES[1]).read_bytes(), b'newer')
|
||||
self.assertFalse((self.dest / self.NAMES[0]).exists())
|
||||
self.assertEqual(self.warnings(), ['warn.fsr_kept'])
|
||||
|
||||
def test_downloads_on_an_nvidia_gpu(self):
|
||||
self.ctx.host = {'devices': [{'name': 'NVIDIA GeForce GTX 1050', 'api': [1, 3, 0], 'type': 2}]}
|
||||
rec = steps.Fsr().run(self.ctx)
|
||||
self.assertEqual(rec, {'installed': steps.FSR_VERSION})
|
||||
for name in self.NAMES:
|
||||
self.assertEqual((self.dest / name).read_bytes(), (self.src / name).read_bytes())
|
||||
|
||||
def test_old_no_amd_skip_record_is_retried(self):
|
||||
old_key = steps.fingerprint('fsr-1', steps.FSR_VERSION,
|
||||
*(sha for _, _, sha in steps.FSR_FILES))
|
||||
state = {'format': 1, 'release': 'old', 'inputs': {},
|
||||
'steps': {'fsr': {'key': old_key, 'release': 'old', 'skipped': 'no_amd'}}}
|
||||
ctx = runner.Context(SimpleNamespace(release='new'), self.dest, self.ctx.temp, self.ctx.reporter,
|
||||
self.ctx.options, state=state)
|
||||
ctx.steps = [steps.Fsr()]
|
||||
ctx.plan()
|
||||
self.assertTrue(ctx.runs['fsr'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
+15
-12
@@ -22,7 +22,7 @@
|
||||
# frame_queue = 0
|
||||
# Frame generation: off, or fsr3 (AMD FSR 3 frame interpolation). A generated picture goes on screen between each two
|
||||
# the game draws: twice the pictures, the game at half of fps_limit (the limit counts the pictures shown), the controls
|
||||
# about half a frame later. For displays of 120 Hz and more; off with DLSS, FSR 3.1 (scene_upscaler) or HDR, and in
|
||||
# about half a frame later. For displays of 120 Hz and more; off with DLSS, FSR (scene_upscaler) or HDR, and in
|
||||
# menus and fades. Applies at once.
|
||||
# frame_gen = off
|
||||
# Real-time frame step: game speed follows the clock instead of the frame count.
|
||||
@@ -234,7 +234,7 @@
|
||||
# Dynamic resolution: 1 lets the game lower the scene to 90 or 80 % of that size, 0 keeps it at 100 %. The game decides
|
||||
# by a cost estimate made for the Switch, which grows with the scene's width and ignores how fast your GPU is: a
|
||||
# scene wider than about 3000 pixels can drop to 80 % on any GPU. 1 is the default. 1.1.0, 1.2.1 and 1.4.3. Changes in
|
||||
# the menu take effect at once. While FSR 3.1 upscales the scene (scene_upscaler = fsr3) it stays at 100 %.
|
||||
# the menu take effect at once. While FSR upscales the scene (scene_upscaler = fsr3 or fsr4) it stays at 100 %.
|
||||
# dynamic_res = 1
|
||||
# Scaling to the window when it is larger than the game resolution: fsr (AMD FSR 1) or bilinear, and FSR's sharpening
|
||||
# from 0 (off) to 100. Changes while the game runs take effect at once.
|
||||
@@ -299,24 +299,27 @@
|
||||
|
||||
# The temporal upscaler for the 3D scene: off (the game's own scaling and FXAA), dlss (NVIDIA DLSS, on NVIDIA RTX GPUs
|
||||
# with the DLSS model from NVIDIA's DLSS SDK next to the executable: Windows nvngx_dlss.dll next to totk.exe; Linux
|
||||
# libnvidia-ngx-dlss.so.<version> next to totk, with the NVIDIA driver's libnvidia-ngx.so.1 installed) or fsr3 (AMD FSR
|
||||
# 3.1 from AMD's FidelityFX SDK, on any GPU). FSR 3.1 below native (dlss = quality and down) pays where the GPU limits
|
||||
# the frame rate: integrated GPUs, weak cards, 4K output; where the CPU limits it, its own GPU and CPU time make the game
|
||||
# slower. An engine that cannot run here leaves the game's own scaling in place. The HUD is drawn after it, at the
|
||||
# output size, and is not touched. The present's upscaler and sharpness below still scale the game image to the window.
|
||||
# Frame generation stays off with fsr3. Read at start. Without this line, dlaa = 1 (the older switch) means dlss.
|
||||
# libnvidia-ngx-dlss.so.<version> next to totk, with the NVIDIA driver's libnvidia-ngx.so.1 installed), fsr3 (AMD FSR
|
||||
# 3.1 from AMD's FidelityFX SDK, on any GPU) or fsr4 (AMD FSR 4, Windows only, on the Radeon GPUs AMD's FSR SDK
|
||||
# libraries offer it for, with amd_fidelityfx_loader_vk.dll and amd_fidelityfx_upscaler_vk.dll next to totk.exe, which
|
||||
# the setup downloads; without FSR 4 for the GPU the log says so and the scene upscaler is off). FSR below native (dlss =
|
||||
# quality and down) pays where the GPU limits the frame rate: integrated GPUs, weak cards, 4K output; where the CPU
|
||||
# limits it, its own GPU and CPU time make the game slower. An engine that cannot run here leaves the game's own scaling
|
||||
# in place. The HUD is drawn after it, at the output size, and is not touched. The present's upscaler and sharpness
|
||||
# below still scale the game image to the window. Frame generation stays off with fsr3 and fsr4. Read at start. Without
|
||||
# this line, dlaa = 1 (the older switch) means dlss.
|
||||
# scene_upscaler = off
|
||||
# The older DLSS switch, read only when scene_upscaler is not set: 1 is scene_upscaler = dlss.
|
||||
# dlaa = 0
|
||||
# The upscaling mode of the scene upscaler, DLSS or FSR 3.1: dlaa (native: the 3D scene at full size, anti-aliased
|
||||
# The upscaling mode of the scene upscaler, DLSS or FSR: dlaa (native: the 3D scene at full size, anti-aliased
|
||||
# only), quality, balanced, performance or ultra_performance (the scene at 67, 58, 50 or 33 % of the output, scaled up by
|
||||
# the upscaler; these replace render_scale and sharpen texture filtering to match). They apply only while a scene
|
||||
# upscaler runs; otherwise the scene follows render_scale. Changes while the game runs take effect at once (1.4.3; 1.2.1
|
||||
# at the next start).
|
||||
# dlss = dlaa
|
||||
# FSR 3.1's own sharpening of the 3D scene, from 0 (off) to 100. The game's sharpening is part of its FXAA, which FSR
|
||||
# 3.1 replaces, so at 0 FSR's picture is softer than the game's own. Only with scene_upscaler = fsr3. Changes while the
|
||||
# game runs take effect at once.
|
||||
# FSR's own sharpening of the 3D scene, from 0 (off) to 100. The game's sharpening is part of its FXAA, which FSR
|
||||
# replaces, so at 0 FSR's picture is softer than the game's own. Only with scene_upscaler = fsr3 or fsr4. Changes while
|
||||
# the game runs take effect at once.
|
||||
# fsr_sharpness = 80
|
||||
# The DLSS model: default (NVIDIA's advice per mode: K for dlaa, quality and balanced, M for performance, L for
|
||||
# ultra_performance), k (K in every mode) or j (the other transformer model: slightly less ghosting behind moving
|
||||
|
||||
Reference in new issue
Block a user