Mesa (main): zink: if descriptor updating flushes, re-call draw/compute

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 20 00:37:34 UTC 2021


Module: Mesa
Branch: main
Commit: c88ce857995e304ffedd9002ab4dc62733cbb443
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c88ce857995e304ffedd9002ab4dc62733cbb443

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue May 11 17:49:24 2021 -0400

zink: if descriptor updating flushes, re-call draw/compute

ensure upcoming template is correct for now, but this will eventually
be refactored out

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

---

 src/gallium/drivers/zink/zink_draw.cpp | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp
index c56edb6bb73..47ace7cc396 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -439,8 +439,13 @@ 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 (zink_program_has_descriptors(&ctx->curr_program->base)) {
+      if (screen->descriptors_update(ctx, false)) {
+         /* descriptors have flushed the batch */
+         pctx->draw_vbo(pctx, dinfo, drawid_offset, dindirect, draws, num_draws);
+         return;
+      }
+   }
 
    if (ctx->gfx_pipeline_state.primitive_restart != dinfo->primitive_restart)
       ctx->gfx_pipeline_state.dirty = true;
@@ -751,14 +756,19 @@ zink_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info)
 
    update_compute_program(ctx);
 
+   if (zink_program_has_descriptors(&ctx->curr_compute->base)) {
+      if (screen->descriptors_update(ctx, true)) {
+         /* descriptors have flushed the batch */
+         pctx->launch_grid(pctx, info);
+         return;
+      }
+   }
+
    zink_program_update_compute_pipeline_state(ctx, ctx->curr_compute, info->block);
    VkPipeline prev_pipeline = ctx->compute_pipeline_state.pipeline;
    VkPipeline pipeline = zink_get_compute_pipeline(screen, ctx->curr_compute,
                                                &ctx->compute_pipeline_state);
 
-   if (zink_program_has_descriptors(&ctx->curr_compute->base))
-      screen->descriptors_update(ctx, true);
-
    if (ctx->descriptor_refs_dirty[1])
       zink_update_descriptor_refs(ctx, true);
 



More information about the mesa-commit mailing list