From da10f13de9aceeda71806a5df30d52a0e9ffdc21 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 1 Sep 2021 13:51:14 -0400 Subject: [PATCH] zink: move pending prim type to gfx pipeline struct Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 2 +- src/gallium/drivers/zink/zink_context.h | 1 - src/gallium/drivers/zink/zink_draw.cpp | 6 +++--- src/gallium/drivers/zink/zink_pipeline.h | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 1f97c141531..0df187062e8 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3543,7 +3543,7 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) ctx->gfx_pipeline_state.dirty = true; ctx->compute_pipeline_state.dirty = true; ctx->fb_changed = ctx->rp_changed = true; - ctx->gfx_prim_mode = PIPE_PRIM_MAX; + ctx->gfx_pipeline_state.gfx_prim_mode = PIPE_PRIM_MAX; zink_init_draw_functions(ctx, screen); zink_init_grid_functions(ctx); diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h index 38cd9e8890f..d53b99d8316 100644 --- a/src/gallium/drivers/zink/zink_context.h +++ b/src/gallium/drivers/zink/zink_context.h @@ -217,7 +217,6 @@ struct zink_context { bool shader_reads_drawid; bool shader_reads_basevertex; struct zink_gfx_pipeline_state gfx_pipeline_state; - enum pipe_prim_type gfx_prim_mode; /* there are 5 gfx stages, but VS and FS are assumed to be always present, * thus only 3 stages need to be considered, giving 2^3 = 8 program caches. */ diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index 545eaf5ef59..260dbd48809 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -472,7 +472,7 @@ zink_draw_vbo(struct pipe_context *pctx, VkBuffer counter_buffers[PIPE_MAX_SO_OUTPUTS]; VkDeviceSize counter_buffer_offsets[PIPE_MAX_SO_OUTPUTS]; bool need_index_buffer_unref = false; - bool mode_changed = ctx->gfx_prim_mode != dinfo->mode; + bool mode_changed = ctx->gfx_pipeline_state.gfx_prim_mode != dinfo->mode; bool reads_drawid = ctx->shader_reads_drawid; bool reads_basevertex = ctx->shader_reads_basevertex; unsigned work_count = ctx->batch.work_count; @@ -507,14 +507,14 @@ zink_draw_vbo(struct pipe_context *pctx, if (mode == PIPE_PRIM_POINTS) { ctx->gfx_pipeline_state.has_points++; points_changed = true; - } else if (ctx->gfx_prim_mode == PIPE_PRIM_POINTS) { + } else if (ctx->gfx_pipeline_state.gfx_prim_mode == PIPE_PRIM_POINTS) { ctx->gfx_pipeline_state.has_points--; points_changed = true; } if (points_changed && ctx->rast_state->base.point_quad_rasterization) ctx->dirty_shader_stages |= BITFIELD_BIT(PIPE_SHADER_FRAGMENT); } - ctx->gfx_prim_mode = mode; + ctx->gfx_pipeline_state.gfx_prim_mode = mode; if (!HAS_DYNAMIC_STATE2) { if (ctx->gfx_pipeline_state.primitive_restart != dinfo->primitive_restart) diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h index eccfa443c28..d79f50b592a 100644 --- a/src/gallium/drivers/zink/zink_pipeline.h +++ b/src/gallium/drivers/zink/zink_pipeline.h @@ -85,6 +85,7 @@ struct zink_gfx_pipeline_state { VkPipeline pipeline; uint8_t patch_vertices; unsigned idx : 8; + enum pipe_prim_type gfx_prim_mode; //pending mode }; struct zink_compute_pipeline_state {