mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-24 13:45:57 +00:00
Keep FSR to Windows and say so on Linux.
AMD's FSR SDK ships its Vulkan libraries for Windows only. On Linux a dlaa_backend = fsr setting left DLAA off without a word; now it is ignored with a log line and DLAA stays with DLSS, the menu has no backend row, and resolution.c checks the DLSS library. The README says FSR is Windows only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f18b051040
commit
189e64cbd3
4 files changed
+15
-7
No files matched your search
@@ -68,15 +68,14 @@ static struct {
|
||||
// next to totk.exe on Windows, libnvidia-ngx-dlss.so.<version> next to totk on Linux (vk_dlaa.c vk_dlaa_init):
|
||||
// without that file DLSS never runs, and a DLSS mode would leave the game's plain scaling at 50..67 % of the output.
|
||||
// With dlaa_backend = fsr the modes scale through AMD's FSR instead (vk_ffx.c), which needs its loader and upscaler
|
||||
// DLLs next to totk.exe; on Linux FSR does not run.
|
||||
// DLLs next to totk.exe; on Linux the setting is ignored and DLSS is checked (vk_dlaa.c fsr_backend).
|
||||
static int dlss_dll(void) {
|
||||
int fsr = !strcmp(cfg_value("TOTK_DLAA_BACKEND"), "fsr");
|
||||
#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;
|
||||
if (fsr) {
|
||||
if (!strcmp(cfg_value("TOTK_DLAA_BACKEND"), "fsr")) {
|
||||
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);
|
||||
@@ -85,7 +84,6 @@ static int dlss_dll(void) {
|
||||
snprintf(path, sizeof path, "%.*s/nvngx_dlss.dll", (int)(last - exe), exe);
|
||||
return plat_file_exists(path);
|
||||
#else
|
||||
if (fsr) return 0;
|
||||
char exe[1024];
|
||||
if (!plat_exe_path(exe, sizeof exe)) return 1;
|
||||
char *last = plat_last_sep(exe);
|
||||
|
||||
@@ -681,8 +681,10 @@ static void tab_screen(float scale) {
|
||||
opt_slider("TOTK_PCSS", UI_MENU_PCSS, 0, 200, UI_MENU_PCSS_DESC, 10, "%.0f %%");
|
||||
opt_slider("TOTK_CONTACT_SHADOWS", UI_MENU_CONTACT_SHADOWS, 0, 100, UI_MENU_CONTACT_SHADOWS_DESC, 10, "%.0f %%");
|
||||
opt_toggle("TOTK_DLAA", UI_MENU_DLAA, UI_MENU_DLAA_DESC);
|
||||
#ifdef _WIN32 // AMD ships FSR's Vulkan libraries for Windows only: Linux has DLSS alone (vk_dlaa.c fsr_backend)
|
||||
static const UiTextId backend[] = {UI_MENU_DLAA_BACKEND_DLSS, UI_MENU_DLAA_BACKEND_FSR};
|
||||
opt_choice("TOTK_DLAA_BACKEND", UI_MENU_DLAA_BACKEND, backend, 2, UI_MENU_DLAA_BACKEND_DESC);
|
||||
#endif
|
||||
static const UiTextId dlss[] = {UI_MENU_DLSS_DLAA, UI_MENU_DLSS_QUALITY, UI_MENU_DLSS_BALANCED,
|
||||
UI_MENU_DLSS_PERFORMANCE, UI_MENU_DLSS_ULTRA};
|
||||
opt_choice("TOTK_DLSS", UI_MENU_DLSS, dlss, 5, UI_MENU_DLSS_DESC);
|
||||
|
||||
+10
-2
@@ -118,10 +118,18 @@ int vk_dlaa_wanted(void) {
|
||||
}
|
||||
|
||||
// FSR instead of DLSS (TOTK_DLAA_BACKEND=fsr), fixed for the run like dlaa: the backend's extensions are chosen at
|
||||
// device creation. On Linux FSR is not available, and this choice leaves DLAA off rather than falling back to DLSS.
|
||||
// device creation. AMD ships FSR's Vulkan libraries for Windows only, so on Linux the setting is ignored (the menu has
|
||||
// no row for it) and DLAA stays with DLSS.
|
||||
static int fsr_backend(void) {
|
||||
static int fsr = -1;
|
||||
if (fsr < 0) fsr = !strcmp(cfg_value("TOTK_DLAA_BACKEND"), "fsr");
|
||||
if (fsr < 0) {
|
||||
fsr = !strcmp(cfg_value("TOTK_DLAA_BACKEND"), "fsr");
|
||||
#ifndef _WIN32
|
||||
if (fsr && vk_dlaa_wanted())
|
||||
rt_log("dlaa: dlaa_backend = fsr runs on Windows only (AMD's FSR SDK has no Linux libraries): using DLSS");
|
||||
fsr = 0;
|
||||
#endif
|
||||
}
|
||||
return fsr;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user