mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
zink: add more explicit fencing for transfer maps
we're using our (primitive) buffer r/w tracking here to ensure that our src buffers are synchronized before we do any kind of read operation on them this is pretty slow in some cases, but it fixes a bunch of piglit tests Reviewed-by: Erik Faye-Lun <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6924>
This commit is contained in:
parent
e3ed624072
commit
8dfb941a4c
1 changed files with 5 additions and 1 deletions
|
|
@ -529,6 +529,8 @@ zink_transfer_map(struct pipe_context *pctx,
|
|||
|
||||
} else {
|
||||
assert(!res->optimial_tiling);
|
||||
if (batch_uses >= ZINK_RESOURCE_ACCESS_WRITE)
|
||||
zink_fence_wait(pctx);
|
||||
VkResult result = vkMapMemory(screen->dev, res->mem, res->offset, res->size, 0, &ptr);
|
||||
if (result != VK_SUCCESS)
|
||||
return NULL;
|
||||
|
|
@ -565,7 +567,9 @@ zink_transfer_unmap(struct pipe_context *pctx,
|
|||
|
||||
if (trans->base.usage & PIPE_MAP_WRITE) {
|
||||
struct zink_context *ctx = zink_context(pctx);
|
||||
|
||||
uint32_t batch_uses = get_resource_usage(res);
|
||||
if (batch_uses >= ZINK_RESOURCE_ACCESS_WRITE)
|
||||
zink_fence_wait(pctx);
|
||||
zink_transfer_copy_bufimage(ctx, res, staging_res, trans, true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue