From: Erik Faye-Lund Date: Wed, 20 May 2020 12:39:35 +0000 (+0200) Subject: zink: use samples from state X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e38513e828df239b4ea06f50af9cecf78305eb37;p=mesa.git zink: use samples from state There's no reason to compute this, when it's already passed in. Reviewed-by: Mike Blumenkrantz Part-of: --- diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 323f87e27ac..c5137b1dec8 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -630,12 +630,6 @@ zink_set_framebuffer_state(struct pipe_context *pctx, struct zink_context *ctx = zink_context(pctx); struct zink_screen *screen = zink_screen(pctx->screen); - VkSampleCountFlagBits rast_samples = VK_SAMPLE_COUNT_1_BIT; - for (int i = 0; i < state->nr_cbufs; i++) - rast_samples = MAX2(rast_samples, state->cbufs[i]->texture->nr_samples); - if (state->zsbuf && state->zsbuf->texture->nr_samples) - rast_samples = MAX2(rast_samples, state->zsbuf->texture->nr_samples); - util_copy_framebuffer_state(&ctx->fb_state, state); struct zink_framebuffer *fb = ctx->framebuffer; @@ -646,7 +640,7 @@ zink_set_framebuffer_state(struct pipe_context *pctx, zink_framebuffer_reference(screen, &ctx->framebuffer, fb); zink_render_pass_reference(screen, &ctx->gfx_pipeline_state.render_pass, fb->rp); - ctx->gfx_pipeline_state.rast_samples = rast_samples; + ctx->gfx_pipeline_state.rast_samples = MAX2(state->samples, 1); ctx->gfx_pipeline_state.num_attachments = state->nr_cbufs; struct zink_batch *batch = zink_batch_no_rp(ctx);