ctx->batch.state->has_barriers |= can_unorder;
zink_batch_reference_resource_rw(batch, src, false);
zink_batch_reference_resource_rw(batch, dst, true);
+ if (unlikely(zink_debug & ZINK_DEBUG_SYNC)) {
+ VkMemoryBarrier mb;
+ mb.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
+ mb.pNext = NULL;
+ mb.srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT;
+ mb.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT;
+ VKCTX(CmdPipelineBarrier)(cmdbuf,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ 0, 1, &mb, 0, NULL, 0, NULL);
+ }
bool marker = zink_cmd_debug_marker_begin(ctx, cmdbuf, "copy_buffer(%d)", size);
VKCTX(CmdCopyBuffer)(cmdbuf, src->obj->buffer, dst->obj->buffer, 1, ®ion);
zink_cmd_debug_marker_end(ctx, cmdbuf, marker);
}
if (!aspects)
aspects = img->aspect;
+ if (unlikely(zink_debug & ZINK_DEBUG_SYNC)) {
+ VkMemoryBarrier mb;
+ mb.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
+ mb.pNext = NULL;
+ mb.srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT;
+ mb.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT;
+ VKCTX(CmdPipelineBarrier)(cmdbuf,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ 0, 1, &mb, 0, NULL, 0, NULL);
+ }
while (aspects) {
int aspect = 1 << u_bit_scan(&aspects);
region.imageSubresource.aspectMask = aspect;
zink_batch_reference_resource_rw(batch, src, false);
zink_batch_reference_resource_rw(batch, dst, true);
+ if (unlikely(zink_debug & ZINK_DEBUG_SYNC)) {
+ VkMemoryBarrier mb;
+ mb.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
+ mb.pNext = NULL;
+ mb.srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT;
+ mb.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT;
+ VKCTX(CmdPipelineBarrier)(cmdbuf,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ 0, 1, &mb, 0, NULL, 0, NULL);
+ }
bool marker = zink_cmd_debug_marker_begin(ctx, cmdbuf, "copy_image(%s->%s, %dx%dx%d)",
util_format_short_name(psrc->format),
util_format_short_name(pdst->format),