Fix lossy layout transitions in modifier tests
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 16 Mar 2022 20:07:07 +0000 (13:07 -0700)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 7 Apr 2022 17:23:49 +0000 (17:23 +0000)
The test performs several layout transitions that use
VK_IMAGE_LAYOUT_UNDEFINED for the initial layout. The spec says that
these transitions cause images to become undefined. The test expects
defined data from these images however. Replace these initial layouts
with layouts that don't cause data loss.

Components: Vulkan

VK-GL-CTS issue: 3575

Affects: dEQP-VK.drm_format_modifiers.export_import.*
Change-Id: I5e57dd197d461fba800d50239803d525c5334ac4

external/vulkancts/modules/vulkan/modifiers/vktModifiersTests.cpp

index e7cfa3f..aef72f6 100644 (file)
@@ -529,7 +529,7 @@ bool exportImportMemoryExplicitModifiersCase (Context& context, const VkFormat f
                DE_NULL,                                                                        // const void*                          pNext;
                VK_ACCESS_TRANSFER_WRITE_BIT,                           // VkAccessFlags                        srcAccessMask;
                VK_ACCESS_TRANSFER_WRITE_BIT,                           // VkAccessFlags                        dstAccessMask;
-               VK_IMAGE_LAYOUT_UNDEFINED,              // VkImageLayout                        oldLayout;
+               VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,                   // VkImageLayout                        oldLayout;
                VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,                   // VkImageLayout                        newLayout;
                VK_QUEUE_FAMILY_IGNORED,                                        // deUint32                                     srcQueueFamilyIndex;
                VK_QUEUE_FAMILY_IGNORED,                                        // deUint32                                     dstQueueFamilyIndex;
@@ -668,7 +668,7 @@ bool exportImportMemoryExplicitModifiersCase (Context& context, const VkFormat f
 
        copyImageToBuffer(vkd, *cmdBuffer2, *outImage,
                                                                                outputBuffer->get(), tcu::IVec2(imageSize.x(), imageSize.y()),
-                                                                               VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_UNDEFINED, 1);
+                                                                               VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1);
 
        VK_CHECK(vkd.endCommandBuffer(*cmdBuffer2));