vulkan

Why in the new Vulkan dynamic rendering we specify the stencil and depth attachments separately?


When you create a render pass subpass description you give a pointer to the colour attachments:

VkSubpassDescription::pColorAttachments

and a pointer to the depth and stencil attachment:

VkSubpassDescription::pDepthStencilAttachment;

However in the new dynamic rendering method of the API we can specify them separately:

VkRenderingInfo::pColorAttachments;
VkRenderingInfo::pDepthAttachment;
VkRenderingInfo::pStencilAttachment;

Why is this?


Solution

  • That's reserved for future use cases where the formats for depth and/or stencil may differ. Afaik there is no use-case for something like that yet.