Bug Fix: Corrected barriers in the tests dEQP-VK.compute
authorArkadiusz Sarwa <arkadiusz.sarwa@mobica.com>
Tue, 12 Apr 2016 08:54:01 +0000 (10:54 +0200)
committerscygan <slawomir.cygan@intel.com>
Thu, 21 Apr 2016 15:48:13 +0000 (17:48 +0200)
(cherry picked from commit 9b3e984f996ac8d7cc18c16e466a149eef2397e3)

external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp

index 28ef574090820463b27affacf9cb1223d51945f0..0c46806cc4a378f89dbd6cade08143c1da12ecb5 100644 (file)
@@ -766,7 +766,7 @@ tcu::TestStatus CopyImageToSSBOTestInstance::iterate (void)
                const VkBufferMemoryBarrier stagingBufferPostHostWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT, *stagingBuffer, 0ull, bufferSizeBytes);
 
                const VkImageMemoryBarrier imagePreCopyBarrier = makeImageMemoryBarrier(
-                       0u, 0u,
+                       0u, VK_ACCESS_TRANSFER_WRITE_BIT,
                        VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
                        *image, subresourceRange);
 
@@ -2067,6 +2067,11 @@ tcu::TestStatus ImageAtomicOpTestInstance::iterate (void)
 
                const VkBufferMemoryBarrier inputBufferPostHostWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, *inputBuffer, 0ull, inputBufferSizeBytes);
 
+               const VkImageMemoryBarrier imageLayoutBarrier = makeImageMemoryBarrier(
+                       (VkAccessFlags)0, VK_ACCESS_SHADER_WRITE_BIT,
+                       VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL,
+                       *image, subresourceRange);
+
                const VkImageMemoryBarrier imagePreCopyBarrier = makeImageMemoryBarrier(
                        VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
                        VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
@@ -2088,7 +2093,7 @@ tcu::TestStatus ImageAtomicOpTestInstance::iterate (void)
                vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline);
                vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *pipelineLayout, 0u, 1u, &descriptorSet.get(), 0u, DE_NULL);
 
-               vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &inputBufferPostHostWriteBarrier, 0, (const VkImageMemoryBarrier*)DE_NULL);
+               vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &inputBufferPostHostWriteBarrier, 1, &imageLayoutBarrier);
                vk.cmdDispatch(*cmdBuffer, m_imageSize.x(), m_imageSize.y(), 1u);
 
                vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imagePreCopyBarrier);