Fix depth/stencil image logging in renderpass tests
authorRicardo Garcia <rgarcia@igalia.com>
Thu, 5 Nov 2020 13:37:32 +0000 (14:37 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 18 Nov 2020 07:55:16 +0000 (02:55 -0500)
Renderpass tests checking results in depth/stencil images containing
both depth and stencil aspects attempt to log the depth/stencil image
when the test fails (but not when the test passes).

When the logging facilities log those depth/stencil images, they convert
them to an image set with two images in order to separate the depth and
stencil views. If this image set is logged as part of another image set
in the log, the logging facilities fail an assertion because image sets
cannot contain other image sets.

Affected tests (only on failures for depth/stencil formats):
dEQP-VK.renderpass*.*allocation.simple.*
dEQP-VK.renderpass*.*allocation.formats.*
dEQP-VK.renderpass*.*allocation.attachment.*
dEQP-VK.renderpass*.*allocation.attachment_allocation.*
dEQP-VK.renderpass*.*allocation.attachment_write_mask.*

Components: Vulkan
VK-GL-CTS issue: 2642

Change-Id: I72ba603e3b42b34730f1f51234f0b6cd64f23da2

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

index 3e76537..1630ad3 100644 (file)
@@ -3798,17 +3798,23 @@ bool logAndVerifyImages (TestLog&                                                                                       log,
 
                                        if (!depthOK || !stencilOK)
                                        {
-                                               log << TestLog::ImageSet("TestImages", "Output depth and stencil attachments, reference images and error masks");
-                                               log << TestLog::Image("Attachment" + de::toString(attachmentNdx) + "Depth", "Attachment " + de::toString(attachmentNdx) + " Depth", depthAccess);
-                                               log << TestLog::Image("Attachment" + de::toString(attachmentNdx) + "Stencil", "Attachment " + de::toString(attachmentNdx) + " Stencil", stencilAccess);
-                                               log << TestLog::Image("AttachmentReference" + de::toString(attachmentNdx), "Attachment reference " + de::toString(attachmentNdx), referenceAttachments[attachmentNdx].getAccess());
+                                               const auto attachmentNdxStr = de::toString(attachmentNdx);
 
-                                               if (!depthOK)
-                                                       log << TestLog::Image("DepthAttachmentError" + de::toString(attachmentNdx), "Depth Attachment Error " + de::toString(attachmentNdx), depthErrorImage.getAccess());
+                                               // Output images.
+                                               log << TestLog::ImageSet("OutputAttachments" + attachmentNdxStr, "Output depth and stencil attachments " + attachmentNdxStr);
+                                               log << TestLog::Image("Attachment" + attachmentNdxStr + "Depth", "Attachment " + attachmentNdxStr + " Depth", depthAccess);
+                                               log << TestLog::Image("Attachment" + attachmentNdxStr + "Stencil", "Attachment " + attachmentNdxStr + " Stencil", stencilAccess);
+                                               log << TestLog::EndImageSet;
 
-                                               if (!stencilOK)
-                                                       log << TestLog::Image("StencilAttachmentError" + de::toString(attachmentNdx), "Stencil Attachment Error " + de::toString(attachmentNdx), stencilErrorImage.getAccess());
+                                               // Reference images. These will be logged as image sets due to having depth and stencil aspects.
+                                               log << TestLog::Image("AttachmentReferences" + attachmentNdxStr, "Reference images " + attachmentNdxStr, referenceAttachments[attachmentNdx].getAccess());
 
+                                               // Error masks.
+                                               log << TestLog::ImageSet("ErrorMasks" + attachmentNdxStr, "Error masks " + attachmentNdxStr);
+                                               if (!depthOK)
+                                                       log << TestLog::Image("DepthAttachmentError" + attachmentNdxStr, "Depth Attachment Error " + attachmentNdxStr, depthErrorImage.getAccess());
+                                               if (!stencilOK)
+                                                       log << TestLog::Image("StencilAttachmentError" + attachmentNdxStr, "Stencil Attachment Error " + attachmentNdxStr, stencilErrorImage.getAccess());
                                                log << TestLog::EndImageSet;
 
                                                attachmentOK = false;