From 33d06f8cc2c3ed6cbb562ec421b8bde47e14e206 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 26 Jul 2023 16:21:08 -0400 Subject: [PATCH] lavapipe: zero fb attachment array at rp start this avoids invalid access if an attachment moves to a lower index in a smaller renderpass Reviewed-by: Dave Airlie Part-of: --- src/gallium/frontends/lavapipe/lvp_execute.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index 6733a2dadab..1cf68cb7fe5 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -1713,6 +1713,7 @@ handle_begin_rendering(struct vk_cmd_queue_entry *cmd, state->framebuffer.nr_cbufs = info->colorAttachmentCount; state->color_att_count = info->colorAttachmentCount; + memset(state->framebuffer.cbufs, 0, sizeof(state->framebuffer.cbufs)); for (unsigned i = 0; i < info->colorAttachmentCount; i++) { render_att_init(&state->color_att[i], &info->pColorAttachments[i], state->poison_mem, false); if (state->color_att[i].imgv) {