diff --git a/runtime/resolution.c b/runtime/resolution.c index 1e3584e5..205335ff 100644 --- a/runtime/resolution.c +++ b/runtime/resolution.c @@ -378,11 +378,17 @@ void res_init(void) { scene_on ? "" : " (the game's own 5/6 of the output)", (unsigned long long)res_heap_extra_kib()); } +double wide_dlss_share(void); // widescreen.c: the mode's share of the picture (1 DLAA), 0 off + // DLSS upscaling: textures are sampled for the output's resolution, not the scene's (NVIDIA's DLSS guide: a mip bias -// of log2(render / output)), so their detail survives the scaling. 0 without a DLSS mode. +// of log2(render / output)), so their detail survives the scaling. 0 without a DLSS mode. Without the output and scene +// patch sets (Ocarina) the scene's share is widescreen.c's, which follows the mode and the upscaler while the game runs; +// R.dlss_k stays the mode at start there (res_dlss_mode moves it only once res_init has switched the sets on). vk_dlaa.c +// dlss_mode asks again at every mode change. float res_dlss_lod_bias(void) { decide(); - return R.dlss_k ? (float)log2(R.dlss_k) : 0.0f; + double k = res_adjustable() ? R.dlss_k : wide_dlss_share(); + return k > 0 && k < 1 ? (float)log2(k) : 0.0f; } // 16:9 within 1% (1366x768 counts): the shape the game's own layouts and camera are made for. diff --git a/runtime/vk_texture.c b/runtime/vk_texture.c index e931b411..0a462775 100644 --- a/runtime/vk_texture.c +++ b/runtime/vk_texture.c @@ -3255,6 +3255,8 @@ static int dlss_biased(const samp_par *k) { void vk_sampler_dlss_bias(float b) { lock(); if (b != dlss_bias) { + rt_log("vk: texture LOD bias %.2f on the scene's tiled textures (the upscaler's render scale; was %.2f)", b, + dlss_bias); dlss_bias = b; for (int i = 0; i < nsslots; i++) sslots[i].s = sslots[i].sp = sslots[i].sc = VK_NULL_HANDLE; // looked up again (the key moves) samp_gen++;