From c40dc39b5a87911cd6467b3ec647f382653a9b97 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 10 Mar 2022 14:05:32 -0500 Subject: [PATCH] lavapipe: use the correct value for dynamic render resolve attachment indexing subpass->color_count is (obviously) not set yet, so this would just clobber the color attachments any time resolves were used Fixes: 8a6160a3542 ("lavapipe: VK_KHR_dynamic_rendering") fixes: dEQP-VK.draw.dynamic_rendering.multiple_interpolation.structured.with_sample_decoration.4_samples Reviewed-by: Dave Airlie Part-of: --- src/gallium/frontends/lavapipe/lvp_execute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index b1171af..9ebad4d 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -1912,8 +1912,8 @@ static void handle_begin_rendering(struct vk_cmd_queue_entry *cmd, return; } bool has_ds = !!info->pDepthAttachment + !!info->pStencilAttachment; - struct lvp_render_pass_attachment *resolve_attachments = num_resolves ? &attachments[subpass->color_count + has_ds] : NULL; - struct lvp_render_pass_attachment **resolve_attachment_refs = num_resolves ? &attachment_refs[subpass->color_count + has_ds] : NULL; + struct lvp_render_pass_attachment *resolve_attachments = num_resolves ? &attachments[info->colorAttachmentCount + has_ds] : NULL; + struct lvp_render_pass_attachment **resolve_attachment_refs = num_resolves ? &attachment_refs[info->colorAttachmentCount + has_ds] : NULL; subpass->color_count = info->colorAttachmentCount; subpass->view_mask = info->viewMask; -- 2.7.4