Mesa (main): zink: remove attachment count from pipeline hash

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 27 02:50:21 UTC 2021


Module: Mesa
Branch: main
Commit: ab08dcd8956d2db4534243ad8424691fdc360182
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ab08dcd8956d2db4534243ad8424691fdc360182

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Jun 10 08:17:09 2021 -0400

zink: remove attachment count from pipeline hash

this is redundant

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12572>

---

 src/gallium/drivers/zink/zink_context.c  | 3 ---
 src/gallium/drivers/zink/zink_pipeline.c | 7 +++++--
 src/gallium/drivers/zink/zink_pipeline.h | 1 -
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 0fe0bddb905..c976a31bf19 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -2027,9 +2027,6 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
       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;
 
    /* need to ensure we start a new rp on next draw */
    zink_batch_no_rp(ctx);
diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c
index d60bcc20418..c61ca87d60e 100644
--- a/src/gallium/drivers/zink/zink_pipeline.c
+++ b/src/gallium/drivers/zink/zink_pipeline.c
@@ -91,8 +91,11 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
    VkPipelineColorBlendAttachmentState blend_att[PIPE_MAX_COLOR_BUFS];
    VkPipelineColorBlendStateCreateInfo blend_state = {0};
    blend_state.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
+   unsigned num_attachments = state->render_pass->state.num_rts;
+   if (state->render_pass->state.have_zsbuf)
+      num_attachments--;
    if (state->void_alpha_attachments) {
-      for (unsigned i = 0; i < state->num_attachments; i++) {
+      for (unsigned i = 0; i < num_attachments; i++) {
          blend_att[i] = state->blend_state->attachments[i];
          if (state->void_alpha_attachments & BITFIELD_BIT(i)) {
             blend_att[i].dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO;
@@ -103,7 +106,7 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
       blend_state.pAttachments = blend_att;
    } else
       blend_state.pAttachments = state->blend_state->attachments;
-   blend_state.attachmentCount = state->num_attachments;
+   blend_state.attachmentCount = num_attachments;
    blend_state.logicOpEnable = state->blend_state->logicop_enable;
    blend_state.logicOp = state->blend_state->logicop_func;
 
diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h
index 5d1113275b2..de72882d3e5 100644
--- a/src/gallium/drivers/zink/zink_pipeline.h
+++ b/src/gallium/drivers/zink/zink_pipeline.h
@@ -41,7 +41,6 @@ struct zink_gfx_pipeline_state {
    struct zink_render_pass *render_pass;
 
    uint8_t void_alpha_attachments:PIPE_MAX_COLOR_BUFS;
-   uint32_t num_attachments;
    struct zink_blend_state *blend_state;
 
    struct zink_rasterizer_hw_state *rast_state;



More information about the mesa-commit mailing list