struct zink_resource *src = zink_resource(psrc);
struct zink_context *ctx = zink_context(pctx);
if (dst->base.b.target != PIPE_BUFFER && src->base.b.target != PIPE_BUFFER) {
- VkImageCopy region = {0};
+ VkImageCopy region;
+ /* fill struct holes */
+ memset(®ion, 0, sizeof(region));
if (util_format_get_num_planes(src->base.b.format) == 1 &&
util_format_get_num_planes(dst->base.b.format) == 1) {
/* If neither the calling command’s srcImage nor the calling command’s dstImage
region.extent.width = src_box->width;
region.extent.height = src_box->height;
+ /* ignore no-op copies */
+ if (src == dst &&
+ !memcmp(®ion.dstOffset, ®ion.srcOffset, sizeof(region.srcOffset)) &&
+ !memcmp(®ion.dstSubresource, ®ion.srcSubresource, sizeof(region.srcSubresource)))
+ return;
+
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));