diff --git a/README.md b/README.md index 84c1fbdb..aca23a4c 100644 --- a/README.md +++ b/README.md @@ -22,9 +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 4 on Radeon RX 9000, 7000 and 6000 GPUs (FSR 3.1 on others), in the same modes as DLSS: the setup downloads - AMD's signed FSR SDK libraries (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK, AMD FSR SDK license) when it - finds an AMD GPU; pick *Upscaler: AMD FSR* in the menu. Windows only: AMD's FSR SDK has no Linux libraries yet +- AMD FSR 4 on supported Radeon RX 9000, 7000 and 6000 GPUs (FSR 3.1 on other GPUs supported by the SDK), in the same + modes as DLSS: on Windows, the setup downloads AMD's signed FSR SDK libraries (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK, + AMD FSR SDK license); the SDK determines which GPU devices and upscaler versions it supports - 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 @@ -56,9 +56,9 @@ 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). With an AMD GPU it downloads AMD FSR the same way; in the menu turn on *NVIDIA DLSS / DLAA* and pick - *Upscaler: AMD FSR*. -4. Play `totk.exe` from the install folder. + menu (F1). If *Download AMD FSR* is selected, it downloads the FSR SDK libraries on Windows; the SDK chooses the + upscaler version supported by the GPU. In the menu, pick *AMD FSR* under *Upscalers*. + 4. Play `totk.exe` from the install folder. ### Linux diff --git a/docs/installer.md b/docs/installer.md index db17852a..4dfcb8f6 100644 --- a/docs/installer.md +++ b/docs/installer.md @@ -100,12 +100,12 @@ 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. -9. **FSR** (the window's tick box, on by default, or `--fsr`; Windows with an AMD GPU): download +9. **FSR** (the window's tick box, on by default, 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. `dlaa_backend = fsr` loads them from the folder of totk.exe. Libraries already in the folder - are kept; without an AMD GPU the step only logs; a failed download warns and the next run tries again. + are kept; the SDK selects an upscaler version supported by the GPU; a failed download warns and the next run tries again. 10. **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. diff --git a/installer/cli.py b/installer/cli.py index f3dfb633..3c73133c 100644 --- a/installer/cli.py +++ b/installer/cli.py @@ -11,7 +11,7 @@ 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). --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 with an AMD GPU (steps.py, Fsr). +Windows; the SDK determines which GPU devices and upscaler versions it supports (steps.py, Fsr). """ import argparse import hashlib diff --git a/installer/steps.py b/installer/steps.py index 2ca999eb..98f820da 100644 --- a/installer/steps.py +++ b/installer/steps.py @@ -1356,23 +1356,17 @@ FSR_FILES = ( # name, size, SHA-256 FSR_LICENSE = f'https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK/blob/v{FSR_VERSION}/docs/license.md' -def amd_radeon(host): - """An AMD GPU among the host check's Vulkan devices: FSR 4 runs on Radeon RX 6000 and later, FSR 3.1 on older - ones.""" - return any('AMD' in d['name'].upper() or 'RADEON' in d['name'].upper() for d in (host or {}).get('devices', [])) - - class Fsr(Step): - """With --fsr on Windows and an AMD GPU: AMD's FSR loader and upscaler next to totk.exe. 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.""" + """With --fsr on Windows: AMD's FSR loader and upscaler next to totk.exe. The SDK selects the version supported by + 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-1', 'off') - return fingerprint('fsr-1', FSR_VERSION, *(sha for _, _, sha in FSR_FILES)) + 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'): @@ -1384,10 +1378,6 @@ class Fsr(Step): return {} if os.name != 'nt': return {'skipped': 'not_windows'} - if not amd_radeon(getattr(ctx, 'host', None)): - # The box is ticked by default, so most players without an AMD GPU never chose it: a log line, no warning - ctx.reporter.log('fsr: no AMD GPU among the Vulkan devices, nothing downloaded') - return {'skipped': 'no_amd'} rep = ctx.reporter present = [ctx.dest / name for name, _, _ in FSR_FILES if (ctx.dest / name).is_file()] if present: diff --git a/installer/text/en.json b/installer/text/en.json index e83becb9..08f26783 100644 --- a/installer/text/en.json +++ b/installer/text/en.json @@ -140,8 +140,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_fidelityfx_upscaler_vk.dll) 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 lets the dlaa setting run FSR (Upscaler: AMD FSR in the menu); without it that choice does nothing.", + "ui.fsr": "Download AMD FSR SDK libraries (FSR 3.1/4) for compatible Vulkan graphics cards", + "ui.fsr_help": "From AMD's FSR SDK on GitHub, under AMD's FSR SDK license (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). The SDK selects an upscaler version supported by your GPU. Required for AMD FSR in Upscalers; without it that choice does nothing.", "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.type_game": "Game files (NSP, XCI, NSZ, XCZ)", "ui.type_keys": "Key files (*.keys)", diff --git a/installer/text/pt-BR.json b/installer/text/pt-BR.json index be7c7c24..78795552 100644 --- a/installer/text/pt-BR.json +++ b/installer/text/pt-BR.json @@ -140,8 +140,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 (amd_fidelityfx_upscaler_vk.dll) 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). Permite que a opção dlaa use o FSR (Upscaler: AMD FSR no menu); sem ele essa escolha não faz nada.", + "ui.fsr": "Baixar as bibliotecas AMD FSR SDK (FSR 3.1/4) para GPUs Vulkan compatíveis", + "ui.fsr_help": "Do FSR SDK da AMD no GitHub, sob a licença do AMD FSR SDK (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). O SDK escolhe a versão do upscaler compatível com sua GPU. As bibliotecas são necessárias para AMD FSR em Upscalers; sem elas essa opção não funciona.", "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.type_game": "Arquivos de jogo (NSP, XCI, NSZ, XCZ)", "ui.type_keys": "Arquivos de chaves (*.keys)", diff --git a/installer/text/ru.json b/installer/text/ru.json index 05001b76..1ce346a1 100644 --- a/installer/text/ru.json +++ b/installer/text/ru.json @@ -140,8 +140,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 (amd_fidelityfx_upscaler_vk.dll) для видеокарт AMD Radeon", - "ui.fsr_help": "Из FSR SDK от AMD на GitHub, по лицензии AMD FSR SDK (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). С ним настройка dlaa может работать через FSR («Апскейлер: AMD FSR» в меню); без него этот выбор ничего не делает.", + "ui.fsr": "Загрузить библиотеки AMD FSR SDK (FSR 3.1/4) для совместимых видеокарт с Vulkan", + "ui.fsr_help": "Из FSR SDK от AMD на GitHub, по лицензии AMD FSR SDK (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK). SDK выбирает версию апскейлера, поддерживаемую видеокартой. Библиотеки нужны для AMD FSR в пункте «Апскейлеры»; без них этот выбор ничего не делает.", "ui.compressed_help": "Сжатые файлы NSZ и XCZ подходят как есть: установка сама их распакует (для этого, пока извлекаются данные игры, нужно столько свободного места, сколько занимают распакованные файлы).", "ui.type_game": "Файлы игры (NSP, XCI, NSZ, XCZ)", "ui.type_keys": "Файлы ключей (*.keys)", diff --git a/installer/text/zh-Hans.json b/installer/text/zh-Hans.json index 8af520e4..8ae39dc1 100644 --- a/installer/text/zh-Hans.json +++ b/installer/text/zh-Hans.json @@ -140,8 +140,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_fidelityfx_upscaler_vk.dll)", - "ui.fsr_help": "来自 GitHub 上 AMD 的 FSR SDK,遵循 AMD FSR SDK 许可(github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK)。有了它,dlaa 设置可以使用 FSR(菜单中的“超分辨率技术:AMD FSR”);没有它,该选项不起作用。", + "ui.fsr": "为兼容 Vulkan 的显卡下载 AMD FSR SDK 库(FSR 3.1/4)", + "ui.fsr_help": "来自 GitHub 上 AMD 的 FSR SDK,遵循 AMD FSR SDK 许可(github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK)。SDK 会选择显卡支持的超分辨率版本。要在“超分辨率技术”中使用 AMD FSR,必须安装这些库;否则该选项不起作用。", "ui.compressed_help": "压缩的 NSZ 和 XCZ 文件可以直接使用:安装程序会自行解压(在游戏数据提取完成之前,需要与解压后文件大小相同的可用空间)。", "ui.type_game": "游戏文件(NSP、XCI、NSZ、XCZ)", "ui.type_keys": "密钥文件(*.keys)", diff --git a/tests/installer_test.py b/tests/installer_test.py index 4e6c0f96..b75a28a8 100644 --- a/tests/installer_test.py +++ b/tests/installer_test.py @@ -897,7 +897,7 @@ class DlssTest(unittest.TestCase): @unittest.skipUnless(steps.os.name == 'nt', 'FSR is Windows-only') class FsrTest(unittest.TestCase): - """The FSR step: off without --fsr, needs an AMD GPU, keeps a player's libraries, installs both files or none.""" + """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') @@ -961,10 +961,23 @@ class FsrTest(unittest.TestCase): self.assertFalse((self.dest / self.NAMES[0]).exists()) self.assertEqual(self.warnings(), ['warn.fsr_kept']) - def test_skipped_without_an_amd_gpu(self): - self.ctx.host = {'devices': [{'name': 'NVIDIA GeForce RTX 4080 SUPER', 'api': [1, 4, 0], 'type': 2}]} - self.assertEqual(steps.Fsr().run(self.ctx), {'skipped': 'no_amd'}) - self.assertEqual(self.warnings(), []) + 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__':