From 4acbf34244d0a705441054a4b6edc576976a4492 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 1 May 2026 15:54:01 +1000 Subject: [PATCH] lavapipe: treat NULL pColorAttachmentLocations as no handles this fixes a crash seen in: dEQP-VK.renderpasses.dynamic_rendering.partial_secondary_cmd_buff.local_read.interaction_with_color_write_enable Cc: mesa-stable (cherry picked from commit 9cb688af88a72aef8b40937899736561da44427c) Part-of: --- .pick_status.json | 2 +- src/gallium/frontends/lavapipe/lvp_execute.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 30d00b00428..f482eabf186 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1554,7 +1554,7 @@ "description": "lavapipe: treat NULL pColorAttachmentLocations as no handles", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index d686f8d2ea8..b9744c2a39a 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -2000,10 +2000,12 @@ handle_rendering_attachment_locations(struct vk_cmd_queue_entry *cmd, struct ren state->fb_remapped = true; memset(state->fb_map, PIPE_MAX_COLOR_BUFS, sizeof(state->fb_map)); assert(state->color_att_count == set->colorAttachmentCount); - for (unsigned i = 0; i < state->color_att_count; i++) { - if (set->pColorAttachmentLocations[i] == VK_ATTACHMENT_UNUSED) - continue; - state->fb_map[i] = set->pColorAttachmentLocations[i]; + if (set->pColorAttachmentLocations) { + for (unsigned i = 0; i < state->color_att_count; i++) { + if (set->pColorAttachmentLocations[i] == VK_ATTACHMENT_UNUSED) + continue; + state->fb_map[i] = set->pColorAttachmentLocations[i]; + } } emit_fb_state(state); }