zink: use samples from state
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 20 May 2020 12:39:35 +0000 (14:39 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 25 May 2020 20:20:49 +0000 (20:20 +0000)
There's no reason to compute this, when it's already passed in.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5141>

src/gallium/drivers/zink/zink_context.c

index 323f87e27acb24ad98d5536cd92672e31c26e07b..c5137b1dec8206b5f532b768a3e5fcc0f92b9cdd 100644 (file)
@@ -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);