From 43bd965e6952887df90a214d5ac4f6225b82e9ca Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Thu, 19 Nov 2026 21:00:43 +0300 Subject: [PATCH] A chunked replay's contact shadow march takes the lighting target's image at the time it records, as it does the scene colour and the linear depth, not the entry the scan saw Co-Authored-By: Claude Opus 5.5 --- runtime/vk_exec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/vk_exec.c b/runtime/vk_exec.c index 3ff91b2d..0ef4a57c 100644 --- a/runtime/vk_exec.c +++ b/runtime/vk_exec.c @@ -1046,8 +1046,11 @@ static void run_job(VkExec *ex) { if (j.kind != VK_JOB_CONTACT) { vk_dlaa_exec(ex, &j); } else { - // The scan resolved the scene and its depth without creating entries (vk_texture_revive): their images now. + // The scan resolved the scene, its depth and the lighting target without creating entries (vk_texture_revive): + // their images now. A lighting target without one leaves the march darkening every pixel. const VkTexImage *si = vk_texture_get(j.scene.tex), *di = vk_texture_get(j.depth.tex); + const VkTexImage *ui = j.sun.img ? vk_texture_get(j.sun.tex) : NULL; + j.sun.img = ui, j.sun.image = ui ? ui->image : VK_NULL_HANDLE; if (si && di) { j.scene.img = si, j.scene.image = si->image, j.depth.img = di, j.depth.image = di->image; vk_contact_exec(ex, &j);