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).
VulkanGen.VulkanSpec.disabled_symbols
VulkanGen.VulkanSpec.spec_aliases
VulkanGen.VulkanSpec.spec_all_noalias
VulkanGen.VulkanSpec.spec_all_semantic_enums
VulkanGen.VulkanSpec.spec_bitmasks
VulkanGen.VulkanSpec.spec_constants
VulkanGen.VulkanSpec.spec_enums
VulkanGen.VulkanSpec.spec_flags
VulkanGen.VulkanSpec.spec_funcs
VulkanGen.VulkanSpec.spec_handles
VulkanGen.VulkanSpec.spec_structs
VulkanGen.VulkanSpec.spec_unions
VulkanGen.VulkanSpec.CreateFunc
VulkanGen.VulkanSpec.DestroyFunc
VulkanGen.VulkanSpec.FieldIterator
VulkanGen.VulkanSpec.FunctionType
VulkanGen.VulkanSpec.PARAM_REQUIREMENT
VulkanGen.VulkanSpec.QueueType
VulkanGen.VulkanSpec.RenderPassInside
VulkanGen.VulkanSpec.RenderPassOutside
VulkanGen.VulkanSpec.RenderPassRequirement
VulkanGen.VulkanSpec.Spec
VulkanGen.VulkanSpec.SpecAlias
VulkanGen.VulkanSpec.SpecBit
VulkanGen.VulkanSpec.SpecBitmask
VulkanGen.VulkanSpec.SpecConstant
VulkanGen.VulkanSpec.SpecEnum
VulkanGen.VulkanSpec.SpecFlag
VulkanGen.VulkanSpec.SpecFunc
VulkanGen.VulkanSpec.SpecFuncParam
VulkanGen.VulkanSpec.SpecHandle
VulkanGen.VulkanSpec.SpecStruct
VulkanGen.VulkanSpec.SpecStructMember
VulkanGen.VulkanSpec.SpecUnion
VulkanGen.VulkanSpec.StructType
VulkanGen.VulkanSpec.hasalias
VulkanGen.VulkanSpec.is_inferable_length
VulkanGen.VulkanSpec.is_length_exception
VulkanGen.VulkanSpec.isalias
VulkanGen.VulkanSpec.translate_c_type
VulkanGen.VulkanSpec.disabled_symbols
— ConstantSome specifications are disabled in the Vulkan headers (see https://github.com/KhronosGroup/Vulkan-Docs/issues/1225).
VulkanGen.VulkanSpec.spec_aliases
— ConstantAll specification aliases.
VulkanGen.VulkanSpec.spec_all_noalias
— ConstantAll specifications except aliases.
VulkanGen.VulkanSpec.spec_all_semantic_enums
— ConstantAll enumerations, regardless of them being bitmasks or regular enum values.
VulkanGen.VulkanSpec.spec_bitmasks
— ConstantSpecification bitmask enumerations.
VulkanGen.VulkanSpec.spec_constants
— ConstantSpecification constants, usually defined in C with #define.
VulkanGen.VulkanSpec.spec_enums
— ConstantSpecification enumerations, excluding bitmasks.
VulkanGen.VulkanSpec.spec_flags
— ConstantFlag types.
VulkanGen.VulkanSpec.spec_funcs
— ConstantSpecification functions.
VulkanGen.VulkanSpec.spec_handles
— ConstantSpecification handle types.
VulkanGen.VulkanSpec.spec_structs
— ConstantSpecification structures.
VulkanGen.VulkanSpec.spec_unions
— ConstantSpecification for union types.
VulkanGen.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 <: Spec
func::SpecFunc
handle::SpecHandle
create_info_struct::Union{Nothing, SpecStruct}
create_info_param::Union{Nothing, SpecFuncParam}
batch::Bool
VulkanGen.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 <: Spec
func::SpecFunc
handle::SpecHandle
destroyed_param::SpecFuncParam
batch::Bool
VulkanGen.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 FieldIterator
root::Any
list::Any
VulkanGen.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 withvkEnumerate
andvkGet
, but not all of them and possibly others).FTYPE_OTHER
: no identified type.
primitive type FunctionType <: Enum{Int32} 32
VulkanGen.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 toNothing
in 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).
primitive type PARAM_REQUIREMENT <: Enum{Int32} 32
VulkanGen.VulkanSpec.QueueType
— TypeQueue type on which a computation can be carried.
abstract type QueueType
VulkanGen.VulkanSpec.RenderPassInside
— TypeThe command can be executed inside a render pass.
struct RenderPassInside <: RenderPassRequirement
VulkanGen.VulkanSpec.RenderPassOutside
— TypeThe command can be executed outside a render pass.
struct RenderPassOutside <: RenderPassRequirement
VulkanGen.VulkanSpec.RenderPassRequirement
— TypeRender pass execution specification for commands.
abstract type RenderPassRequirement
VulkanGen.VulkanSpec.Spec
— TypeEverything that a Vulkan specification can apply to: data structures, functions, parameters...
abstract type Spec
VulkanGen.VulkanSpec.SpecAlias
— TypeSpecification for an alias of the form const <name> = <alias>
.
VulkanGen.VulkanSpec.SpecBit
— TypeSpecification for a bit used in a bitmask.
struct SpecBit <: Spec
name::Symbol
Name of the bit.
position::Int64
Position of the bit.
VulkanGen.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 <: Spec
name::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
VulkanGen.VulkanSpec.SpecConstant
— TypeSpecification for a constant.
struct SpecConstant <: Spec
name::Symbol
Name of the constant.
value::Any
Value of the constant.
VulkanGen.VulkanSpec.SpecEnum
— TypeSpecification for an enumeration type.
struct SpecEnum <: Spec
name::Symbol
Name of the enumeration type.
enums::StructArrays.StructVector{SpecConstant}
Vector of possible enumeration values.
VulkanGen.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 <: Spec
name::Symbol
Name of the flag type.
typealias::Symbol
The type it aliases.
bitmask::Union{Nothing, SpecBitmask}
Bitmask, if applicable.
VulkanGen.VulkanSpec.SpecFunc
— TypeSpecification for a function.
struct SpecFunc <: Spec
name::Symbol
Name of the function.
type::FunctionType
FunctionType
classification.return_type::Union{Nothing, Expr, Symbol}
Return type (void if
Nothing
).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}
VulkanGen.VulkanSpec.SpecFuncParam
— TypeSpecification for a function parameter.
struct SpecFuncParam <: Spec
func::Symbol
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_REQUIREMENT
classification.len::Union{Nothing, Symbol}
Name of the parameter (of the same function) which represents its length.
Nothing
for non-vector types.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.
VulkanGen.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 <: Spec
name::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.
VulkanGen.VulkanSpec.SpecStruct
— TypeSpecification for a structure.
struct SpecStruct <: Spec
name::Symbol
Name of the structure.
type::StructType
StructType
classification.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
pNext
chains for queries.
extends::Vector{Symbol}
Name of the structures it extends, usually done through the original structures'
pNext
argument.members::StructArrays.StructVector{SpecStructMember}
Structure members.
VulkanGen.VulkanSpec.SpecStructMember
— TypeSpecification for a structure parameter.
struct SpecStructMember <: Spec
parent::Symbol
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_REQUIREMENT
classification.len::Union{Nothing, Expr, Symbol}
Name of the member (of the same structure) which represents its length.
Nothing
for 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.
VulkanGen.VulkanSpec.SpecUnion
— TypeSpecification for a union type.
struct SpecUnion <: Spec
name::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 types
selectors::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
pNext
chains for queries.
VulkanGen.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 areturnedonly
structure, usually done throughFTYPE_QUERY
type functions.
primitive type StructType <: Enum{Int32} 32
VulkanGen.VulkanSpec.hasalias
— MethodWhether an alias was built from this name.
hasalias(name) -> Union{Missing, Bool}
VulkanGen.VulkanSpec.is_inferable_length
— MethodTrue if the argument that can be inferred from other arguments.
is_inferable_length(spec::Spec) -> Bool
VulkanGen.VulkanSpec.is_length_exception
— MethodTrue if the argument behaves differently than other length parameters.
is_length_exception(spec::Spec) -> Bool
VulkanGen.VulkanSpec.isalias
— MethodWhether this type is an alias for another name.
isalias(name) -> Bool
VulkanGen.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