mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-24 21:55:57 +00:00
Add AMD FSR 4 upscaling as a second DLAA backend.
dlaa_backend = fsr hands the DLAA frame (scene light, depth, motion vectors, jitter and the characters' mask) to AMD's FSR through the FSR SDK 2.4 Vulkan loader, which picks FSR 4 where the GPU has it and FSR 3.1 elsewhere. The device enables cooperative matrix and 8-bit float support for it, the camera's near and far planes and field of view come from the scene camera block, and the setup gains an fsr step that downloads AMD's signed DLLs. DLAA also no longer arms on scenes narrower than a quarter of the output, which small loading renders did at ultrawide sizes.
This commit is contained in:
1 parent
eda417fd1d
commit
ba711b7f5a
25 files changed
+973
-39
No files matched your search
+17
-3
@@ -67,15 +67,25 @@ static struct {
|
||||
// The scene size is decided before the device exists, so NGX cannot be asked yet. NGX loads DLSS from nvngx_dlss.dll
|
||||
// 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.
|
||||
static int dlss_dll(void) {
|
||||
int fsr = !strcmp(cfg_value("TOTK_DLAA_BACKEND"), "fsr");
|
||||
#ifdef _WIN32
|
||||
char exe[1024], path[1024 + 32];
|
||||
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) {
|
||||
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);
|
||||
}
|
||||
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);
|
||||
@@ -110,8 +120,12 @@ static double dlss_share(const char *m) {
|
||||
if (!strcmp(m, dlss[i].name)) {
|
||||
if (dll < 0 && !(dll = dlss_dll())) {
|
||||
#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 (!strcmp(cfg_value("TOTK_DLAA_BACKEND"), "fsr"))
|
||||
rt_log("resolution: FSR %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);
|
||||
|
||||
Reference in new issue
Block a user