diff options
author | Vasily Khoruzhick <anarsoul@gmail.com> | 2022-06-07 22:18:12 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-06-08 19:48:02 +0000 |
commit | 2b001b57a08c9527e514aa829616de5ad7354162 (patch) | |
tree | b5a73f46fa2a96b1fba71d613043b4573d5ff497 /src/gallium/auxiliary | |
parent | e6c1426166a1ad32a841340c9a3b1232ed3b626d (diff) |
u_transfer_helper: flush temporary transfer first for MSAA
vtbl->transfer_map may return staging buffer and not real one and it
exposes a problem in MSAA resolve path, since u_transfer_helper does
blit from a resource that is still mapped and it's not flushed yet.
Add explicit flush_region() for a temporary transfer before doing flush
for MSAA resolve.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16923>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/util/u_transfer_helper.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_transfer_helper.c b/src/gallium/auxiliary/util/u_transfer_helper.c index b380c0e46d2..5c3ce26a91f 100644 --- a/src/gallium/auxiliary/util/u_transfer_helper.c +++ b/src/gallium/auxiliary/util/u_transfer_helper.c @@ -492,17 +492,18 @@ u_transfer_helper_transfer_flush_region(struct pipe_context *pctx, if (handle_transfer(ptrans->resource)) { struct u_transfer *trans = u_transfer(ptrans); - flush_region(pctx, ptrans, box); - /* handle MSAA case, since there could be multiple levels of * wrapped transfer, call pctx->transfer_flush_region() * instead of helper->vtbl->transfer_flush_region() */ if (trans->ss) { pctx->transfer_flush_region(pctx, trans->trans, box); + flush_region(pctx, ptrans, box); return; } + flush_region(pctx, ptrans, box); + helper->vtbl->transfer_flush_region(pctx, trans->trans, box); if (trans->trans2) helper->vtbl->transfer_flush_region(pctx, trans->trans2, box); @@ -524,6 +525,8 @@ u_transfer_helper_transfer_unmap(struct pipe_context *pctx, if (!(ptrans->usage & PIPE_MAP_FLUSH_EXPLICIT)) { struct pipe_box box; u_box_2d(0, 0, ptrans->box.width, ptrans->box.height, &box); + if (trans->ss) + pctx->transfer_flush_region(pctx, trans->trans, &box); flush_region(pctx, ptrans, &box); } |