diff --git a/docs/vulkan/graphics-state.rst b/docs/vulkan/graphics-state.rst index a188f56a2d7..82c02a1979f 100644 --- a/docs/vulkan/graphics-state.rst +++ b/docs/vulkan/graphics-state.rst @@ -21,9 +21,31 @@ When creating a pipeline, the :cpp:func:`vk_graphics_pipeline_state_fill()` function can be used to gather all of the state from the core structures as well as various `pNext` chains into a single state structure. Whenever an extension struct is -missing, a reasonable default value is provided whenever possible. The -usual flow for creating a full graphics pipeline (not library) looks like -this: +missing, a reasonable default value is provided whenever possible. + + +:cpp:func:`vk_graphics_pipeline_state_fill()` automatically handles both +the render pass and dynamic rendering. For drivers which use +:cpp:struct:`vk_render_pass`, the :cpp:struct:`vk_render_pass_state` +structure will be populated as if for dynamic rendering, regardless of +which path is used. Drivers which use their own render pass structure +should parse the render pass, if available, and pass a +:cpp:struct:`vk_subpass_info` into +:cpp:func:`vk_graphics_pipeline_state_fill()` with the relevant information +from the specified subpass. If a render pass is available, +:cpp:struct:`vk_render_pass_state` will be populated with the +:cpp:type:`VkRenderPass` handle and subpass index as well as the +information from the :cpp:struct:`vk_render_pass_state`. If dynamic +rendering is used or the driver does not provide a +:cpp:struct:`vk_subpass_info` structure, :cpp:struct:`vk_render_pass_state` +structure will be populated for dynamic rendering, including color, depth, +and stencil attachment formats. + +.. doxygenstruct:: vk_subpass_info + :members: + +The usual flow for creating a full graphics pipeline (not library) looks +like this: .. code-block:: c diff --git a/src/vulkan/runtime/vk_graphics_state.h b/src/vulkan/runtime/vk_graphics_state.h index 79fc4513e95..560ec245723 100644 --- a/src/vulkan/runtime/vk_graphics_state.h +++ b/src/vulkan/runtime/vk_graphics_state.h @@ -746,7 +746,16 @@ struct vk_graphics_pipeline_state { * we can get this information ourselves. */ struct vk_subpass_info { + /** VkSubpassDescription2::viewMask */ uint32_t view_mask; + + /** + * Aspects of all attachments used as color or depth/stencil attachments + * in the subpass. Input and resolve attachments should not be considered + * when computing the attachments aspect mask. This is used to determine + * whether or not depth/stencil and color blend state are required for a + * pipeline. + */ VkImageAspectFlags attachment_aspects; };