lavapipe: use the correct value for dynamic render resolve attachment indexing
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 10 Mar 2022 19:05:32 +0000 (14:05 -0500)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Mar 2022 19:48:59 +0000 (19:48 +0000)
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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15330>

src/gallium/frontends/lavapipe/lvp_execute.c

index b1171af..9ebad4d 100644 (file)
@@ -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;