VulkanSpec
Going from the XML to the IR is fairly independent of the code generation process, and has been isolated into its own module (VulkanSpec).
VulkanSpec.EXTENSION_SUPPORT_DISABLEDVulkanSpec.EXTENSION_SUPPORT_VULKANVulkanSpec.EXTENSION_SUPPORT_VULKAN_SCVulkanSpec.AuthorsVulkanSpec.BitmasksVulkanSpec.CapabilitiesSPIRVVulkanSpec.ConstantsVulkanSpec.ConstructorsVulkanSpec.CreateFuncVulkanSpec.DestroyFuncVulkanSpec.DestructorsVulkanSpec.EnumsVulkanSpec.ExtensionSupportVulkanSpec.ExtensionsVulkanSpec.ExtensionsSPIRVVulkanSpec.FieldIteratorVulkanSpec.FlagsVulkanSpec.FunctionTypeVulkanSpec.FunctionsVulkanSpec.HandlesVulkanSpec.PARAM_REQUIREMENTVulkanSpec.QueueTypeVulkanSpec.RenderPassOutsideVulkanSpec.RenderPassRequirementVulkanSpec.SpecVulkanSpec.SpecAliasVulkanSpec.SpecBitVulkanSpec.SpecBitmaskVulkanSpec.SpecConstantVulkanSpec.SpecEnumVulkanSpec.SpecFlagVulkanSpec.SpecFuncVulkanSpec.SpecFuncParamVulkanSpec.SpecHandleVulkanSpec.SpecPlatformVulkanSpec.SpecStructVulkanSpec.SpecStructMemberVulkanSpec.SpecUnionVulkanSpec.StructTypeVulkanSpec.StructsVulkanSpec.UnionsVulkanSpec.arglenVulkanSpec.hasaliasVulkanSpec.is_inferable_lengthVulkanSpec.is_length_exceptionVulkanSpec.isaliasVulkanSpec.isenabledVulkanSpec.lenVulkanSpec.translate_c_type
VulkanSpec.EXTENSION_SUPPORT_DISABLED — ConstantDisabled.
VulkanSpec.EXTENSION_SUPPORT_VULKAN — ConstantStandard Vulkan.
VulkanSpec.EXTENSION_SUPPORT_VULKAN_SC — ConstantVulkan SC, for safety-critical systems.
VulkanSpec.Authors — TypeSpecification authors.
struct Authors <: VulkanSpec.Collection{AuthorTag}data::StructArrays.StructVector{AuthorTag, @NamedTuple{tag::Vector{String}, author::Vector{String}}, Int64}
VulkanSpec.Bitmasks — TypeAPI bitmasks.
struct Bitmasks <: VulkanSpec.Collection{SpecBitmask}data::StructArrays.StructVector{SpecBitmask, @NamedTuple{name::Vector{Symbol}, bits::Vector{StructArrays.StructVector{SpecBit}}, combinations::Vector{StructArrays.StructVector{SpecBitCombination}}, width::Vector{Integer}}, Int64}
VulkanSpec.CapabilitiesSPIRV — TypeSPIR-V capabilities.
struct CapabilitiesSPIRV <: VulkanSpec.Collection{VulkanSpec.SpecCapabilitySPIRV}data::StructArrays.StructVector{VulkanSpec.SpecCapabilitySPIRV, @NamedTuple{name::Vector{Symbol}, promoted_to::Vector{Union{Nothing, VersionNumber}}, enabling_extensions::Vector{Vector{String}}, enabling_features::Vector{Vector{VulkanSpec.FeatureCondition}}, enabling_properties::Vector{Vector{VulkanSpec.PropertyCondition}}}, Int64}
VulkanSpec.Constants — TypeAPI constants, usually defined in C with #define.
struct Constants <: VulkanSpec.Collection{SpecConstant}data::StructArrays.StructVector{SpecConstant, @NamedTuple{name::Vector{Symbol}, value::Vector{Any}}, Int64}
VulkanSpec.Constructors — TypeAPI handle constructors.
struct Constructors <: VulkanSpec.Collection{CreateFunc}data::StructArrays.StructVector{CreateFunc, @NamedTuple{func::Vector{SpecFunc}, handle::Vector{SpecHandle}, create_info_struct::Vector{Union{Nothing, SpecStruct}}, create_info_param::Vector{Union{Nothing, SpecFuncParam}}, batch::Vector{Bool}}, Int64}
VulkanSpec.CreateFunc — TypeFunction func that creates a handle from a create info structure create_info_struct passed as the value of the parameter create_info_param.
If batch is true, then func expects a list of multiple create info structures and will create multiple handles at once.
struct CreateFunc <: Specfunc::SpecFunchandle::SpecHandlecreate_info_struct::Union{Nothing, SpecStruct}create_info_param::Union{Nothing, SpecFuncParam}batch::Bool
VulkanSpec.DestroyFunc — TypeFunction func that destroys a handle passed as the value of the parameter destroyed_param.
If batch is true, then func expects a list of multiple handles and will destroy all of them at once.
struct DestroyFunc <: Specfunc::SpecFunchandle::SpecHandledestroyed_param::SpecFuncParambatch::Bool
VulkanSpec.Destructors — TypeAPI handle destructors.
struct Destructors <: VulkanSpec.Collection{DestroyFunc}data::StructArrays.StructVector{DestroyFunc, @NamedTuple{func::Vector{SpecFunc}, handle::Vector{SpecHandle}, destroyed_param::Vector{SpecFuncParam}, batch::Vector{Bool}}, Int64}
VulkanSpec.Enums — TypeAPI enumerated values, excluding bitmasks.
struct Enums <: VulkanSpec.Collection{SpecEnum}data::StructArrays.StructVector{SpecEnum, @NamedTuple{name::Vector{Symbol}, enums::Vector{StructArrays.StructVector{SpecConstant}}}, Int64}
VulkanSpec.ExtensionSupport — TypeDescribes what type of support an extension has per the specification.
struct ExtensionSupport <: BitMask{UInt32}val::UInt32
VulkanSpec.Extensions — TypeAPI extensions.
struct Extensions <: VulkanSpec.Collection{SpecExtension}data::StructArrays.StructVector{SpecExtension, @NamedTuple{name::Vector{String}, type::Vector{VulkanSpec.ExtensionType}, requirements::Vector{Vector{String}}, support::Vector{VulkanSpec.ExtensionSupport}, author::Vector{Union{Nothing, String}}, symbols::Vector{Vector{Symbol}}, platform::Vector{PlatformType}, is_provisional::Vector{Bool}, promoted_to::Vector{Union{Nothing, VersionNumber, String}}, deprecated_by::Vector{Union{Nothing, String}}}, Int64}
VulkanSpec.ExtensionsSPIRV — TypeSPIR-V extensions.
struct ExtensionsSPIRV <: VulkanSpec.Collection{VulkanSpec.SpecExtensionSPIRV}data::StructArrays.StructVector{VulkanSpec.SpecExtensionSPIRV, @NamedTuple{name::Vector{String}, promoted_to::Vector{Union{Nothing, VersionNumber}}, enabling_extensions::Vector{Vector{String}}}, Int64}
VulkanSpec.FieldIterator — TypeIterate through function or struct specification fields from a list of fields. list is a sequence of fields to get through from root.
struct FieldIteratorroot::Union{SpecFuncParam, SpecStructMember}list::Vector{Symbol}structs::Structs
VulkanSpec.Flags — TypeAPI flags.
struct Flags <: VulkanSpec.Collection{SpecFlag}data::StructArrays.StructVector{SpecFlag, @NamedTuple{name::Vector{Symbol}, typealias::Vector{Symbol}, bitmask::Vector{Union{Nothing, SpecBitmask}}}, Int64}
VulkanSpec.FunctionType — TypeFunction type classification.
Types:
FTYPE_CREATE: constructor (functions that begin withvkCreate).FTYPE_DESTROY: destructor (functions that begin withvkDestroy).FTYPE_ALLOCATE: allocator (functions that begin withvkAllocate).FTYPE_FREE: deallocator (functions that begin withvkFree).FTYPE_COMMAND: Vulkan command (functions that begin withvkCmd).FTYPE_QUERY: used to query parameters, returned directly or indirectly through pointer mutation (typically, functions that begin withvkEnumerateandvkGet, but not all of them and possibly others).FTYPE_OTHER: no identified type.
primitive type FunctionType <: Enum{Int32} 32VulkanSpec.Functions — TypeAPI functions.
struct Functions <: VulkanSpec.Collection{SpecFunc}data::StructArrays.StructVector{SpecFunc, @NamedTuple{name::Vector{Symbol}, type::Vector{FunctionType}, return_type::Vector{Union{Nothing, Expr, Symbol}}, render_pass_compatibility::Vector{Vector{RenderPassRequirement}}, queue_compatibility::Vector{Vector{QueueType}}, params::Vector{StructArrays.StructVector{SpecFuncParam}}, success_codes::Vector{Vector{Symbol}}, error_codes::Vector{Vector{Symbol}}}, Int64}
VulkanSpec.Handles — TypeAPI handle types.
struct Handles <: VulkanSpec.Collection{SpecHandle}data::StructArrays.StructVector{SpecHandle, @NamedTuple{name::Vector{Symbol}, parent::Vector{Union{Nothing, Symbol}}, is_dispatchable::Vector{Bool}}, Int64}
VulkanSpec.PARAM_REQUIREMENT — TypeParameter requirement. Applies both to struct members and function parameters.
Requirement types:
OPTIONAL: may have its default zero (or nullptr) value, acting as a sentinel value (similar toNothingin Julia).REQUIRED: must be provided, no sentinel value is allowed.POINTER_OPTIONAL: is a pointer which may be null, but must have valid elements if provided.POINTER_REQUIRED: must be a valid pointer, but its elements are optional (e.g. are allowed to be sentinel values).POINTER_FULLY_OPTIONAL: may be null, or a pointer with optional elements (e.g. are allowed to be sentinel values).
primitive type PARAM_REQUIREMENT <: Enum{Int32} 32VulkanSpec.QueueType — TypeQueue type on which a computation can be carried.
abstract type QueueTypeVulkanSpec.RenderPassOutside — TypeThe command can be executed outside a render pass.
struct RenderPassOutside <: RenderPassRequirementVulkanSpec.RenderPassRequirement — TypeRender pass execution specification for commands.
abstract type RenderPassRequirementVulkanSpec.Spec — TypeEverything that a Vulkan specification can apply to: data structures, functions, parameters...
abstract type SpecVulkanSpec.SpecAlias — TypeSpecification for an alias of the form const <name> = <alias>.
struct SpecAlias{S<:Spec} <: Specname::Symbol: Name of the new alias.alias::Spec: Aliased specification element.
VulkanSpec.SpecBit — TypeSpecification for a bit used in a bitmask.
struct SpecBit <: Specname::Symbol: Name of the bit.position::Int64: Position of the bit.
VulkanSpec.SpecBitmask — TypeSpecification for a bitmask type that must be formed through a combination of bits.
Is usually an alias for a UInt32 type which carries meaning through its bits.
struct SpecBitmask <: Specname::Symbol: Name of the bitmask type.bits::StructArrays.StructVector{SpecBit}: Valid bits that can be combined to form the final bitmask value.combinations::StructArrays.StructVector{SpecBitCombination}width::Integer
VulkanSpec.SpecConstant — TypeSpecification for a constant.
struct SpecConstant <: Specname::Symbol: Name of the constant.value::Any: Value of the constant.
VulkanSpec.SpecEnum — TypeSpecification for an enumeration type.
struct SpecEnum <: Specname::Symbol: Name of the enumeration type.enums::StructArrays.StructVector{SpecConstant}: Vector of possible enumeration values.
VulkanSpec.SpecFlag — TypeSpecification for a flag type name that is a type alias of typealias. Can be associated with a bitmask structure, in which case the bitmask number is set to the corresponding SpecBitmask.
struct SpecFlag <: Specname::Symbol: Name of the flag type.typealias::Symbol: The type it aliases.bitmask::Union{Nothing, SpecBitmask}: Bitmask, if applicable.
VulkanSpec.SpecFunc — TypeSpecification for a function.
struct SpecFunc <: Specname::Symbol: Name of the function.type::FunctionType:FunctionTypeclassification.return_type::Union{Nothing, Expr, Symbol}: Return type (void ifNothing).render_pass_compatibility::Vector{RenderPassRequirement}: Whether the function can be executed inside a render pass, outside, or both. Empty if not specified, in which case it is equivalent to both inside and outside.queue_compatibility::Vector{QueueType}: Type of queues on which the function can be executed. Empty if not specified, in which case it is equivalent to being executable on all queues.params::StructArrays.StructVector{SpecFuncParam}: Function parameters.success_codes::Vector{Symbol}error_codes::Vector{Symbol}
VulkanSpec.SpecFuncParam — TypeSpecification for a function parameter.
struct SpecFuncParam <: Specparent::Any: Name of the parent function.name::Symbol: Identifier.type::Union{Expr, Symbol}: Expression of its idiomatic Julia type.is_constant::Bool: If constant, cannot be mutated by Vulkan functions.is_externsync::Bool: Whether it must be externally synchronized before calling the function.requirement::PARAM_REQUIREMENT:PARAM_REQUIREMENTclassification.len::Union{Nothing, Expr, Symbol}: Name of the parameter (of the same function) which represents its length.Nothingfor non-vector types. Can be an expression of a parameter.arglen::Vector{Symbol}: Name of the parameters (of the same function) it is a length of.autovalidity::Bool: Whether automatic validity documentation is enabled. If false, this means that the parameter may be an exception to at least one Vulkan convention.
VulkanSpec.SpecHandle — TypeSpecification for handle types.
A handle may possess a parent. In this case, the handle can only be valid if its parent is valid.
Some handles are dispatchable, which means that they are represented as opaque pointers. Non-dispatchable handles are 64-bit integer types, and may encode information directly into their value.
struct SpecHandle <: Specname::Symbol: Name of the handle type.parent::Union{Nothing, Symbol}: Name of the parent handle, if any.is_dispatchable::Bool: Whether the handle is dispatchable or not.
VulkanSpec.SpecPlatform — TypeAPI platforms.
struct SpecPlatform <: Spectype::PlatformTypedescription::String
VulkanSpec.SpecStruct — TypeSpecification for a structure.
struct SpecStruct <: Specname::Symbol: Name of the structure.type::StructType:StructTypeclassification.is_returnedonly::Bool: Whether the structure is only meant to be filled in by Vulkan functions, as opposed to being constructed by the user.Note that the API may still request the user to provide an initialized structure, notably as part of
pNextchains for queries.
extends::Vector{Symbol}: Name of the structures it extends, usually done through the original structures'pNextargument.members::StructArrays.StructVector{SpecStructMember}: Structure members.
VulkanSpec.SpecStructMember — TypeSpecification for a structure parameter.
struct SpecStructMember <: Specparent::Any: Name of the parent structure.name::Symbol: Identifier.type::Union{Expr, Symbol}: Expression of its idiomatic Julia type.is_constant::Bool: If constant, cannot be mutated by Vulkan functions.is_externsync::Bool: Whether it must be externally synchronized before calling any function which uses the parent structure.requirement::PARAM_REQUIREMENT:PARAM_REQUIREMENTclassification.len::Union{Nothing, Expr, Symbol}: Name of the member (of the same structure) which represents its length.Nothingfor non-vector types.arglen::Vector{Union{Expr, Symbol}}: Name of the members (of the same structure) it is a length of.autovalidity::Bool: Whether automatic validity documentation is enabled. If false, this means that the member may be an exception to at least one Vulkan convention.
VulkanSpec.SpecUnion — TypeSpecification for a union type.
struct SpecUnion <: Specname::Symbol: Name of the union type.types::Vector{Union{Expr, Symbol}}: Possible types for the union.fields::Vector{Symbol}: Fields which cast the struct into the union typesselectors::Vector{Symbol}: Selector values, if any, to determine the type of the union in a given context (function call for example).is_returnedonly::Bool: Whether the structure is only meant to be filled in by Vulkan functions, as opposed to being constructed by the user.Note that the API may still request the user to provide an initialized structure, notably as part of
pNextchains for queries.
VulkanSpec.StructType — TypeStructure type classification.
Types:
STYPE_CREATE_INFO: holds constructor parameters (structures that end withCreateInfo).STYPE_ALLOCATE_INFO: holds allocator parameters (structures that end withAllocateInfo).STYPE_GENERIC_INFO: holds parameters for another function or structure (structures that end withInfo, excluding those falling into the previous types).STYPE_DATA: usually represents user or Vulkan data.STYPE_PROPERTY: is a property returned by Vulkan in areturnedonlystructure, usually done throughFTYPE_QUERYtype functions.
primitive type StructType <: Enum{Int32} 32VulkanSpec.Structs — TypeAPI structure types.
struct Structs <: VulkanSpec.Collection{SpecStruct}data::StructArrays.StructVector{SpecStruct, @NamedTuple{name::Vector{Symbol}, type::Vector{StructType}, is_returnedonly::Vector{Bool}, extends::Vector{Vector{Symbol}}, members::Vector{StructArrays.StructVector{SpecStructMember}}}, Int64}
VulkanSpec.Unions — TypeAPI union types.
struct Unions <: VulkanSpec.Collection{SpecUnion}data::StructArrays.StructVector{SpecUnion, @NamedTuple{name::Vector{Symbol}, types::Vector{Vector{Union{Expr, Symbol}}}, fields::Vector{Vector{Symbol}}, selectors::Vector{Vector{Symbol}}, is_returnedonly::Vector{Bool}}, Int64}
VulkanSpec.arglen — Functionarglen(queueCount)Return the function parameters or struct members whose length is encoded by the provided argument.
VulkanSpec.hasalias — MethodWhether an alias was built from this name.
hasalias(
name,
aliases::VulkanSpec.Aliases
) -> Union{Missing, Bool}
VulkanSpec.is_inferable_length — MethodTrue if the argument that can be inferred from other arguments.
is_inferable_length(spec::SpecStructMember) -> Bool
VulkanSpec.is_length_exception — MethodTrue if the argument behaves differently than other length parameters, and requires special care.
is_length_exception(spec::SpecStructMember) -> Bool
VulkanSpec.isalias — MethodWhether this type is an alias for another name.
isalias(name, aliases::VulkanSpec.Aliases) -> Bool
VulkanSpec.isenabled — MethodReturn whether an extension is enabled for standard Vulkan - that is, a given symbol x is either core or is from an extension that has not been disabled, or is not exclusive to Vulkan SC.
isenabled(x, extensions::Extensions) -> Any
VulkanSpec.len — Functionlen(pCode)Return the function parameter or struct member which describes the length of the provided pointer argument. When the length is more complex than a simple argument, i.e. is a function of another parameter, missing is returned. In this case, refer to the .len field of the argument to get the correct Expr.
VulkanSpec.translate_c_type — MethodSemantically translate C types to their Julia counterpart. Note that since it is a semantic translation, translated types do not necessarily have the same layout, e.g. VkBool32 => Bool (8 bits).
translate_c_type(ctype) -> Any