zink: improve detection for broken drawids

this is also broken for multidraws where drawid shouldn't be incremented

Fixes: 2d32d123e5 ("zink: avoid unnecessarily rewriting gl_DrawID")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11878>
This commit is contained in:
Mike Blumenkrantz 2021-07-14 14:21:24 -04:00 committed by Marge Bot
parent 28c5e88931
commit d08c84ab0c
1 changed files with 2 additions and 1 deletions

View File

@ -422,7 +422,8 @@ zink_draw_vbo(struct pipe_context *pctx,
if (!dindirect || !dindirect->buffer)
ctx->drawid_broken = BITSET_TEST(ctx->gfx_stages[PIPE_SHADER_VERTEX]->nir->info.system_values_read, SYSTEM_VALUE_DRAW_ID) &&
(drawid_offset != 0 ||
((!ctx->tc || !screen->info.have_EXT_multi_draw) && num_draws > 1));
(!screen->info.have_EXT_multi_draw && num_draws > 1) ||
(screen->info.have_EXT_multi_draw && num_draws > 1 && !dinfo->increment_draw_id));
if (drawid_broken != ctx->drawid_broken)
ctx->dirty_shader_stages |= BITFIELD_BIT(PIPE_SHADER_VERTEX);
ctx->gfx_pipeline_state.vertices_per_patch = dinfo->vertices_per_patch;