From 563259eaa943c2804717630b9d42adcaf69d60c9 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 Part-of: --- src/gallium/frontends/lavapipe/lvp_execute.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index 94ca05bf438..278b3896b0b 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -390,8 +390,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 {