mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
zink: force scanout sync when mapping scanout resource
this is just for unit tests where the scanout object is redundant and the only time a flush occurs is from stalling on readback Fixes:104603fa76("zink: create separate linear tiling image for scanout") Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10239> (cherry picked from commit874535752b)
This commit is contained in:
parent
4f8cf816ac
commit
35e318f2fa
2 changed files with 19 additions and 1 deletions
|
|
@ -13,7 +13,7 @@
|
|||
"description": "zink: force scanout sync when mapping scanout resource",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "104603fa763c52e98a79785dd514beab949546db"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1003,8 +1003,17 @@ zink_transfer_map(struct pipe_context *pctx,
|
|||
|
||||
if (usage & PIPE_MAP_READ) {
|
||||
zink_transfer_copy_bufimage(ctx, staging_res, res, trans);
|
||||
/* TODO: remove for wsi */
|
||||
struct zink_resource *scanout = NULL;
|
||||
if (res->scanout_obj) {
|
||||
scanout = ctx->flush_res;
|
||||
ctx->flush_res = res;
|
||||
}
|
||||
/* need to wait for rendering to finish */
|
||||
zink_fence_wait(pctx);
|
||||
/* TODO: remove for wsi */
|
||||
if (res->scanout_obj)
|
||||
ctx->flush_res = scanout;
|
||||
}
|
||||
|
||||
ptr = base = map_resource(screen, staging_res);
|
||||
|
|
@ -1019,10 +1028,19 @@ zink_transfer_map(struct pipe_context *pctx,
|
|||
if (zink_resource_has_usage(res, ZINK_RESOURCE_ACCESS_READ))
|
||||
resource_sync_reads(ctx, res);
|
||||
if (zink_resource_has_usage(res, ZINK_RESOURCE_ACCESS_RW)) {
|
||||
/* TODO: remove for wsi */
|
||||
struct zink_resource *scanout = NULL;
|
||||
if (res->scanout_obj) {
|
||||
scanout = ctx->flush_res;
|
||||
ctx->flush_res = res;
|
||||
}
|
||||
if (usage & PIPE_MAP_READ)
|
||||
resource_sync_writes_from_batch_usage(ctx, res);
|
||||
else
|
||||
zink_fence_wait(pctx);
|
||||
/* TODO: remove for wsi */
|
||||
if (res->scanout_obj)
|
||||
ctx->flush_res = scanout;
|
||||
}
|
||||
VkImageSubresource isr = {
|
||||
res->aspect,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue