From 72b5aad56d5ba01b50a6ab3fa77d75dde2a4b309 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 6 May 2026 11:39:39 -0400 Subject: [PATCH] lavapipe: update cbuf count when remapping attachments handle cases where attachments are remapped to higher indices than the renderpass was created with fixes: dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.local_read.mapping_*_attachments_to_locs_from_* cc: mesa-stable (cherry picked from commit 563259eaa943c2804717630b9d42adcaf69d60c9) Part-of: --- .pick_status.json | 2 +- src/gallium/frontends/lavapipe/lvp_execute.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 14f787ebe21..6f3ac010224 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2964,7 +2964,7 @@ "description": "lavapipe: update cbuf count when remapping attachments", "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 0f8e33a31a8..f344c3b1a41 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -346,8 +346,10 @@ emit_fb_state(struct rendering_state *state) struct pipe_framebuffer_state fb = state->framebuffer; memset(fb.cbufs, 0, sizeof(fb.cbufs)); for (unsigned i = 0; i < fb.nr_cbufs; i++) { - if (state->fb_map[i] < PIPE_MAX_COLOR_BUFS) + if (state->fb_map[i] < PIPE_MAX_COLOR_BUFS) { fb.cbufs[state->fb_map[i]] = state->framebuffer.cbufs[i]; + fb.nr_cbufs = MAX2(fb.nr_cbufs, state->fb_map[i] + 1); + } } state->pctx->set_framebuffer_state(state->pctx, &fb); } else {