Fix VkPipelineRenderingCreateInfoKHR formats in dynamic rendering tests
authorziga-lunarg <ziga@lunarg.com>
Fri, 16 Sep 2022 21:07:44 +0000 (23:07 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 6 Oct 2022 21:07:17 +0000 (21:07 +0000)
depthAttachmentFormat must include a depth aspect and stencilAttachment
format must include a stencil aspect

Components: Vulkan

VK-GL-CTS issue: 3952

Affected tests:
dEQP-VK.dynamic_rendering.*

Change-Id: Ifbbadb4f2917fb36fef669f1fc0a0eae6d0c7802

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

index c2babb013bfa7e31bf270ae48b705d57d36a5300..bbcec09fd736fab25ea69ec7357051d608646527 100644 (file)
@@ -2035,13 +2035,26 @@ Move<VkPipeline> createSubpassPipeline (const DeviceInterface&          vk,
        for (deUint32 i = 0; i < renderInfo.getColorAttachmentCount(); ++i)
                colorAttachmentFormats.push_back(renderInfo.getColorAttachment(i).getFormat());
 
-       vk::VkFormat depthStencilFormat = VK_FORMAT_UNDEFINED;
+       vk::VkFormat depthFormat = VK_FORMAT_UNDEFINED;
+       vk::VkFormat stencilFormat = VK_FORMAT_UNDEFINED;
        if (renderInfo.getDepthStencilAttachment())
        {
                const Attachment& attachment = *renderInfo.getDepthStencilAttachment();
-               depthStencilFormat = attachment.getFormat();
+               vk::VkFormat depthStencilFormat = attachment.getFormat();
+               if (depthStencilFormat != VK_FORMAT_UNDEFINED)
+               {
+                       if (tcu::hasDepthComponent(mapVkFormat(depthStencilFormat).order))
+                       {
+                               depthFormat = depthStencilFormat;
+                       }
+                       if (tcu::hasStencilComponent(mapVkFormat(depthStencilFormat).order))
+                       {
+                               stencilFormat = depthStencilFormat;
+                       }
+               }
        }
 
+
        VkPipelineRenderingCreateInfoKHR renderingCreateInfo
        {
                VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR,
@@ -2049,8 +2062,8 @@ Move<VkPipeline> createSubpassPipeline (const DeviceInterface&            vk,
                0u,
                static_cast<deUint32>(colorAttachmentFormats.size()),
                colorAttachmentFormats.data(),
-               depthStencilFormat,
-               depthStencilFormat
+               depthFormat,
+               stencilFormat
        };
 
        return makeGraphicsPipeline(vk,                                                                                         // const DeviceInterface&                        vk