Merge vk-gl-cts/vulkan-cts-1.1.5 into vk-gl-cts/master
authorAlexander Galazin <alexander.galazin@arm.com>
Thu, 22 Aug 2019 18:29:52 +0000 (20:29 +0200)
committerAlexander Galazin <alexander.galazin@arm.com>
Thu, 22 Aug 2019 18:29:52 +0000 (20:29 +0200)
Change-Id: I20bbf3397d574e49dd45deb2c337201fa46bfbb3

1  2 
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp

@@@ -2065,9 -2065,15 +2065,15 @@@ public
        void recordCommands (const VkCommandBuffer cmdBuffer)
        {
                const DeviceInterface&  vk                      = m_context.getDeviceInterface();
 -              const VkBufferImageCopy copyRegion      = makeBufferImageCopy(m_resource.getImage().subresourceLayers, m_resource.getImage().extent);
 +              const VkBufferImageCopy copyRegion      = makeBufferImageCopy(m_resource.getImage().extent, m_resource.getImage().subresourceLayers);
  
                vk.cmdCopyImageToBuffer(cmdBuffer, m_resource.getImage().handle, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, **m_hostBuffer, 1u, &copyRegion);
+               // Insert a barrier so data written by the transfer is available to the host
+               {
+                       const VkBufferMemoryBarrier     barrier = makeBufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, **m_hostBuffer, 0u, VK_WHOLE_SIZE);
+                       vk.cmdPipelineBarrier(cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, (VkDependencyFlags)0, 0u, DE_NULL, 1u, &barrier, 0u, DE_NULL);
+               }
        }
  
        SyncInfo getSyncInfo (void) const