zink: transition resources before resolving
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 1 Nov 2019 09:36:30 +0000 (10:36 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 6 Nov 2019 11:37:36 +0000 (11:37 +0000)
src/gallium/drivers/zink/zink_context.c

index 133c75382dab4c724cf4969271b8fc1cc7d227d5..1fd6a3da5a7df40cb238cd1dea2c884c31b30917 100644 (file)
@@ -1273,6 +1273,14 @@ blit_resolve(struct zink_context *ctx, const struct pipe_blit_info *info)
    zink_batch_reference_resoure(batch, src);
    zink_batch_reference_resoure(batch, dst);
 
+   if (src->layout != VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL)
+      zink_resource_barrier(batch->cmdbuf, src, src->aspect,
+                            VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
+
+   if (dst->layout != VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL)
+      zink_resource_barrier(batch->cmdbuf, dst, dst->aspect,
+                            VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
+
    VkImageResolve region = {};
 
    region.srcSubresource.aspectMask = src->aspect;