Set the correct "unused" attachment initialLayout
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