Mesa (master): zink: only reset pipeline hash conditionally when updating fb state

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 23 01:25:38 UTC 2021


Module: Mesa
Branch: master
Commit: 98250d42b76f0f4cd0ab39bc990612ee61bacefa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=98250d42b76f0f4cd0ab39bc990612ee61bacefa

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Sep 18 11:46:55 2020 -0400

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 at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9189>

---

 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)



More information about the mesa-commit mailing list