Arm DLSS only on a light target more than half the scene's size, so the half-size effects target that armed on frames around the quick weapon menu, where the half-size G-buffer came first, is no longer scaled to the output in place of the scene

This commit is contained in:
ipavlin98 committed 2026-11-13 08:46:42 +03:00
1 parent c89b0f3ee3
commit 1a3b2936d6
1 file changed
+11 -1
+11 -1
View File
@@ -1081,6 +1081,16 @@ static void evaluate(VkExec *ex, const VkExecTarget *dst) {
(unsigned long long)D.why[2], (unsigned long long)R.made, (unsigned long long)R.missed);
}
// More than half the scene size resolution.c set, on each side (the dynamic resolution tiers go down to 80 %). Around
// the quick weapon menu the only G-buffer before the scene's end is at times the half-size one (1920x1080 at a
// 3840x2160 scene), and the half-size RGBA16F effects target with its D32F depth armed; DLSS scaled the effects to the
// output in place of the scene, which showed dark and blurred for that frame.
static int scene_large(const VkExecTarget *c) {
unsigned o[2], s[2];
res_sizes(o, s);
return c->width * 2 > s[0] && c->height * 2 > s[1];
}
static int scene_color(VkFormat f) {
return f == VK_FORMAT_B10G11R11_UFLOAT_PACK32 || f == VK_FORMAT_R16G16B16A16_SFLOAT;
}
@@ -1132,7 +1142,7 @@ int vk_dlaa_plan(const VkExec *ex, VkExecJob *j) {
if (D.gbuf && !D.ended && ex->pass_ncolor == 1 && c->image && scene_color(c->format) && z->image && z->format == VK_FORMAT_D32_SFLOAT &&
c->width == z->width && c->height == z->height && c->width >= DLAA_SCENE_MIN_W && c->width >= D.gbuf_w &&
(!D.armed || (c->width >= D.color.width && c->height >= D.color.height)) &&
c->samples <= 1 && !c->is3d) {
c->samples <= 1 && !c->is3d && scene_large(c)) {
int first = !D.armed;
D.color = *c, D.depth = *z, D.armed = 1, D.nodepth = VK_NULL_HANDLE;
if (!first) return 0;