From 864ccc7a92825a7b9e3bafb35f3875ee2ef72c79 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 11 May 2023 11:07:26 -0400 Subject: [PATCH] zink: reorder some image copy code no functional changes, just making other fixes easier to see Part-of: --- src/gallium/drivers/zink/zink_context.c | 5 +++-- 1 file 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);