From ef3dc995a9a57b96c26cbc7f9cfe2124976f04a9 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 29 Sep 2020 15:12:21 -0400 Subject: [PATCH] zink: only flush batches in pipe_context::flush if they actually have work no need to submit command buffers to the queue which have no commands, so we can just proceed to give back an inactive fence object that always returns success Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index eacb739c370..53998f2d74a 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1351,10 +1351,12 @@ zink_flush(struct pipe_context *pctx, struct zink_context *ctx = zink_context(pctx); struct zink_batch *batch = zink_curr_batch(ctx); - flush_batch(ctx); + if (batch->has_work) { + flush_batch(ctx); - if (zink_screen(pctx->screen)->info.have_EXT_transform_feedback && ctx->num_so_targets) - ctx->dirty_so_targets = true; + if (zink_screen(pctx->screen)->info.have_EXT_transform_feedback && ctx->num_so_targets) + ctx->dirty_so_targets = true; + } if (pfence) zink_fence_reference(zink_screen(pctx->screen),