Mesa (main): zink: move viewport count into dynamic state1 part of pipeline hash

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 27 11:07:14 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Jun 15 09:50:26 2021 -0400

zink: move viewport count into dynamic state1 part of pipeline hash

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

---

 src/gallium/drivers/zink/zink_context.c  | 4 ++--
 src/gallium/drivers/zink/zink_pipeline.c | 4 ++--
 src/gallium/drivers/zink/zink_pipeline.h | 3 +--
 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 eea5d72eaa3..08a31da8287 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -968,9 +968,9 @@ zink_set_viewport_states(struct pipe_context *pctx,
    ctx->vp_state.num_viewports = start_slot + num_viewports;
 
    if (!zink_screen(pctx->screen)->info.have_EXT_extended_dynamic_state) {
-      if (ctx->gfx_pipeline_state.num_viewports != ctx->vp_state.num_viewports)
+      if (ctx->gfx_pipeline_state.dyn_state1.num_viewports != ctx->vp_state.num_viewports)
          ctx->gfx_pipeline_state.dirty = true;
-      ctx->gfx_pipeline_state.num_viewports = ctx->vp_state.num_viewports;
+      ctx->gfx_pipeline_state.dyn_state1.num_viewports = ctx->vp_state.num_viewports;
    }
    ctx->vp_state_changed = true;
 }
diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c
index 8cb926e8230..2bf8e83bc15 100644
--- a/src/gallium/drivers/zink/zink_pipeline.c
+++ b/src/gallium/drivers/zink/zink_pipeline.c
@@ -125,9 +125,9 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
 
    VkPipelineViewportStateCreateInfo viewport_state = {0};
    viewport_state.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
-   viewport_state.viewportCount = state->num_viewports;
+   viewport_state.viewportCount = state->dyn_state1.num_viewports;
    viewport_state.pViewports = NULL;
-   viewport_state.scissorCount = state->num_viewports;
+   viewport_state.scissorCount = state->dyn_state1.num_viewports;
    viewport_state.pScissors = NULL;
 
    VkPipelineRasterizationStateCreateInfo rast_state = {0};
diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h
index f616faa40d5..e16f19ccdf6 100644
--- a/src/gallium/drivers/zink/zink_pipeline.h
+++ b/src/gallium/drivers/zink/zink_pipeline.h
@@ -49,8 +49,6 @@ struct zink_gfx_pipeline_state {
    uint8_t rast_samples;
    uint8_t vertices_per_patch;
 
-   unsigned num_viewports;
-
    /* Pre-hashed value for table lookup, invalid when zero.
     * Members after this point are not included in pipeline state hash key */
    uint32_t hash;
@@ -59,6 +57,7 @@ struct zink_gfx_pipeline_state {
    struct {
       struct zink_depth_stencil_alpha_hw_state *depth_stencil_alpha_state; //non-dynamic state
       VkFrontFace front_face;
+      unsigned num_viewports;
    } dyn_state1;
 
    bool primitive_restart; //dynamic state2



More information about the mesa-commit mailing list