lavapipe: treat NULL pColorAttachmentLocations as no handles
Some checks failed
macOS-CI / macOS-CI (dri) (push) Has been cancelled
macOS-CI / macOS-CI (xlib) (push) Has been cancelled

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
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41309>
This commit is contained in:
Dave Airlie 2026-05-01 15:54:01 +10:00
parent be75ece095
commit 9cb688af88

View file

@ -2062,10 +2062,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);
}