diff --git a/gapis/api/vulkan/image_primer.go b/gapis/api/vulkan/image_primer.go index 3003233050..631ac11a18 100644 --- a/gapis/api/vulkan/image_primer.go +++ b/gapis/api/vulkan/image_primer.go @@ -1541,20 +1541,22 @@ func (h *ipRenderHandler) render(job *ipRenderJob, tsk *scratchTask) error { default: return log.Errf(h.sb.ctx, nil, "invalid aspect: %v to render", job.renderTarget.aspect) } - tsk.recordCmdBufCommand(func(commandBuffer VkCommandBuffer) { - h.sb.write(h.sb.cb.VkCmdPipelineBarrier( - commandBuffer, - VkPipelineStageFlags(VkPipelineStageFlagBits_VK_PIPELINE_STAGE_ALL_COMMANDS_BIT), - VkPipelineStageFlags(VkPipelineStageFlagBits_VK_PIPELINE_STAGE_ALL_COMMANDS_BIT), - VkDependencyFlags(0), - 0, - memory.Nullptr, - 0, - memory.Nullptr, - uint32(len(dstBarriers)), - h.sb.MustAllocReadData(dstBarriers).Ptr(), - )) - }) + if len(dstBarriers) > 0 { + tsk.recordCmdBufCommand(func(commandBuffer VkCommandBuffer) { + h.sb.write(h.sb.cb.VkCmdPipelineBarrier( + commandBuffer, + VkPipelineStageFlags(VkPipelineStageFlagBits_VK_PIPELINE_STAGE_ALL_COMMANDS_BIT), + VkPipelineStageFlags(VkPipelineStageFlagBits_VK_PIPELINE_STAGE_ALL_COMMANDS_BIT), + VkDependencyFlags(0), + 0, + memory.Nullptr, + 0, + memory.Nullptr, + uint32(len(dstBarriers)), + h.sb.MustAllocReadData(dstBarriers).Ptr(), + )) + }) + } return nil } @@ -2351,7 +2353,7 @@ func (h *ipBufferCopySession) rolloutBufCopies(queue VkQueue) error { queueFamilyIgnore, // dstQueueFamilyIndex dstImg.VulkanHandle(), // image NewVkImageSubresourceRange(h.sb.ta, // subresourceRange - VkImageAspectFlags(aspect), // aspectMask + ipImageBarrierAspectFlags(aspect, dstImg.Info().Fmt()), // aspectMask level, // baseMipLevel 1, // levelCount layer, // baseArrayLayer