From 28f3fcc8d5cc8f4f0fc13d32e68c82b513167410 Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Fri, 20 Nov 2026 16:21:02 +0300 Subject: [PATCH] With FSR 3.1 upscaling, the scene's material textures take AMD's mip bias, log2(scene / output) - 1 (-1.58 at quality, -1 in place), where DLSS keeps NVIDIA's log2(scene / output); the bias follows the mode and the upscaler going on or off. Field still view at quality, 1080p, mean absolute Laplacian of luma on the far cliff: 2.31 -> 2.82 against 4.09 with FSR off; grass near Link unchanged (5.53 -> 5.56, its blades are flat-coloured geometry). FSR's auto exposure was tried with it and left out: grass softer (5.53 -> 4.96) with no visible gain. Co-Authored-By: Claude Opus 5.5 --- runtime/vk_dlaa.c | 12 +++++++----- runtime/vk_texture.c | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/runtime/vk_dlaa.c b/runtime/vk_dlaa.c index 30ec999e..1929669b 100644 --- a/runtime/vk_dlaa.c +++ b/runtime/vk_dlaa.c @@ -1802,18 +1802,20 @@ 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 DLSS runs. +// 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. static void dlss_mode(void) { static char mode[32]; - static int bias_on = -1; + static float bias; // what the material samplers have (vk_texture.c starts at 0) const char *m = cfg_value("TOTK_DLSS"); if (strcmp(m, mode)) { snprintf(mode, sizeof mode, "%s", m); res_dlss_mode(m); - bias_on = -1; } - int b = dl_active(); - if (b != bias_on) bias_on = b, vk_sampler_dlss_bias(b ? res_dlss_lod_bias() : 0.0f); + float b = 0.0f; + if (dl_active()) b = res_dlss_lod_bias() - (vk_upscaler_engine() == UPSCALER_FSR3 ? 1.0f : 0.0f); + if (b != bias) bias = b, vk_sampler_dlss_bias(b); } diff --git a/runtime/vk_texture.c b/runtime/vk_texture.c index 232b5b42..daad15bd 100644 --- a/runtime/vk_texture.c +++ b/runtime/vk_texture.c @@ -2719,7 +2719,7 @@ void vk_sampler_register(int id, const samp_par *s) { unlock(); } -// DLSS upscaling (vk_sampler_dlss_bias): the scene's material textures, the filtered mipmapped ones that repeat, are +// DLSS or FSR 3.1 upscaling (vk_sampler_dlss_bias): the scene's material textures, the filtered mipmapped ones that repeat, are // sampled for the output's resolution; clamped ones (post effects, LUTs, the UI) keep the game's bias. static float dlss_bias;