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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
This commit is contained in:
Mike Blumenkrantz 2020-09-29 15:12:21 -04:00
parent 9dac191f6e
commit ef3dc995a9
1 changed files with 5 additions and 3 deletions

View File

@ -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),