From c18f3d6c5c5bdda8a1ba5653ffc5776023a5fae0 Mon Sep 17 00:00:00 2001 From: ipavlin98 Date: Sat, 14 Nov 2026 00:31:58 +0300 Subject: [PATCH] End the DLAA scene only at a bloom pass of the scene's shape without depth, so the sky lookups and the quarter-size particles that follow transparents drawn early no longer end it before the mist, which DLSS then missed on runs of frames and the distant mist flashed between them --- runtime/vk_dlaa.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/runtime/vk_dlaa.c b/runtime/vk_dlaa.c index 3fc25ab6..0665c2e1 100644 --- a/runtime/vk_dlaa.c +++ b/runtime/vk_dlaa.c @@ -1090,9 +1090,19 @@ static int scene_color(VkFormat f) { // then a half-size scene colour target and its mips, and only then the light target with the scene depth. Level 1 of // those mips is a quarter of the scene's width; taken for the bloom it ended the scene before anything was armed, DLSS // skipped those frames, and the picture flickered between anti-aliased frames and plain ones as the view changed. +// The pass also has the scene's shape (resolution.c's scene size, within 5 %) and no depth. In rain by a waterfall the +// game drew two transparents into the light target with the scene depth before its sky lookups (25x25 and 256x256 +// RGBA16F) and its quarter-size particles (960x540 RGBA16F with a depth of their own), which then ended the armed +// scene: DLSS ran before the mist and most transparents, which were drawn over its picture unprocessed, on runs of +// frames, and the mist in the distance darkened or brightened for a frame wherever a frame in between came out whole. static int bloom_start(const VkExec *ex, uint32_t scene_w) { const VkExecTarget *c = &ex->color[0]; - return ex->pass_w && ex->pass_w * 4 <= scene_w && c->image && scene_color(c->format) && !c->level; + if (!ex->pass_w || ex->pass_w * 4 > scene_w || !c->image || !scene_color(c->format) || c->level || ex->depth.image) + return 0; + unsigned o[2], s[2]; + res_sizes(o, s); + uint64_t a = (uint64_t)ex->pass_w * s[1], b = (uint64_t)ex->pass_h * s[0]; + return a * 20 >= b * 19 && b * 20 >= a * 19; } int vk_dlaa_plan(const VkExec *ex, VkExecJob *j) {