Fix color blend state in multisample tests
If the subpass the pipeline is created with has no color attachment the
attachmentCount of pColorBlendState must also be 0
Components: Vulkan
VK-GL-CTS issue: 3991
Affected tests:
dEQP-VK.pipeline.multisample.alpha_to_coverage_no_color_attachment.*
Change-Id: I37ca31e3114ca3e840759b118365f41b1a9565a1
diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp
index 6615ada..cf3f21c 100644
--- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp
+++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp
@@ -3163,7 +3163,7 @@
for (deUint32 attachmentIdx = 0; attachmentIdx < attachmentCount; attachmentIdx++)
attachments.push_back(m_colorBlendState);
- const VkPipelineColorBlendStateCreateInfo colorBlendStateParams =
+ VkPipelineColorBlendStateCreateInfo colorBlendStateParams =
{
VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO, // VkStructureType sType;
DE_NULL, // const void* pNext;
@@ -3205,6 +3205,18 @@
const deUint32 numSubpasses = m_renderType == RENDER_TYPE_DEPTHSTENCIL_ONLY ? 2u : 1u;
for (deUint32 subpassIdx = 0; subpassIdx < numSubpasses; subpassIdx++)
+ {
+ if (m_renderType == RENDER_TYPE_DEPTHSTENCIL_ONLY)
+ {
+ if (subpassIdx == 0)
+ {
+ colorBlendStateParams.attachmentCount = 0;
+ }
+ else
+ {
+ colorBlendStateParams.attachmentCount = 1;
+ }
+ }
for (deUint32 i = 0u; i < numTopologies; ++i)
{
m_graphicsPipelines.push_back(VkPipelineSp(new Unique<VkPipeline>(makeGraphicsPipeline(vk, // const DeviceInterface& vk
@@ -3227,6 +3239,7 @@
&depthStencilStateParams, // const VkPipelineDepthStencilStateCreateInfo* depthStencilStateCreateInfo
&colorBlendStateParams)))); // const VkPipelineColorBlendStateCreateInfo* colorBlendStateCreateInfo
}
+ }
}
if (m_renderType == RENDER_TYPE_COPY_SAMPLES)