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>
(cherry picked from commit d08c84ab0c)
This commit is contained in:
Mike Blumenkrantz 2021-07-14 14:21:24 -04:00 committed by Dylan Baker
parent 7d2802b80c
commit bf260384b9
2 changed files with 3 additions and 2 deletions

View file

@ -238,7 +238,7 @@
"description": "zink: improve detection for broken drawids",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "2d32d123e5624e631fa1eda02da647d0065b7ae8"
},

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;