zink: avoid unnecessarily rewriting gl_DrawID

with tc enabled, we get genuine multidraws with valid drawids, so we can
update this to reflect the new capabilities...which are the same as the old
ones except that potentially some drivers can now do direct multidraws

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11662>
This commit is contained in:
Mike Blumenkrantz
2021-01-29 17:12:44 -05:00
committed by Marge Bot
parent 02efc5a099
commit 2d32d123e5

View File

@@ -417,8 +417,11 @@ zink_draw_vbo(struct pipe_context *pctx,
if (ctx->gfx_pipeline_state.vertices_per_patch != dinfo->vertices_per_patch)
ctx->gfx_pipeline_state.dirty = true;
bool drawid_broken = ctx->drawid_broken;
ctx->drawid_broken = BITSET_TEST(ctx->gfx_stages[PIPE_SHADER_VERTEX]->nir->info.system_values_read, SYSTEM_VALUE_DRAW_ID) &&
(!dindirect || !dindirect->buffer);
ctx->drawid_broken = false;
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));
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;