From 1d0dcba3a29d767ec99aba34f2dd6bcca44c7349 Mon Sep 17 00:00:00 2001 From: Maciej Jesionowski Date: Mon, 23 Oct 2017 12:14:36 +0200 Subject: [PATCH] Add missing barrier to texel_view_compatible tests There was no GPU to Host barrier. GPU writes are not automatically visible to the Host. Affected tests: dEQP-VK.image.texel_view_compatible.compute.* VK-GL-CTS issue: 786 Components: Vulkan Change-Id: I47797add1c5e48dfa1a7c7be8897e822091c2044 --- .../vktImageCompressionTranscodingSupport.cpp | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp b/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp index 7e8a7bf..c6fb56b 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp @@ -1131,21 +1131,28 @@ bool BasicComputeTestInstance::decompressImage (const VkCommandBuffer& cmdBuffer referenceImage.get(), subresourceRange) }; - const VkBufferMemoryBarrier preCopyBufferBarrier[] = + vk.cmdPipelineBarrier(cmdBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, + (VkDependencyFlags)0, 0u, (const VkMemoryBarrier*)DE_NULL, 0u, (const VkBufferMemoryBarrier*)DE_NULL, + DE_LENGTH_OF_ARRAY(postShaderImageBarriers), postShaderImageBarriers); + } + + vk.cmdCopyImageToBuffer(cmdBuffer, resultImage.get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, resultBuffer.get(), 1u, ©Region); + vk.cmdCopyImageToBuffer(cmdBuffer, referenceImage.get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, referenceBuffer.get(), 1u, ©Region); + + { + const VkBufferMemoryBarrier postCopyBufferBarrier[] = { - makeBufferMemoryBarrier( 0, VK_BUFFER_USAGE_TRANSFER_DST_BIT, + makeBufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, resultBuffer.get(), 0ull, bufferSize), - makeBufferMemoryBarrier( 0, VK_BUFFER_USAGE_TRANSFER_DST_BIT, + makeBufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, referenceBuffer.get(), 0ull, bufferSize), }; - vk.cmdPipelineBarrier(cmdBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, - (VkDependencyFlags)0, 0u, (const VkMemoryBarrier*)DE_NULL, DE_LENGTH_OF_ARRAY(preCopyBufferBarrier), preCopyBufferBarrier, - DE_LENGTH_OF_ARRAY(postShaderImageBarriers), postShaderImageBarriers); + vk.cmdPipelineBarrier(cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, + (VkDependencyFlags)0, 0u, (const VkMemoryBarrier*)DE_NULL, DE_LENGTH_OF_ARRAY(postCopyBufferBarrier), postCopyBufferBarrier, + 0u, (const VkImageMemoryBarrier*)DE_NULL); } - vk.cmdCopyImageToBuffer(cmdBuffer, resultImage.get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, resultBuffer.get(), 1u, ©Region); - vk.cmdCopyImageToBuffer(cmdBuffer, referenceImage.get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, referenceBuffer.get(), 1u, ©Region); } endCommandBuffer(vk, cmdBuffer); submitCommandsAndWait(vk, device, queue, cmdBuffer); -- 2.7.4