zink: clamp dynamic fb layers better

this needs to be the minimum layer, not the maximum

Fixes: c81cd989c8 ("zink: use dynamic rendering (most of the time)")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17061>
This commit is contained in:
Mike Blumenkrantz 2022-06-15 13:00:16 -04:00 committed by Marge Bot
parent f74df6205d
commit 7edecbf4c2

View file

@ -2617,7 +2617,7 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
ctx->dynamic_fb.info.renderArea.extent.width = state->width;
ctx->dynamic_fb.info.renderArea.extent.height = state->height;
ctx->dynamic_fb.info.colorAttachmentCount = ctx->fb_state.nr_cbufs;
unsigned layers = MAX2(util_framebuffer_get_num_layers(state), 1);
unsigned layers = MAX2(zink_framebuffer_get_num_layers(state), 1);
ctx->rp_changed |= ctx->dynamic_fb.info.layerCount != layers;
ctx->dynamic_fb.info.layerCount = layers;
ctx->gfx_pipeline_state.rendering_info.colorAttachmentCount = ctx->fb_state.nr_cbufs;