summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2023-05-11 11:07:26 -0400
committerMarge Bot <emma+marge@anholt.net>2023-05-15 22:52:57 +0000
commit864ccc7a92825a7b9e3bafb35f3875ee2ef72c79 (patch)
tree2f20cd4446efa474b171e47426fb3c3c2dcf531e
parent7466c6fbf2052a1b4142da3e181ed82be888f947 (diff)
downloadmesa-864ccc7a92825a7b9e3bafb35f3875ee2ef72c79.tar.gz
zink: reorder some image copy code
no functional changes, just making other fixes easier to see Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22960>
-rw-r--r--src/gallium/drivers/zink/zink_context.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 5a6f7a3dacc..719428a561f 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -4402,8 +4402,6 @@ zink_resource_copy_region(struct pipe_context *pctx,
} else
unreachable("planar formats not yet handled");
- zink_fb_clears_apply_or_discard(ctx, pdst, (struct u_rect){dstx, dstx + src_box->width, dsty, dsty + src_box->height}, false);
- zink_fb_clears_apply_region(ctx, psrc, zink_rect_from_box(src_box));
region.srcSubresource.aspectMask = src->aspect;
region.srcSubresource.mipLevel = src_level;
@@ -4472,6 +4470,9 @@ zink_resource_copy_region(struct pipe_context *pctx,
region.extent.width = src_box->width;
region.extent.height = src_box->height;
+ zink_fb_clears_apply_or_discard(ctx, pdst, (struct u_rect){dstx, dstx + src_box->width, dsty, dsty + src_box->height}, false);
+ zink_fb_clears_apply_region(ctx, psrc, zink_rect_from_box(src_box));
+
struct zink_batch *batch = &ctx->batch;
zink_resource_setup_transfer_layouts(ctx, src, dst);
VkCommandBuffer cmdbuf = zink_get_cmdbuf(ctx, src, dst);