🔴IMPORTANT🔴
Python3.12is required (mainly due to PEP 701).
Automatically generated headers meant to replace the original Vulkan headers with
documentation added to every definition, function, struct, enum, flag,
handle and typedef with an available description in the
Vulkan Registry.
Everything has the original Vulkan generated signature and can be used with the default vulkan library. The script fetches the Vulkan Headers and the Vulkan Registry using git.
The generate.py script can be run with the -N flag to generate an alias in the namespace vk.
This is what an alias may look like:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool)
namespace vk {
/** Full documentation
*/
using CommandPool = VkCommandPool;
}output_pathWhere the vulkan/ and vk_video/ directories will be put.
-S,--styleThe documentation style.-V,--versionThe vulkan headers version to clone (must be a valid git tag).
-N,--namespaceIf the script should generate a namespace alias, like shown above.-F,--forceForces the script to regenerate the headers.
-S, --style Flag options:
CLCLion.CL_NVCLion Nova.RSVisual Studio ReSharper.VSCVisual Studio Code.TXTPlain text.
Along the python script, a generate.cmake file is provided, with the function generate_headers.
These are the arguments of the function:
include(generate.cmake)
# Important! The flags must be a list, not a string:
# This is valid: set(YOUR_FLAGS_HERE -CL -N)
# This is not: set(YOUR_FLAGS_HERE "-CL -N")
generate_headers(
OUTPUT_DIRECTORY ${YOUR_DIRECTORY_HERE}
# Flags is a multi-argument parameter, it's not necessary to
# declare a list outside the function call
FLAGS ${YOUR_FLAGS_HERE}
)If the Vulkan-Loader library is
built together with the headers, DEFINE_VULKAN_TARGET ON should be passed
to the generate_headers function, this will define the Vulkan::Headers target
required by the loader.