From 5e71cee08c63a47c67e1fb861a4ffe47d54a48d8 Mon Sep 17 00:00:00 2001 From: FIocker <4461558+FIocker@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:28:00 +0100 Subject: [PATCH] Record the depth bias again at each pass, as the viewport and scissor are, so a pass into a scaled shadow map never keeps an unscaled slope term. Co-Authored-By: Claude Opus 5.5 --- runtime/vk_exec_draw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/vk_exec_draw.c b/runtime/vk_exec_draw.c index 57201748..c37614de 100644 --- a/runtime/vk_exec_draw.c +++ b/runtime/vk_exec_draw.c @@ -4315,7 +4315,8 @@ static int prepare_draw_ex(VkExec *ex, int prim, int32_t count, int restart, int if (ex->in_pass && (w > ex->pass_w || h > ex->pass_h)) vk_exec_pass_end(ex); if (!ex->in_pass) ex->rt_resolved = 0; } - if (!ex->in_pass) ex->dirty |= VK_EXEC_DIRTY_VIEWPORT | VK_EXEC_DIRTY_SCISSOR; + // a new pass may have another scale (pass_scale): the viewport, the scissor and the slope bias (slope_bias) follow it + if (!ex->in_pass) ex->dirty |= VK_EXEC_DIRTY_VIEWPORT | VK_EXEC_DIRTY_SCISSOR | VK_EXEC_DIRTY_DEPTH_BIAS; vk_exec_pass_begin(ex); VkRect2D sc = vk_exec_scissor(ex); if (!sc.extent.width || !sc.extent.height) return draw_skipped(ex, mesh, SK_SCISSOR);