Depth attachment not stored in late_fragment_tests
authorAlex Walters <alex.walters@imgtec.com>
Fri, 25 Jan 2019 18:10:08 +0000 (18:10 +0000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 29 Jan 2019 10:03:04 +0000 (05:03 -0500)
The stencil was stored, but the depth attachment was set to DONT_CARE.
This allows implementations to optimise out the depth store at the end
of the renderpass, when the test is expecting to readback valid depth
values for reference comparison.

Affects:

dEQP-VK.renderpass.suballocation.subpass_dependencies.late_fragment_tests*

Components: Vulkan

VK-GL-CTS issue: 1578

Change-Id: Ie3bb52fa63ff379d70759190460ce8662c4c09ad

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

index 26265dc..1610844 100644 (file)
@@ -2095,9 +2095,13 @@ void initTests (tcu::TestCaseGroup* group, const RenderPassType renderPassType)
                                                const VkFormat                          format                                          (formats[formatNdx]);
                                                const VkSampleCountFlagBits     sampleCount                                     (VK_SAMPLE_COUNT_1_BIT);
                                                const VkAttachmentLoadOp        loadOp                                          (VK_ATTACHMENT_LOAD_OP_CLEAR);
-                                               const VkAttachmentStoreOp       storeOp                                         (VK_ATTACHMENT_STORE_OP_DONT_CARE);
+                                               const VkAttachmentStoreOp       storeOp                                         ((attachmentNdx == attachmentCount - 1)
+                                                                                                                                                                       ? VK_ATTACHMENT_STORE_OP_STORE
+                                                                                                                                                                       : VK_ATTACHMENT_STORE_OP_DONT_CARE);
                                                const VkAttachmentLoadOp        stencilLoadOp                           (VK_ATTACHMENT_LOAD_OP_CLEAR);
-                                               const VkAttachmentStoreOp       stencilStoreOp                          (VK_ATTACHMENT_STORE_OP_STORE);
+                                               const VkAttachmentStoreOp       stencilStoreOp                          ((attachmentNdx == attachmentCount - 1)
+                                                                                                                                                                       ? VK_ATTACHMENT_STORE_OP_STORE
+                                                                                                                                                                       : VK_ATTACHMENT_STORE_OP_DONT_CARE);
                                                const VkImageLayout                     initialLayout                           (VK_IMAGE_LAYOUT_UNDEFINED);
                                                const VkImageLayout                     finalLayout                                     (VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL);