Fix oldLayout in image barriers in copy and blit tests
authorziga-lunarg <ziga@lunarg.com>
Thu, 22 Dec 2022 12:52:24 +0000 (13:52 +0100)
committerPiotr Byszewski <piotr.byszewski@mobica.com>
Fri, 13 Jan 2023 13:23:23 +0000 (13:23 +0000)
The same barriers are used twice, but the oldLayout is not updated

Components: Vulkan

VK-GL-CTS issue: 4054

Affected tests:
dEQP-VK.api.copy_and_blit.*

Change-Id: I8fd622846a2c9ce840ec6bfb5a431ae66a5af06f

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

index dd84e18..dbe15b5 100644 (file)
@@ -1151,7 +1151,7 @@ tcu::TestStatus CopyImageToImage::iterate (void)
                }
        }
 
-       const VkImageMemoryBarrier      imageBarriers[]         =
+       VkImageMemoryBarrier    imageBarriers[]         =
        {
                // source image
                {
@@ -1206,6 +1206,8 @@ tcu::TestStatus CopyImageToImage::iterate (void)
                clearColor.float32[2] = 1.0f;
                clearColor.float32[3] = 1.0f;
                vk.cmdClearColorImage(*m_cmdBuffer, m_destination.get(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &clearColor, 1u, &range);
+               imageBarriers[0].oldLayout = imageBarriers[0].newLayout;
+               imageBarriers[1].oldLayout = imageBarriers[1].newLayout;
                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, DE_LENGTH_OF_ARRAY(imageBarriers), imageBarriers);
        }