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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9189>
This commit is contained in:
Mike Blumenkrantz 2020-09-18 11:46:55 -04:00 committed by Marge Bot
parent b1843879c1
commit 98250d42b7

View file

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