zink: move drawid_broken to unhashed pipeline state

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12660>
This commit is contained in:
Mike Blumenkrantz 2021-06-24 15:10:49 -04:00 committed by Marge Bot
parent 58d08635b5
commit d524d0d72b
4 changed files with 7 additions and 8 deletions

View file

@ -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 {

View file

@ -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) {

View file

@ -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;

View file

@ -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];