From: Mike Blumenkrantz Date: Thu, 24 Jun 2021 19:10:49 +0000 (-0400) Subject: zink: move drawid_broken to unhashed pipeline state X-Git-Tag: upstream/22.3.5~18313 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d524d0d72b0c7c5cc88e3420384ee7cce72446d1;p=platform%2Fupstream%2Fmesa.git zink: move drawid_broken to unhashed pipeline state Reviewed-by: Dave Airlie Part-of: --- diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h index bdf8cd5..21c2e65 100644 --- a/src/gallium/drivers/zink/zink_context.h +++ b/src/gallium/drivers/zink/zink_context.h @@ -265,8 +265,6 @@ struct zink_context { VkSampleLocationEXT vk_sample_locations[PIPE_MAX_SAMPLE_LOCATION_GRID_SIZE * PIPE_MAX_SAMPLE_LOCATION_GRID_SIZE]; uint8_t sample_locations[2 * 4 * 8 * 16]; - bool drawid_broken; - struct pipe_stencil_ref stencil_ref; union { diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index b454e21..7554f3c 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -445,13 +445,13 @@ zink_draw_vbo(struct pipe_context *pctx, uint8_t vertices_per_patch = ctx->gfx_pipeline_state.patch_vertices ? ctx->gfx_pipeline_state.patch_vertices - 1 : 0; if (ctx->gfx_pipeline_state.vertices_per_patch != vertices_per_patch) ctx->gfx_pipeline_state.dirty = true; - bool drawid_broken = ctx->drawid_broken; - ctx->drawid_broken = false; + bool drawid_broken = ctx->gfx_pipeline_state.drawid_broken; + ctx->gfx_pipeline_state.drawid_broken = false; if (reads_drawid && (!dindirect || !dindirect->buffer)) - ctx->drawid_broken = (drawid_offset != 0 || + ctx->gfx_pipeline_state.drawid_broken = (drawid_offset != 0 || (!HAS_MULTIDRAW && num_draws > 1) || (HAS_MULTIDRAW && num_draws > 1 && !dinfo->increment_draw_id)); - if (drawid_broken != ctx->drawid_broken) + if (drawid_broken != ctx->gfx_pipeline_state.drawid_broken) ctx->dirty_shader_stages |= BITFIELD_BIT(PIPE_SHADER_VERTEX); ctx->gfx_pipeline_state.vertices_per_patch = vertices_per_patch; if (mode_changed) { @@ -718,7 +718,7 @@ zink_draw_vbo(struct pipe_context *pctx, offsetof(struct zink_gfx_push_constant, default_inner_level), sizeof(float) * 6, &ctx->tess_levels[0]); - bool needs_drawid = reads_drawid && ctx->drawid_broken; + bool needs_drawid = reads_drawid && ctx->gfx_pipeline_state.drawid_broken; work_count += num_draws; if (index_size > 0) { if (dindirect && dindirect->buffer) { diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h index 664e671..d4239b0 100644 --- a/src/gallium/drivers/zink/zink_pipeline.h +++ b/src/gallium/drivers/zink/zink_pipeline.h @@ -77,6 +77,7 @@ struct zink_gfx_pipeline_state { uint8_t has_points; //either gs outputs points or prim type is points uint8_t coord_replace_bits; bool coord_replace_yinvert; + bool drawid_broken; struct zink_blend_state *blend_state; struct zink_render_pass *render_pass; VkPipeline pipeline; diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index fbddcd9..253180f 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -115,7 +115,7 @@ shader_key_vs_gen(struct zink_context *ctx, struct zink_shader *zs, switch (zs->nir->info.stage) { case MESA_SHADER_VERTEX: vs_key->last_vertex_stage = !shaders[PIPE_SHADER_TESS_EVAL] && !shaders[PIPE_SHADER_GEOMETRY]; - vs_key->push_drawid = ctx->drawid_broken; + vs_key->push_drawid = ctx->gfx_pipeline_state.drawid_broken; break; case MESA_SHADER_TESS_EVAL: vs_key->last_vertex_stage = !shaders[PIPE_SHADER_GEOMETRY];