From 2d32d123e5624e631fa1eda02da647d0065b7ae8 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 29 Jan 2021 17:12:44 -0500 Subject: [PATCH] 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 Part-of: --- src/gallium/drivers/zink/zink_draw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_draw.c b/src/gallium/drivers/zink/zink_draw.c index 85ae99df517..4cd9502f8a5 100644 --- a/src/gallium/drivers/zink/zink_draw.c +++ b/src/gallium/drivers/zink/zink_draw.c @@ -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;