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,
0u,
static_cast<deUint32>(colorAttachmentFormats.size()),
colorAttachmentFormats.data(),
- depthStencilFormat,
- depthStencilFormat
+ depthFormat,
+ stencilFormat
};
return makeGraphicsPipeline(vk, // const DeviceInterface& vk