Use correct barriers in dEQP-VK.api.copy_and_blit.core.*no_cab
authorSlawomir Cygan <slawomir.cygan@intel.com>
Fri, 25 Feb 2022 15:55:50 +0000 (16:55 +0100)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 3 Mar 2022 22:35:14 +0000 (22:35 +0000)
Use transfer read & transfer stage in barrier before using image as
source in vkCmdCopyImage & vkCmdCopyImage2

Components: Vulkan

Affects: dEQP-VK.api.copy_and_blit.*.resolve_image.*no_cab*

VK-GL-CTS Issue: 3542

Change-Id: I2c0d7971c8dcba1f1c01a902c271ce0556196fef

external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp

index 74caa02..6439a43 100644 (file)
@@ -6635,7 +6635,7 @@ void ResolveImageToImage::copyMSImageToMSImage (deUint32 copyArraySize)
                VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,         // VkStructureType                      sType;
                DE_NULL,                                                                        // const void*                          pNext;
                VK_ACCESS_TRANSFER_WRITE_BIT,                           // VkAccessFlags                        srcAccessMask;
-               VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,           // VkAccessFlags                        dstAccessMask;
+               VK_ACCESS_TRANSFER_READ_BIT,                            // VkAccessFlags                        dstAccessMask;
                m_params.dst.image.operationLayout,                     // VkImageLayout                        oldLayout;
                m_params.src.image.operationLayout,                     // VkImageLayout                        newLayout;
                VK_QUEUE_FAMILY_IGNORED,                                        // deUint32                                     srcQueueFamilyIndex;
@@ -6658,7 +6658,7 @@ void ResolveImageToImage::copyMSImageToMSImage (deUint32 copyArraySize)
                if(m_options == COPY_MS_IMAGE_TO_MS_IMAGE_NO_CAB)
                {
                        vk.cmdCopyImage(*m_cmdBuffer, m_multisampledImage.get(), m_params.src.image.operationLayout, m_multisampledCopyNoCabImage.get(), m_params.dst.image.operationLayout, (deUint32)imageCopies.size(), imageCopies.data());
-                       vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1u, &betweenCopyImageBarrier);
+                       vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1u, &betweenCopyImageBarrier);
                        vk.cmdCopyImage(*m_cmdBuffer, m_multisampledCopyNoCabImage.get(), m_params.src.image.operationLayout, m_multisampledCopyImage.get(), m_params.dst.image.operationLayout, (deUint32)imageCopies.size(), imageCopies.data());
                }
                else
@@ -6695,7 +6695,7 @@ void ResolveImageToImage::copyMSImageToMSImage (deUint32 copyArraySize)
                        };
 
                        vk.cmdCopyImage2(*m_cmdBuffer, &copyImageInfo2KHR);
-                       vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1u, &betweenCopyImageBarrier);
+                       vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1u, &betweenCopyImageBarrier);
                        vk.cmdCopyImage2(*m_cmdBuffer, &copyImageInfo2KHRCopy);
                }
                else