Set the correct "unused" attachment initialLayout
authorPiers Daniell <pdaniell@nvidia.com>
Tue, 4 Dec 2018 19:29:19 +0000 (12:29 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Sun, 9 Dec 2018 14:07:43 +0000 (09:07 -0500)
Before the renderpass the "unused" attachment image is cleared
to a known value and left in the VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
layout. However, the initialLayout field for the "unused"
attachment is set to VK_IMAGE_LAYOUT_UNDEFINED, which might
cause the image contents to be perturbed when the image
is transitioned from VK_IMAGE_LAYOUT_UNDEFINED to the
finalLayout of VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL.

I understand that part of the purpose of these
"unused_attachment" tests is to ensure "unused" attachments
aren't modified by the renderpass. However, there is nothing
in the Vulkan spec that says the layout of "unused"
attachments should be ignored. This was discussed in issue:
https://github.com/KhronosGroup/Vulkan-Docs/issues/821

And the conclusion is that the layout must: not be ignored
for "unused" attacments.

Affects:
dEQP-VK.renderpass*.unused_attachment.*

Components: Vulkan

VK-GL-CTS issue: 1129

Change-Id: Ia6db607538cb191bc8ca6e03f8da9c88bac031c4

external/vulkancts/modules/vulkan/renderpass/vktRenderPassUnusedAttachmentTests.cpp

index 73f7a65..11ea07d 100644 (file)
@@ -116,6 +116,7 @@ Move<VkRenderPass> createRenderPass (const DeviceInterface& vk,
                        VK_IMAGE_LAYOUT_UNDEFINED,                                      // VkImageLayout                                        initialLayout
                        VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL        // VkImageLayout                                        finalLayout
                ),
+               // Unused attachment
                AttachmentDesc (
                        DE_NULL,                                                                        // const void*                                          pNext
                        (VkAttachmentDescriptionFlags)0,                        // VkAttachmentDescriptionFlags         flags
@@ -125,7 +126,7 @@ Move<VkRenderPass> createRenderPass (const DeviceInterface& vk,
                        testParams.storeOp,                                                     // VkAttachmentStoreOp                          storeOp
                        testParams.stencilLoadOp,                                       // VkAttachmentLoadOp                           stencilLoadOp
                        testParams.stencilStoreOp,                                      // VkAttachmentStoreOp                          stencilStoreOp
-                       VK_IMAGE_LAYOUT_UNDEFINED,                                      // VkImageLayout                                        initialLayout
+                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,       // VkImageLayout                                        initialLayout
                        VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL        // VkImageLayout                                        finalLayout
                ),
                // Input attachment