Fix VkPipelineRenderingCreateInfoKHR formats in dynamic rendering tests
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
diff --git a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp
index c2babb0..bbcec09 100644
--- a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp
+++ b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp
@@ -2035,13 +2035,26 @@
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 @@
0u,
static_cast<deUint32>(colorAttachmentFormats.size()),
colorAttachmentFormats.data(),
- depthStencilFormat,
- depthStencilFormat
+ depthFormat,
+ stencilFormat
};
return makeGraphicsPipeline(vk, // const DeviceInterface& vk