Fix dEQP-VK.renderpass.multisample tests with depth/stencil formats
authorIgor Ostrowski <igor.ostrowski@intel.com>
Thu, 6 Jul 2017 13:55:32 +0000 (15:55 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 21 Jul 2017 16:03:47 +0000 (12:03 -0400)
Remove attachment blend state for d/s images on pipeline creation

Spec says (on VkPipelineColorBlendStateCreateInfo):
"attachmentCount is the number of VkPipelineColorBlendAttachmentState
elements in pAttachments. This value must equal the colorAttachmentCount
for the subpass in which this pipeline is used."

Affects:
dEQP-VK.renderpass.multisample.*

Components: Vulkan

VK-GL-CTS issue: 568

Change-Id: If589e5f6e06cfdf490d85fc410dc5d4381cab701

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

index 3a859fb..ed5063b 100644 (file)
@@ -711,6 +711,7 @@ Move<VkPipelineLayout> createRenderPipelineLayout (const DeviceInterface&   vkd,
 
 Move<VkPipeline> createRenderPipeline (const DeviceInterface&                                                  vkd,
                                                                           VkDevice                                                                                     device,
+                                                                          VkFormat                                                                                     srcFormat,
                                                                           VkRenderPass                                                                         renderPass,
                                                                           VkPipelineLayout                                                                     pipelineLayout,
                                                                           const vk::ProgramCollection<vk::ProgramBinary>&      binaryCollection,
@@ -718,6 +719,9 @@ Move<VkPipeline> createRenderPipeline (const DeviceInterface&                                                       vkd,
                                                                           deUint32                                                                                     height,
                                                                           deUint32                                                                                     sampleCount)
 {
+       const tcu::TextureFormat                format                                          (mapVkFormat(srcFormat));
+       const bool                                              isDepthStencilFormat            (tcu::hasDepthComponent(format.order) || tcu::hasStencilComponent(format.order));
+
        const Unique<VkShaderModule>    vertexShaderModule                      (createShaderModule(vkd, device, binaryCollection.get("quad-vert"), 0u));
        const Unique<VkShaderModule>    fragmentShaderModule            (createShaderModule(vkd, device, binaryCollection.get("quad-frag"), 0u));
        const VkSpecializationInfo              emptyShaderSpecializations      =
@@ -876,8 +880,8 @@ Move<VkPipeline> createRenderPipeline (const DeviceInterface&                                                       vkd,
 
                VK_FALSE,
                VK_LOGIC_OP_COPY,
-               1u,
-               &attachmentBlendState,
+               (isDepthStencilFormat ? 0u : 1u),
+               (isDepthStencilFormat ? DE_NULL : &attachmentBlendState),
                { 0.0f, 0.0f, 0.0f, 0.0f }
        };
        const VkGraphicsPipelineCreateInfo createInfo =
@@ -1406,7 +1410,7 @@ MultisampleRenderPassTestInstance::MultisampleRenderPassTestInstance (Context& c
        , m_framebuffer                                 (createFramebuffer(context.getDeviceInterface(), context.getDevice(), *m_renderPass, *m_srcImageView, m_dstMultisampleImageViews, m_dstSinglesampleImageViews, m_width, m_height))
 
        , m_renderPipelineLayout                (createRenderPipelineLayout(context.getDeviceInterface(), context.getDevice()))
-       , m_renderPipeline                              (createRenderPipeline(context.getDeviceInterface(), context.getDevice(), *m_renderPass, *m_renderPipelineLayout, context.getBinaryCollection(), m_width, m_height, m_sampleCount))
+       , m_renderPipeline                              (createRenderPipeline(context.getDeviceInterface(), context.getDevice(), m_srcFormat, *m_renderPass, *m_renderPipelineLayout, context.getBinaryCollection(), m_width, m_height, m_sampleCount))
 
        , m_splitDescriptorSetLayout    (createSplitDescriptorSetLayout(context.getDeviceInterface(), context.getDevice(), m_srcFormat))
        , m_splitPipelineLayout                 (createSplitPipelineLayout(context.getDeviceInterface(), context.getDevice(), *m_splitDescriptorSetLayout))