docs/vulkan: use hawkmoth instead of doxygen
Use the hawkmoth c:auto* directives to incorporate vulkan documentation. Convert @param style parameter descriptions to rst info field lists. Add static stubs for generated headers. Fix a lot of references, in particular the symbols are now in the Sphinx C domain, not C++ domain. Tweak syntax here and there. Based on the earlier work by Erik Faye-Lund <kusmabite@gmail.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
This commit is contained in:
+36
-28
@@ -14,25 +14,25 @@ old Vulkan 1.0 entrypoints. If a driver does not implement them, the
|
||||
following will be implemented in common code in terms of their
|
||||
:ext:`VK_KHR_create_renderpass2` counterparts:
|
||||
|
||||
- :cpp:func:`vkCreateRenderPass`
|
||||
- :cpp:func:`vkCmdBeginRenderPass`
|
||||
- :cpp:func:`vkCmdNextSubpass`
|
||||
- :cpp:func:`vkCmdEndRenderPass`
|
||||
- :c:func:`vkCreateRenderPass`
|
||||
- :c:func:`vkCmdBeginRenderPass`
|
||||
- :c:func:`vkCmdNextSubpass`
|
||||
- :c:func:`vkCmdEndRenderPass`
|
||||
|
||||
|
||||
Common VkRenderPass implementation
|
||||
----------------------------------
|
||||
|
||||
The Vulkan runtime code in Mesa provides a common implementation of
|
||||
:cpp:type:`VkRenderPass` called :cpp:struct:`vk_render_pass` which drivers
|
||||
:c:type:`VkRenderPass` called :c:struct:`vk_render_pass` which drivers
|
||||
can optionally use. Unlike most Vulkan runtime structs, it's not really
|
||||
designed to be used as a base for a driver-specific struct. It does,
|
||||
however, contain all the information passed to
|
||||
:cpp:func:`vkCreateRenderPass2` so it can be used in a driver so long as
|
||||
:c:func:`vkCreateRenderPass2` so it can be used in a driver so long as
|
||||
that driver doesn't need to do any additional compilation at
|
||||
:cpp:func:`vkCreateRenderPass2` time. If a driver chooses to use
|
||||
:cpp:struct:`vk_render_pass`, the Vulkan runtime provides implementations
|
||||
of :cpp:func:`vkCreateRenderPass2` and :cpp:func:`vkDestroyRenderPass`.
|
||||
:c:func:`vkCreateRenderPass2` time. If a driver chooses to use
|
||||
:c:struct:`vk_render_pass`, the Vulkan runtime provides implementations
|
||||
of :c:func:`vkCreateRenderPass2` and :c:func:`vkDestroyRenderPass`.
|
||||
|
||||
|
||||
:ext:`VK_KHR_dynamic_rendering`
|
||||
@@ -42,40 +42,43 @@ For drivers which don't need to do subpass combining, it is recommended
|
||||
that they skip implementing render passes entirely and implement
|
||||
:ext:`VK_KHR_dynamic_rendering` instead. If they choose to do so, the runtime
|
||||
will provide the following, implemented in terms of
|
||||
:cpp:func:`vkCmdBeginRendering` and :cpp:func:`vkCmdEndRendering`:
|
||||
:c:func:`vkCmdBeginRendering` and :c:func:`vkCmdEndRendering`:
|
||||
|
||||
- :cpp:func:`vkCmdBeginRenderPass2`
|
||||
- :cpp:func:`vkCmdNextSubpass2`
|
||||
- :cpp:func:`vkCmdEndRenderPass2`
|
||||
- :c:func:`vkCmdBeginRenderPass2`
|
||||
- :c:func:`vkCmdNextSubpass2`
|
||||
- :c:func:`vkCmdEndRenderPass2`
|
||||
|
||||
We also provide a no-op implementation of
|
||||
:cpp:func:`vkGetRenderAreaGranularity` which returns a render area
|
||||
:c:func:`vkGetRenderAreaGranularity` which returns a render area
|
||||
granularity of 1x1.
|
||||
|
||||
Drivers which wish to use the common render pass implementation in this way
|
||||
**must** also support a Mesa-specific pseudo-extension which optionally
|
||||
provides an initial image layout for each attachment at
|
||||
:cpp:func:`vkCmdBeginRendering` time. This is required for us to combine
|
||||
:c:func:`vkCmdBeginRendering` time. This is required for us to combine
|
||||
render pass clears with layout transitions, often from
|
||||
:cpp:enum:`VK_IMAGE_LAYOUT_UNDEFINED`. On at least Intel and AMD,
|
||||
:c:enum:`VK_IMAGE_LAYOUT_UNDEFINED`. On at least Intel and AMD,
|
||||
combining these transitions with clears is important for performance.
|
||||
|
||||
.. doxygenstruct:: VkRenderingAttachmentInitialLayoutInfoMESA
|
||||
.. c:autostruct:: VkRenderingAttachmentInitialLayoutInfoMESA
|
||||
:file: src/vulkan/runtime/vk_render_pass.h
|
||||
:members:
|
||||
|
||||
Because render passes and subpass indices are also passed into
|
||||
:cpp:func:`vkCmdCreateGraphicsPipelines` and
|
||||
:cpp:func:`vkCmdExecuteCommands` which we can't implement on the driver's
|
||||
:c:func:`vkCmdCreateGraphicsPipelines` and
|
||||
:c:func:`vkCmdExecuteCommands` which we can't implement on the driver's
|
||||
behalf, we provide a couple of helpers for getting the render pass
|
||||
information in terms of the relevant :ext:`VK_KHR_dynamic_rendering`:
|
||||
|
||||
.. doxygenfunction:: vk_get_pipeline_rendering_create_info
|
||||
.. c:autofunction:: vk_get_pipeline_rendering_create_info
|
||||
:file: src/vulkan/runtime/vk_render_pass.h
|
||||
|
||||
.. doxygenfunction:: vk_get_command_buffer_inheritance_rendering_info
|
||||
.. c:autofunction:: vk_get_command_buffer_inheritance_rendering_info
|
||||
:file: src/vulkan/runtime/vk_render_pass.h
|
||||
|
||||
Apart from handling layout transitions, the common render pass
|
||||
implementation mostly ignores input attachments. It is expected that the
|
||||
driver call :cpp:func:`nir_lower_input_attachments` to turn them into
|
||||
driver call :c:func:`nir_lower_input_attachments` to turn them into
|
||||
texturing operations. The driver **must** support texturing from an input
|
||||
attachment at the same time as rendering to it in order to support Vulkan
|
||||
subpass self-dependencies. ``VK_EXT_attachment_feedback_loop_layout`` provides
|
||||
@@ -84,20 +87,25 @@ information on when these self dependencies are present.
|
||||
vk_render_pass reference
|
||||
------------------------
|
||||
|
||||
The following is a reference for the :cpp:struct:`vk_render_pass` structure
|
||||
The following is a reference for the :c:struct:`vk_render_pass` structure
|
||||
and its substructures.
|
||||
|
||||
.. doxygenstruct:: vk_render_pass
|
||||
.. c:autostruct:: vk_render_pass
|
||||
:file: src/vulkan/runtime/vk_render_pass.h
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: vk_render_pass_attachment
|
||||
.. c:autostruct:: vk_render_pass_attachment
|
||||
:file: src/vulkan/runtime/vk_render_pass.h
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: vk_subpass
|
||||
.. c:autostruct:: vk_subpass
|
||||
:file: src/vulkan/runtime/vk_render_pass.h
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: vk_subpass_attachment
|
||||
.. c:autostruct:: vk_subpass_attachment
|
||||
:file: src/vulkan/runtime/vk_render_pass.h
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: vk_subpass_dependency
|
||||
.. c:autostruct:: vk_subpass_dependency
|
||||
:file: src/vulkan/runtime/vk_render_pass.h
|
||||
:members:
|
||||
|
||||
Reference in New Issue
Block a user