zink: improve detection for broken drawids
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 14 Jul 2021 18:21:24 +0000 (14:21 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 14 Jul 2021 19:20:09 +0000 (19:20 +0000)
this is also broken for multidraws where drawid shouldn't be incremented

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

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11878>

src/gallium/drivers/zink/zink_draw.c

index d8280c6..fc0c300 100644 (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;