zink: move descriptor update closer to start of draw
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 7 Jul 2021 01:41:51 +0000 (21:41 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 7 Jul 2021 03:06:00 +0000 (03:06 +0000)
this can trigger flushes, so ensure that it doesn't break the cmdbuf

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

src/gallium/drivers/zink/zink_draw.c

index 1936f4e..613fccd 100644 (file)
@@ -434,6 +434,9 @@ zink_draw_vbo(struct pipe_context *pctx,
    ctx->gfx_prim_mode = dinfo->mode;
    update_gfx_program(ctx);
 
+   if (zink_program_has_descriptors(&ctx->curr_program->base))
+      screen->descriptors_update(ctx, false);
+
    if (ctx->gfx_pipeline_state.primitive_restart != dinfo->primitive_restart)
       ctx->gfx_pipeline_state.dirty = true;
    ctx->gfx_pipeline_state.primitive_restart = dinfo->primitive_restart;
@@ -463,9 +466,6 @@ zink_draw_vbo(struct pipe_context *pctx,
 
    barrier_draw_buffers(ctx, dinfo, dindirect, index_buffer);
 
-   if (zink_program_has_descriptors(&ctx->curr_program->base))
-      screen->descriptors_update(ctx, false);
-
    if (ctx->descriptor_refs_dirty[0])
       zink_update_descriptor_refs(ctx, false);