zink: add synchronization for buffer clears

cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16098>
(cherry picked from commit fbece25a45)
This commit is contained in:
Mike Blumenkrantz 2022-04-20 15:53:35 -04:00 committed by Dylan Baker
parent ae85860679
commit cfc3827890
2 changed files with 2 additions and 1 deletions

View file

@ -4,7 +4,7 @@
"description": "zink: add synchronization for buffer clears",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -474,6 +474,7 @@ zink_clear_buffer(struct pipe_context *pctx,
zink_batch_no_rp(ctx);
zink_batch_reference_resource_rw(batch, res, true);
util_range_add(&res->base.b, &res->valid_buffer_range, offset, offset + size);
zink_resource_buffer_barrier(ctx, res, VK_ACCESS_TRANSFER_WRITE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
VKCTX(CmdFillBuffer)(batch->state->cmdbuf, res->obj->buffer, offset, size, *(uint32_t*)clear_value);
return;
}