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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41407>
This commit is contained in:
Mike Blumenkrantz 2026-05-06 11:39:39 -04:00 committed by Marge Bot
parent ffd534aae4
commit 563259eaa9

View file

@ -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 {