Fix ds attachment formats in dynamic rendering with inheritance

In VkCommandBufferInheritanceRenderingInfoKHR the depthAttachmentFormat
must have a depth aspect or be VK_FORMAT_UNDEFINED, and the
stencilAttachmentFormat must have a stencil aspect or be
VK_FORMAT_UNDEFINED

Components: Vulkan

VK-GL-CTS issue: 3970

Affected tests:
dEQP-VK.dynamic_rendering.*

Change-Id: I6d3248643a7a2b1f5761833828889e3484a25a57
diff --git a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp
index bbcec09..d902a99 100644
--- a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp
+++ b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp
@@ -1814,8 +1814,9 @@
 		inheritanceRenderingInfo.pColorAttachmentFormats = colorAttachmentFormats.data();
 		if (pRenderInfo->getDepthStencilAttachment())
 		{
-			inheritanceRenderingInfo.depthAttachmentFormat		= pRenderInfo->getDepthStencilAttachment()->getFormat();
-			inheritanceRenderingInfo.stencilAttachmentFormat	= pRenderInfo->getDepthStencilAttachment()->getFormat();
+			const VkFormat dsFormat = pRenderInfo->getDepthStencilAttachment()->getFormat();
+			inheritanceRenderingInfo.depthAttachmentFormat		= tcu::hasDepthComponent(mapVkFormat(dsFormat).order) ? dsFormat : VK_FORMAT_UNDEFINED;
+			inheritanceRenderingInfo.stencilAttachmentFormat	= tcu::hasStencilComponent(mapVkFormat(dsFormat).order) ? dsFormat : VK_FORMAT_UNDEFINED;
 		}
 		if (pRenderInfo->getColorAttachmentCount())
 			inheritanceRenderingInfo.rasterizationSamples = pRenderInfo->getColorAttachment(0).getSamples();