From 98250d42b76f0f4cd0ab39bc990612ee61bacefa Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 18 Sep 2020 11:46:55 -0400 Subject: [PATCH] zink: only reset pipeline hash conditionally when updating fb state if we aren't changing anything here then we don't need to update the pipeline Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 5f5d0b7473d..d285acaac10 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -917,15 +917,20 @@ zink_set_framebuffer_state(struct pipe_context *pctx, zink_framebuffer_reference(screen, &fb, NULL); fb = create_framebuffer(ctx); zink_framebuffer_reference(screen, &ctx->framebuffer, fb); + if (ctx->gfx_pipeline_state.render_pass != fb->rp) + ctx->gfx_pipeline_state.dirty = true; ctx->gfx_pipeline_state.render_pass = fb->rp; uint8_t rast_samples = util_framebuffer_get_num_samples(state); /* in vulkan, gl_SampleMask needs to be explicitly ignored for sampleCount == 1 */ if ((ctx->gfx_pipeline_state.rast_samples > 1) != (rast_samples > 1)) ctx->dirty_shader_stages |= 1 << PIPE_SHADER_FRAGMENT; + if (ctx->gfx_pipeline_state.rast_samples != rast_samples) + ctx->gfx_pipeline_state.dirty = true; ctx->gfx_pipeline_state.rast_samples = rast_samples; + if (ctx->gfx_pipeline_state.num_attachments != state->nr_cbufs) + ctx->gfx_pipeline_state.dirty = true; ctx->gfx_pipeline_state.num_attachments = state->nr_cbufs; - ctx->gfx_pipeline_state.dirty = true; /* need to start a new renderpass */ if (zink_curr_batch(ctx)->in_rp)