VulkanGen
VulkanGen, the generator project, converts the XML specification into a custom IR, and then generates wrapper code.
Platform-specific wrapping
Some parts of the Vulkan API depend on system headers that are platform-specific; these notably include WSI (Window System Integration) extensions, which allow the developer to attach Vulkan devices to surfaces like windows. These platform-specific dependencies can be grouped into operating systems, notably Windows, MacOS, Linux and BSD. Each of these systems is associated with a set of WSI extensions and has a separate wrapper file with extensions specific to other operating systems removed.
VulkanGen.APIFunctionVulkanGen.WrapperConfigVulkanGen._wrap_implicit_returnVulkanGen.func_ptr_argsVulkanGen.func_ptr_argsVulkanGen.func_ptrsVulkanGen.idiomatic_julia_typeVulkanGen.is_consumedVulkanGen.is_pointer_startVulkanGen.must_return_status_codeVulkanGen.must_return_success_codeVulkanGen.wrap_identifier
VulkanGen.APIFunction — Method
Extend functions that create (or allocate) one or several handles, by exposing the parameters of the associated CreateInfo structures. spec must have one or several CreateInfo arguments.
VulkanGen.WrapperConfig — Type
Configuration structure which allow the selection of specific parts of the Vulkan API.
struct WrapperConfigwrap_core::Bool: Include core API (with core extensions).include_provisional_exts::Bool: Include beta (provisional) exensions. Provisional extensions may break between patch releases.include_platforms::Vector{PlatformType}: Platform-specific families of extensions to include.destfile::String: Path the wrapper will be written to.
VulkanGen._wrap_implicit_return — Function
Build a return expression from an implicit return parameter. Implicit return parameters are pointers that are mutated by the API, rather than returned directly. API functions with implicit return parameters return either nothing or a return code, which is automatically checked and not returned by the wrapper. Such implicit return parameters are Refs or Vectors holding either a base type or a core struct Vk*. They need to be converted by the wrapper to their wrapping type.
_wrap_implicit_return(
return_param::SpecFuncParam;
...
) -> Union{Expr, Symbol}
_wrap_implicit_return(
return_param::SpecFuncParam,
next_types;
with_func_ptr
) -> Union{Expr, Symbol}
VulkanGen.func_ptr_args — Method
Function pointer arguments for a function. Takes the function pointers arguments of the underlying handle if it is a Vulkan constructor, or a unique fptr if that's just a normal Vulkan function.
func_ptr_args(spec::SpecFunc) -> Vector{Expr}
VulkanGen.func_ptr_args — Method
Function pointer arguments for a handle. Includes one fptr_create for the constructor (if applicable), and one fptr_destroy for the destructor (if applicable).
func_ptr_args(spec::SpecHandle) -> Vector{Expr}
VulkanGen.func_ptrs — Method
Corresponding pointer argument for a Vulkan function.
func_ptrs(spec::Spec) -> AbstractVector
VulkanGen.idiomatic_julia_type — Method
Return a new type easier to deal with.
idiomatic_julia_type(spec::Spec) -> Any
VulkanGen.is_consumed — Method
These handle types are consumed by whatever command uses them. From the specification: "The following object types are consumed when they are passed into a Vulkan command and not further accessed by the objects they are used to create.".
is_consumed(spec::SpecHandle)
VulkanGen.is_pointer_start — Method
Represent an integer that gives the start of a C pointer.
is_pointer_start(
spec::Union{SpecFuncParam, SpecStructMember}
) -> Bool
VulkanGen.must_return_status_code — Method
Whether it makes sense to return a success code (i.e. when there are possible errors or non-SUCCESS success codes).
must_return_status_code(spec::SpecFunc) -> Bool
VulkanGen.must_return_success_code — Method
Whether the success code must be returned because it is informative (e.g. notifying of timeouts).
must_return_success_code(spec::SpecFunc) -> Bool
VulkanGen.wrap_identifier — Method
Generate an identifier from a Vulkan identifier, in lower snake case and without pointer prefixes (such as in pNext).
wrap_identifier(identifier) -> Any