Add subpass external dependency to pushDescriptor tests
authorGary Sweet <gsweet@broadcom.com>
Thu, 6 Dec 2018 09:55:51 +0000 (09:55 +0000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 17 Dec 2018 13:24:16 +0000 (08:24 -0500)
Back to back render passes are used with no pipeline barrier
or external subpass dependency to synchronise the output of
the first to the input of the second.

This change adds an external subpass dependency to ensure that
the render passes are synchronised.

Component: Vulkan
Affects: dEQP-VK.pipeline.push_descriptor.*input_attachment

VK-GL-CTS issue: 1467

Change-Id: Ie42ec31ab393439e7a4c312cfe6dcc40fde82c25

external/vulkancts/modules/vulkan/pipeline/vktPipelinePushDescriptorTests.cpp

index 329d2c4e445e6b63b29da40697f8de01965bdcde..e184ade3afe0ed2f83eaf37c18ec6ddd41a24ed7 100644 (file)
@@ -3783,6 +3783,17 @@ void PushDescriptorInputAttachmentGraphicsTestInstance::init (void)
                        DE_NULL                                                                         // const deUint32*                              pPreserveAttachments
                };
 
+               const VkSubpassDependency               subpassDependency               =
+               {
+                       VK_SUBPASS_EXTERNAL,                                                    // deUint32                             srcSubpass
+                       0,                                                                                              // deUint32                             dstSubpass
+                       VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,  // VkPipelineStageFlags srcStageMask
+                       VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,                  // VkPipelineStageFlags dstStageMask
+                       VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,                   // VkAccessFlags                srcAccessMask
+                       VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_SHADER_READ_BIT,        //      dstAccessMask
+                       VK_DEPENDENCY_BY_REGION_BIT                                             // VkDependencyFlags    dependencyFlags
+               };
+
                const VkRenderPassCreateInfo    renderPassInfo                  =
                {
                        VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,      // VkStructureTypei                                     sType
@@ -3792,8 +3803,8 @@ void PushDescriptorInputAttachmentGraphicsTestInstance::init (void)
                        attachmentDescriptions,                                         // const VkAttachmentDescription*       pAttachments
                        1u,                                                                                     // deUint32                                                     subpassCount
                        &subpassDescription,                                            // const VkSubpassDescription*          pSubpasses
-                       0u,                                                                                     // deUint32                                                     dependencyCount
-                       DE_NULL                                                                         // const VkSubpassDependency*           pDependencies
+                       1u,                                                                                     // deUint32                                                     dependencyCount
+                       &subpassDependency                                                      // const VkSubpassDependency*           pDependencies
                };
 
                m_renderPasses.push_back(VkRenderPassSp(new Unique<VkRenderPass>(createRenderPass(m_vkd, *m_device, &renderPassInfo))));