zink: rework unordered_exec handling

previously this would opportunistically promote barriers to the unordered
cmdbuf only if a renderpass was active or there was no access, which
was the wrong approach

instead, opportunistically promote barriers to the unordered cmdbuf
any time it's possible to do so, which is when one of these conditions is true:
* when there is no access to the resource on the current cmdbuf
* when the only access to the resource is in the unordered cmdbuf

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17667>
This commit is contained in:
Mike Blumenkrantz 2022-07-14 11:23:18 -04:00 committed by Marge Bot
parent f0f0611f40
commit d9276ca6d0
1 changed files with 7 additions and 7 deletions

View File

@ -3125,14 +3125,14 @@ resource_check_defer_buffer_barrier(struct zink_context *ctx, struct zink_resour
static inline VkCommandBuffer
get_cmdbuf(struct zink_context *ctx, struct zink_resource *res)
{
if ((res->obj->access && !res->obj->unordered_exec) || !ctx->batch.in_rp || (zink_debug & ZINK_DEBUG_NOREORDER) > 0) {
zink_batch_no_rp(ctx);
res->obj->unordered_exec = false;
return ctx->batch.state->cmdbuf;
if (!zink_resource_usage_matches(res, ctx->batch.state) || res->obj->unordered_exec || (zink_debug & ZINK_DEBUG_NOREORDER) == 0) {
res->obj->unordered_exec = true;
ctx->batch.state->has_barriers = true;
return ctx->batch.state->barrier_cmdbuf;
}
res->obj->unordered_exec = true;
ctx->batch.state->has_barriers = true;
return ctx->batch.state->barrier_cmdbuf;
zink_batch_no_rp(ctx);
res->obj->unordered_exec = false;
return ctx->batch.state->cmdbuf;
}
static void