1// Copyright 2013-2023 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5// Core versions and extensions to enable
6// Must be included before the header and attribs.adoc
7include::{generated}/specattribs.adoc[]
8
9= The Khronos^®^ Vulkan^®^ API Registry
10Jon Leech
11:data-uri:
12:icons: font
13:toc2:
14:toclevels: 3
15:numbered:
16:source-highlighter: rouge
17:rouge-style: github
18:doctype: book
19:imagewidth: 800
20:fullimagewidth: width="800"
21:attribute-missing: warn
22:cl: :
23
24// Various special / math symbols. This is easier to edit with than Unicode.
25include::{config}/attribs.adoc[]
26
27:leveloffset: 1
28
29<<<<
30
31include::{config}/copyright-ccby.adoc[]
32
33<<<<
34
35[[introduction]]
36= Introduction
37
38This document describes the Khronos Vulkan API Registry schema, and provides
39some additional information about using the registry and scripts to generate
40a variety of outputs, including C header files as well as several types of
41asciidoc include files used in the Vulkan API specification and reference
42pages.
43The underlying XML files and scripts are located on the Khronos public
44GitHub server at URL
45
46https://github.com/KhronosGroup/Vulkan-Docs
47
48The authoritative copy of the Registry is maintained in the default branch,
49currently `main`.
50
51The registry uses an XML representation of the Vulkan API, together with a
52set of Python scripts to manipulate the registry once loaded.
53The scripts rely on the Python `etree` package to parse and operate on XML.
54An XML schema and validator target are included.
55
56The schema is based on, but not identical to that used for the previously
57published OpenGL, OpenGL ES and EGL API registries.
58It was extended to represent additional types and concepts not needed for
59those APIs, such as structure and enumerant types, as well as additional
60types of registered information specific to Vulkan.
61
62The Vulkan C header files generated from the registry are checked into a
63separate repository under
64
65https://github.com/KhronosGroup/Vulkan-Headers/
66
67
68== Schema Choices
69
70The XML schema is not pure XML all the way down.
71In particular, command return types/names and parameters, and structure
72members, are described in mixed-mode tag containing C declarations of the
73appropriate information, with some XML nodes annotating particular parts of
74the declaration such as its base type and name.
75This choice is based on prior experience with the SGI `.spec` file format
76used to describe OpenGL, and greatly eases human reading and writing the
77XML, and generating C-oriented output.
78The cost is that people writing output generators for other languages will
79have to include enough logic to parse the C declarations and extract the
80relevant information.
81
82People who do not find the supplied Python scripts to suit their needs are
83likely to write their own parsers, interpreters, and/or converters operating
84on the registry XML.
85We hope that we have provided enough information in this document, the RNC
86schema (`registry.rnc`), and comments in the Registry (`vk.xml`) itself to
87enable such projects.
88If not and you need clarifications; if you have other problems using the
89registry; or if you have proposed changes and enhancements, then please file
90issues on Khronos' public GitHub project at
91
92https://github.com/KhronosGroup/Vulkan-Docs/issues
93
94Please tag your issues with `[Registry]` in the subject line to help us
95categorize them.
96
97
98[[introduction-normative]]
99== Normative References
100
101Normative references are references to external documents or resources to
102which documentation authors must comply.
103
104[[vulkan-styleguide]] Jon Leech and Tobias Hector.
105_Vulkan Documentation and Extensions: Procedures and Conventions_ (February
10626, 2023).
107https://registry.khronos.org/vulkan/specs/1.3/styleguide.html .
108
109[[vulkan-spec]] Khronos Vulkan Working Group.
110_Vulkan 1.3.242 - A Specification_ (February 26, 2023).
111https://registry.khronos.org/vulkan/ .
112
113
114[[starting]]
115= Getting Started
116
117See
118https://gitlab.khronos.org/vulkan/vulkan/blob/main/xml/README.adoc[`xml/README.adoc`]
119in the `Vulkan-Docs` repository for information on required toolchain
120components such as Python 3, pass:[g++], and GNU make.
121
122Once you have the right tools installed, perform the following steps:
123
124  * Check out the `Vulkan-Docs` repository linked above from Khronos GitHub
125    (there are instructions at the link)
126  * `cd` to the root directory in your checked-out repo
127  * Switch to the default branch (`main`).
128  * Invoke `make clean ; make install ; make test`
129
130This should regenerate `vulkan_core.h` and a variety of platform-specific
131headers, install them in `../include/vulkan/`, and verify that the headers
132build properly.
133If you build at the latest repository tag, the resulting headers should be
134identical to the latest versions in the
135link:https://github.com/KhronosGroup/Vulkan-Headers/[Vulkan-Headers
136repository].
137
138The `install` target also generates source code for a simple extension
139loader library in `../src/ext_loader/`.
140
141Other Makefile targets in `xml/` include:
142
143  * `validate` - validate `vk.xml` against the XML schema.
144    Recommended if you are making nontrivial changes.
145  * The asciidoc includes used by the <<vulkan-spec, Vulkan API
146    Specification>> and Reference Pages are built using the 'make generated'
147    target in the parent directory Makefile, although they use the scripts
148    and XML in this directory.
149    These files are generated dynamically when building the specs, since
150    their contents depend on the exact set of extensions the Specification
151    is being built to include.
152
153If you just want to modify the API, changing `vk.xml` and running `make`
154should be all that is needed.
155See <<examples>> for some examples of modifying the XML.
156
157If you want to use the registry for reasons other than generating the header
158file, extension loader, and asciidoc includes, or to generate headers for
159languages other than C, start with the Makefile rules and the files
160`vk.xml` and scripts `genvk.py`, `reg.py`, and `generator.py`.
161The scripts are described below and are all located in the `scripts`
162directory under the repository root.
163
164== Header Generation Script - `genvk.py`
165
166When generating header files using the `genvk.py` script, an API name and
167profile name are required, as shown in the Makefile examples.
168Additionally, specific API versions and extensions can be required or
169excluded.
170Based on this information, the generator script extracts the relevant
171interfaces and creates a C-language header file for them.
172`genvk.py` contains predefined generator options for the current
173<<vulkan-spec, Vulkan API Specification>> release.
174
175The generator script is intended to be generalizable to other languages by
176writing new generator classes.
177Such generators would have to rewrite the C types and definitions in the XML
178to something appropriate to their language.
179
180
181== Registry Processing Script - `reg.py`
182
183XML processing is done in `reg.py`, which contains several objects and
184methods for loading registries and extracting interfaces and extensions for
185use in header generation.
186There is some internal documentation in the form of comments, although
187nothing more extensive exists yet.
188
189
190== Output Generator Script - `generator.py`
191
192Once the registry is loaded, the `COutputGenerator` class defined in
193`generator.py` is used to create a header file.
194The `DocOutputGenerator` class is used to create the asciidoc include files.
195Output generators for other purposes can be added as needed.
196There are a variety of output generators included:
197
198  * `cgenerator.py` - generate C header file
199  * `docgenerator.py` - generate asciidoc includes for APIs
200  * `hostsyncgenerator.py` - generate host sync table includes for APIs
201  * `validitygenerator.py` - generate validity language includes
202  * `pygenerator.py` - generate a Python dictionary-based encoding of
203    portions of the registry, used during spec generation
204  * `extensionStubSource.py` - generate a simple C extension loader.
205
206
207[[schema]]
208= Vulkan Registry Schema
209
210The format of the Vulkan registry is a top level tag:registry tag containing
211tag:types, tag:enums, tag:commands, tag:feature, and tag:extension tags
212describing the different elements of an API, as explained below.
213This description corresponds to a formal Relax NG schema file,
214`registry.rnc`, against which the XML registry files can be validated.
215
216At present the only registry in this schema is the core Vulkan API registry,
217`vk.xml`.
218
219
220[[schema:profile]]
221== Profiles
222
223Types and enumerants can have different definitions depending on the API
224profile requested.
225This capability is not used in the current Vulkan API but may be in the
226future.
227Features and extensions can include some elements conditionally depending on
228the API profile requested.
229
230
231[[schema:apiname]]
232== API Names
233
234Specific API versions features and extensions can be tagged as belonging to
235to classes of features with the use of _API names_.
236This is intended to allow multiple closely-related API specifications in the
237same family - such as desktop and mobile specifications - to share the same
238XML.
239An API name is an arbitrary alphanumeric string, although it should be
240chosen to match the corresponding API.
241For example, Vulkan and OpenXR use `vulkan` and `openxr` as their API names,
242respectively.
243
244The attr:api attribute of the tag:feature tag and the attr:supported
245attribute of the tag:extensions tag must be comma-separated lists of one or
246more API names, all of which match that feature or extension.
247When generating headers and other artifacts from the XML, an API name may be
248specified to the processing scripts, causing the selection of only those
249features and extensions whose API names match the specified name.
250
251Several other tags for defining types and groups of types also support
252attr:api attributes.
253If present, the attribute value must be a comma-separated list of one or
254more API names.
255This allows specializing a definition for different, closely related APIs.
256
257
258[[schema:root]]
259= Registry Root (tag:registry Tag)
260
261A tag:registry contains the entire definition of one or more related APIs.
262
263== Attributes of tag:registry Tags
264
265None.
266
267== Contents of tag:registry Tags
268
269Zero or more of each of the following tags, normally in this order (although
270order should not be important):
271
272  * tag:comment - Contains arbitrary text, such as a copyright statement.
273  * <<tag-platforms,tag:platforms>> - defines platform names corresponding
274    to platform-specific <<tag-extension,API extensions>>.
275  * <<tag-tags,tag:tags>> - defines author IDs used for extensions and
276    layers.
277    Author IDs are described in detail in the "`Layers & Extensions`"
278    section of the "`Vulkan Documentation and Extensions: Procedures and
279    Conventions`" document.
280  * <<tag-types,tag:types>> - defines API types.
281    Usually only one tag is used.
282  * <<tag-enums,tag:enums>> - defines API token names and values.
283    Usually multiple tags are used.
284    Related groups may be tagged as an enumerated type corresponding to a
285    tag:type tag, and resulting in a C `enum` declaration.
286    This ability is heavily used in the Vulkan API.
287  * <<tag-commands,tag:commands>> - defines API commands (functions).
288    Usually only one tag is used.
289  * <<tag-feature,tag:feature>> - defines API feature interfaces (API
290    versions, more or less).
291    One tag per feature set.
292  * <<tag-extensions,tag:extensions>> - defines API extension interfaces.
293    Usually only one tag is used, wrapping many extensions.
294  * <<tag-formats,tag:formats>> - defines properties of image formats.
295    Only one tag is used, wrapping all the formats.
296  * <<tag-spirvextensions,tag:spirvextensions>> - defines relationship
297    between SPIR-V extensions and API interfaces which enable each
298    extension.
299    Only one tag is used, wrapping all the SPIR-V extensions.
300  * <<tag-spirvcapabilities,tag:spirvcapabilities>> - defines relationship
301    between SPIR-V capabilities and API interfaces which enable each
302    capability.
303    Only one tag is used, wrapping all the SPIR-V capabilities.
304  * <<tag-sync,tag:sync>> - Defines sync objects
305  * <<tag-syncstage,tag::syncstage>> - Defines all Pipeline Stages
306  * <<tag-syncaccess,tag::syncaccess>> - Defines all Access Types
307  * <<tag-syncpipeline,tag::syncpipeline>> - Defines Pipeline's logical ordering
308
309
310[[tag-comment]]
311=== Comment Tags (tag:comment Tag)
312
313A tag:comment tag contains an arbitrary string, and is unused.
314Comment tags may appear in multiple places in the schema, as described
315below.
316Comment tags are removed by output generators if they would otherwise appear
317in generated headers, asciidoc include files, etc.
318
319
320[[tag-platforms]]
321= Platform Name Blocks (tag:platforms Tag)
322
323A tag:platforms contains descriptions of platform IDs for platforms
324supported by window system-specific extensions to Vulkan.
325
326== Attributes of tag:platforms Tags
327
328  * attr:comment - optional.
329    Arbitrary string (unused).
330
331== Contents of tag:platforms Tags
332
333Zero or more tag:platform tags, in arbitrary order (though they are
334typically ordered by sorting on the platform name).
335
336
337[[tag-platform]]
338= Platform Names (tag:platform Tag)
339
340A tag:platform tag describes a single platform name.
341
342== Attributes of tag:platform Tags
343
344  * attr:name - required.
345    The platform name.
346    This must be a short alphanumeric string corresponding to the platform
347    name, valid as part of a C99 identifier.
348    Lower-case is preferred.
349    In some cases, it may be desirable to distinguish a subset of platform
350    functionality from the entire platform.
351    In these cases, the platform name should begin with the entire platform
352    name, followed by `_` and the subset name.
353+
354--
355[NOTE]
356.Note
357====
358For example,
359
360`name="xlib"`
361
362is used for the X Window System, Xlib client library platform.
363
364`name="xlib_xrandr"`
365
366is used for the XRandR functionality within the `xlib` platform.
367====
368--
369  * attr:protect - required.
370    This must be a C99 preprocessor token beginning with `VK_USE_PLATFORM_`
371    followed by the platform name, converted to upper case, followed by `_`
372    and the extension suffix of the corresponding window system-specific
373    extension supporting the platform.
374+
375--
376[NOTE]
377.Note
378====
379For example,
380
381`protect="VK_USE_PLATFORM_XLIB_XRANDR_EXT"`
382
383is used for the `xlib_xrandr` platform name.
384====
385--
386  * attr:comment - optional.
387    Arbitrary string (unused).
388
389== Contents of tag:platform Tags
390
391No contents are allowed.
392All information is contained in the attributes.
393
394
395[[tag-tags]]
396= Author ID Blocks (tag:tags Tag)
397
398A tag:tags tag contains tag:authorid tags describing reserved author IDs
399used by extension and layer authors.
400
401== Attributes of tag:tags Tags
402
403  * attr:comment - optional.
404    Arbitrary string (unused).
405
406== Contents of tag:tags Tags
407
408Zero or more tag:tag tags, in arbitrary order (though they are typically
409ordered by sorting on the author ID).
410
411
412[[tag-tag]]
413= Author IDs (tag:tag Tag)
414
415A tag:tag tag contains information defining a single author ID.
416
417== Attributes of tag:tag Tags
418
419  * attr:name - required.
420    The author ID, as registered with Khronos.
421    A short, upper-case string, usually an abbreviation of an author,
422    project or company name.
423  * attr:author - required.
424    The author name, such as a full company or project name.
425  * attr:contact - required.
426    The contact who registered or is currently responsible for extensions
427    and layers using the ID, including sufficient contact information to
428    reach the contact such as individual name together with email address,
429    GitHub username, or other contact information.
430
431== Contents of tag:tag Tags
432
433No contents are allowed.
434All information is contained in the attributes.
435
436
437[[tag-types]]
438= API Type Blocks (tag:types Tag)
439
440A tag:types tag contains definitions of derived types used in the API.
441
442== Attributes of tag:types Tags
443
444  * attr:comment - optional.
445    Arbitrary string (unused).
446
447== Contents of tag:types Tags
448
449Zero or more tag:type and tag:comment tags, in arbitrary order (though they
450are typically ordered by putting dependencies of other types earlier in the
451list).
452The tag:comment tags are used mostly to indicate grouping of related types.
453
454
455[[tag-type]]
456= API Type (tag:type Tag)
457
458A tag:type tag contains information which can be used to generate C code
459corresponding to the type.
460In many cases, this is simply legal C code, with attributes or embedded tags
461denoting the type name and other types used in defining this type.
462In some cases, additional attribute and embedded type information is used to
463generate more complicated C types.
464
465== Attributes of tag:type Tags
466
467  * attr:requires - optional.
468    Another type name this type requires to complete its definition.
469  * attr:name - optional.
470    Name of this type (if not defined in the tag body).
471  * attr:alias - optional.
472    Another type name which this type is an alias of.
473    Must match the name of another tag:type element.
474    This is typically used when promoting a type defined by an extension to
475    a new core version of the API.
476    The old extension type is still defined, but as an alias of the new
477    type.
478  * attr:api - optional comma-separated list of <<schema:apiname, API names>>
479    for which this definition is specialized, so that different APIs may
480    have different definitions for the same type.
481    This definition is only used if the requested API name matches the
482    attribute.
483    May be used to address subtle incompatibilities.
484  * attr:category - optional.
485    A string which indicates that this type contains a more complex
486    structured definition.
487    At present the only accepted categories are `basetype`, `bitmask`,
488    `define`, `enum`, `funcpointer`, `group`, `handle`, `include`, `struct`,
489    and `union`, as described below.
490  * attr:comment - optional.
491    Arbitrary string (unused).
492  * attr:deprecated - optional.
493    Indicates that this type has been deprecated.
494    Possible values are:
495  ** `"true"` - deprecated, but no explanation given.
496  ** `"aliased"` - an old name not following Vulkan conventions.
497     The equivalent alias following Vulkan conventions should be used
498     instead.
499  * attr:parent - only applicable if `"category"` is `handle`.
500    Notes another type with the `handle` category that acts as a parent
501    object for this type.
502  * attr:returnedonly - only applicable if `"category"` is `struct` or
503    `union`.
504    Notes that this struct/union is going to be filled in by the API, rather
505    than an application filling it out and passing it to the API.
506  * attr:structextends only applicable if category is `struct` or `union`.
507    This is a comma-separated list of structures whose `pNext` can include
508    this type.
509    This should usually only list the top-level structure that is extended,
510    for all possible extending structures.
511    This will generate a validity statement on the top level structure that
512    validates the entire chain in one go, rather than each extending
513    structure repeating the list of valid structs.
514    There is no need to set the attr:noautovalidity attribute on the `pNext`
515    members of extending structures.
516  * attr:allowduplicate - only applicable if attr:category is `"struct"`.
517    If `"true"`, then structures whose `pNext` chains include this structure
518    may include more than one instance of it.
519  * attr:objtypeenum - only applicable at present if attr:category is
520    `"handle"`.
521    Specifies the name of a `VkObjectType` enumerant which corresponds to
522    this type.
523    The enumerant must be defined.
524
525== Contents of tag:type Tags
526
527The valid contents depend on the attr:category attribute.
528
529=== Enumerated Types - attr:category `"enum"`
530
531If the attr:category tag has the value `enum`, the type is a C enumeration.
532The body of the tag is ignored in this case.
533The value of the attr:name attribute must be provided and must match the
534attr:name attribute of a <<tag-enums,tag:enums>> tag.
535The enumerant values defined within the tag:enums tag are used to generate a
536C `enum` type declaration.
537
538=== Structure Types - attr:category `"struct"` or `"union"`
539
540If the attr:category tag has the values `struct` or `union`, the type is a C
541structure or union, respectively.
542In this case, the attr:name attribute must be provided, and the contents of
543the tag:type tag are a series of tag:member tags defining the members of the
544aggregate type, in order, interleaved with any number of tag:comment tags.
545
546==== Structure Member (tag:member) Tags
547
548The tag:member tag defines the type and name of a structure or union member.
549
550==== Attributes of tag:member Tags
551
552  * attr:api - optional <<schema:apiname, API names>> for which this
553    definition is specialized, so that different APIs may have different
554    definitions for the same type.
555    This definition is only used if the requested API name matches the
556    attribute.
557    May be used to address subtle incompatibilities.
558  * attr:values - only valid on the `sType` member of a struct.
559    This is a comma-separated list of enumerant values that are valid for
560    the structure type; usually there is only a single value.
561  * attr:len - if the member is an array, len may be one or more of the
562    following things, separated by commas (one for each array indirection):
563    another member of that struct; `"null-terminated"` for a string; `"1"`
564    to indicate it is just a pointer (used for nested pointers); or an
565    equation in math markup for incorporation in the specification (a LaTeX
566    math expression delimited by `latexmath:[` and `]`.
567    The only variables in the equation should be the names of members of the
568    structure.
569  * attr:altlen - if the attr:len attribute is specified, and contains a
570    `latexmath:` equation, this attribute should be specified with an
571    equivalent equation using only C builtin operators, C math library
572    function names, and variables as allowed for attr:len.
573    It must be a valid C99 expression whose result is equal to attr:len for
574    all possible inputs.
575    It is a comma separated list that has size equal to only the `latexmath`
576    item count in attr:len list.
577    This attribute is intended to support consumers of the XML who need to
578    generate validation code from the allowed length.
579  * attr:deprecated - optional.
580    Indicates that this member has been deprecated.
581    Possible values are:
582  ** `"true"` - deprecated, but no explanation given.
583  ** `"ignored"` - functionality described by this member no longer
584     operates.
585  * attr:externsync - denotes that the member should be externally
586    synchronized when accessed by Vulkan
587  * attr:optional - optional.
588    A value of `"true"` specifies that this member can be omitted by
589    providing `NULL` (for pointers), `VK_NULL_HANDLE` (for handles), or 0
590    (for other scalar types).
591    If not present, the value is assumed to be `"false"` (the member must
592    not be omitted).
593    If the member is a pointer to one of those types, multiple values may be
594    provided, separated by commas - one for each pointer indirection.
595    Structure members with name `pNext` must always be specified with
596    `optional="true"`, since there is no requirement that any member of a
597    `pNext` chain have a following member in the chain.
598+
599--
600[NOTE]
601.Note
602====
603While the attr:optional attribute can be used for scalar types such as
604integers, it does not affect the output generators included with the
605<<vulkan-spec, Vulkan API Specification>>.
606In this case, the attribute serves only as an indicator to human readers of
607the XML.
608
609Explicitly specifying `optional="false"` is not supported, but
610`optional="false,true"` is supported for a pointer type.
611====
612--
613  * attr:selector - optional.
614    If the member is a union, attr:selector identifies another member of the
615    struct that is used to select which of that union's members are valid.
616  * attr:selection - optional.
617    For a member of a union, attr:selection identifies a value of the
618    attr:selector that indicates this member is valid.
619  * attr:noautovalidity - prevents automatic validity language being
620    generated for the tagged item.
621    Only suppresses item-specific validity - parenting issues etc.
622    are still captured.
623    It must also be used for structures that have no implicit validity when
624    such structure has explicit validity.
625  * attr:limittype - only applicable for members of
626    `VkFormatProperties`, `VkFormatProperties2`,
627    `VkPhysicalDeviceProperties`, `VkPhysicalDeviceProperties2`,
628    `VkPhysicalDeviceLimits`, `VkQueueFamilyProperties`,
629    `VkQueueFamilyProperties2`, `VkSparseImageFormatProperties`,
630    `VkSparseImageFormatProperties2`, and structures extending or members of
631    any of those structures.
632    Specifies the type of a device limit.
633    This type describes how a value might be compared with the value of a
634    member in order to check whether it fits the limit.
635    Valid values:
636  ** `"min"` and `"max"` denote minimum and maximum limits.
637     They may also apply to arrays and `VkExtent*D`.
638  ** `"pot"` denotes a value that has to be a power of two value.
639     They may also apply to arrays and `VkExtent*D`.
640  ** `"mul"` denotes a value that must be an integer multiple of this limit.
641     They may also apply to arrays and `VkExtent*D`.
642  ** `"bits"` corresponds to the bits precision of an implementation.
643  ** `"bitmask"` corresponds to bitmasks and `VkBool32`, where set bits
644     indicate the presence of a capability
645  ** `"range"` specifies a [min, max] range
646  ** `"struct"` means that the member's fields should be compared.
647  ** `"exact"` specifies a limit that must be a specific value.
648  ** `"noauto"` limits cannot be trivially compared.
649     This is the default value, if unspecified.
650  * attr:objecttype - only applicable for members which are `uint64_t`
651    values representing a Vulkan object handle.
652    Specifies the name of another member which must be a `VkObjectType` or
653    `VkDebugReportObjectTypeEXT` value specifying the type of object the
654    handle refers to.
655  * attr:stride - if the member is an array, stride specifies the name of
656    another member containing the byte stride between consecutive elements
657    in the array. Is assumed tightly packed if omitted.
658
659
660==== Contents of tag:member Tags
661
662The text elements of a tag:member tag, with all other tags removed, is a
663legal C declaration of a struct or union member.
664In addition it may contain several semantic tags:
665
666  * The tag:type tag is optional.
667    It contains text which is a valid type name found in another tag:type
668    tag, and indicates that this type must be previously defined for the
669    definition of the command to succeed.
670    Builtin C types should not be wrapped in tag:type tags.
671  * The tag:name tag is required, and contains the struct/union member name
672    being described.
673  * The tag:enum tag is optional.
674    It contains text which is a valid enumerant name found in another
675    tag:type tag, and indicates that this enumerant must be previously
676    defined for the definition of the command to succeed.
677    Typically this is used to semantically tag static array lengths.
678  * The tag:comment tag is optional.
679    It contains an arbitrary string (unused).
680
681
682=== All Other Types
683
684If the attr:category attribute is one of `basetype`, `bitmask`, `define`,
685`funcpointer`, `group`, `handle` or `include`, or is not specified, tag:type
686contains text which is legal C code for a type declaration.
687It may also contain embedded tags:
688
689  * tag:type - nested type tags contain other type names which are required
690    by the definition of this type.
691  * tag:apientry/ - insert a platform calling convention macro here during
692    header generation, used mostly for function pointer types.
693  * tag:name - contains the name of this type (if not defined in the tag
694    attributes).
695  * tag:bitvalues - contains the name of the enumeration defining flag
696    values for a `bitmask` type.
697    Ignored for other types.
698
699There is no restriction on which sorts of definitions may be made in a given
700category, although the contents of tags with attr:category `enum`, `struct`
701or `union` are interpreted specially as described above.
702
703However, when generating the header, types within each category are grouped
704together, and categories are generated in the order given by the following
705list.
706Therefore, types in a category should correspond to the intended purpose
707given for that category.
708If this recommendation is not followed, it is possible that the resulting
709header file will not compile due to out-of-order type dependencies.
710The intended purpose of each category is:
711
712  * `include` (`#include`) directives)
713  * `define` (macro `#define` directives)
714  * `basetype` (built-in C language types; scalar API typedefs, such as the
715    definition of `VkFlags`; and types defined by external APIs, such as an
716    underlying OS or window system
717  * `handle` (invocations of macros defining scalar types such as
718    `VkInstance`)
719  * `enum` (enumeration types and `#define` for constant values)
720  * `group` (currently unused)
721  * `bitmask` (enumeration types whose members are bitmasks)
722  * `funcpointer` (function pointer typedefs)
723  * `struct` and `union` together (struct and union types)
724
725
726[[tag-types:example]]
727== Example of a tag:types Tag
728
729[source,xml]
730--------------------------------------
731<types>
732    <type name="stddef">#include &lt;stddef.h&gt;</type>
733    <type requires="stddef">typedef ptrdiff_t <name>VKlongint</name>;</type>
734    <type name="VkEnum" category="enum"/>
735    <type category="struct" name="VkStruct">
736        <member><type>VkEnum</type> <name>srcEnum</name></member>
737        <member><type>VkEnum</type> <name>dstEnum</name></member>
738    </type>
739</types>
740
741<enums name="VkEnum" type="enum">
742    <enum value="0" name="VK_ENUM_ZERO"/>
743    <enum value="42" name="VK_ENUM_FORTY_TWO"/>
744</enums>
745--------------------------------------
746
747The `VkStruct` type is defined to require the types `VkEnum` and `VKlongint`
748as well.
749If `VkStruct` is in turn required by a command or another type during header
750generation, it will result in the following declarations:
751
752[source,c]
753--------------------------------------
754#include <stddef.h>
755typedef ptrdiff_t VKlongint.
756
757typedef enum {
758    VK_ENUM_ZERO = 0,
759    VK_ENUM_FORTY_TWO = 42
760} VkEnum;
761
762typedef struct {
763    VkEnum    dstEnum;
764    VkLongint dstVal;
765} VkStruct;
766--------------------------------------
767
768Note that the angle brackets around `stddef.h` are represented as XML
769entities in the registry.
770This could also be done using a CDATA block but unless there are many
771characters requiring special representation in XML, using entities is
772preferred.
773
774
775[[tag-enums]]
776= Enumerant Blocks (tag:enums Tag)
777
778The tag:enums tags contain individual tag:enum tags describing each of the
779token names used in the API.
780In some cases these correspond to a C `enum`, and in some cases they are
781simply compile time constants (e.g. `#define`).
782
783[NOTE]
784.Note
785====
786It would make more sense to call these `const` or `define` tags.
787This is a historical hangover from the OpenGL XML format which this schema
788was based on.
789====
790
791
792== Attributes of tag:enums Tags
793
794  * attr:name - optional.
795    String naming the C `enum` type whose members are defined by this enum
796    group.
797    If present, this attribute should match the attr:name attribute of a
798    corresponding tag:type tag.
799  * attr:type - optional.
800    String describing the data type of the values of this group of enums.
801    At present the only accepted categories are `enum` and `bitmask`, as
802    described below.
803  * attr:comment - optional.
804    Arbitrary string (unused).
805  * attr:bitwidth - optional.
806    Bit width required for the generated enum value type.
807    If omitted, a default value of 32 is used.
808
809== Contents of tag:enums Tags
810
811Each tag:enums block contains zero or more tag:enum, tag:unused, and
812tag:comment tags, in arbitrary order (although they are typically ordered by
813sorting on enumerant values, to improve human readability).
814
815== Example of tag:enums Tags
816
817<<tag-types:example,An example>> showing a tag with attribute
818attr:type`="enum"` is given above.
819The following example is for non-enumerated tokens.
820
821[source,xml]
822--------------------------------------
823<enums>
824    <enum value="256" name="VK_MAX_EXTENSION_NAME"/>
825    <enum value="MAX_FLOAT"  name="VK_LOD_CLAMP_NONE"/>
826</enums>
827--------------------------------------
828
829When processed into a C header, and assuming all these tokens were required,
830this results in
831
832[source,c]
833--------------------------------------
834#define VK_MAX_EXTENSION_NAME   256
835#define VK_LOD_CLAMP_NONE       MAX_FLOAT
836--------------------------------------
837
838
839[[tag-enum]]
840= Enumerants (tag:enum Tag)
841
842Each tag:enum tag defines a single Vulkan (or other API) token.
843
844== Attributes of tag:enum Tags
845
846  * attr:value is a numeric value in the form of a legal C expression when
847    evaluated at compile time in the generated header files.
848    This is usually either a literal integer value or the name of an alias
849    for a previously defined value, though more complex expressions are
850    sometimes employed for <<compile-time-constants, compile time
851    constants>>.
852  * attr:bitpos is a literal integer bit position in a bitmask.
853    The bit position must be in the range [0,30] when used as a flag bit in
854    a `Vk*FlagBits` data type.
855    Bit positions 31 and up may be used for values that are not flag bits,
856    or for <<adding-bitflags, flag bits used with 64-bit flag types>>.
857    Exactly one of attr:value and attr:bitpos must be present in an tag:enum
858    tag.
859  * attr:name - required.
860    Enumerant name, a legal C preprocessor token name.
861  * attr:api - optional comma-separated list of <<schema:apiname, API
862    names>> for which this definition is specialized, so that different APIs
863    may have different values for the same token.
864    This definition is only used if the requested API name matches the
865    attribute.
866    May be used to address subtle incompatibilities.
867  * attr:deprecated - optional.
868    Indicates that this enum has been deprecated.
869    Possible values are:
870  ** `"true"` - deprecated, but no explanation given.
871  ** `"ignored"` - functionality described by this enum no longer operates.
872  ** `"aliased"` - an old name not following Vulkan conventions.
873     The equivalent alias following Vulkan conventions should be used
874     instead.
875  * attr:type - may be used only when attr:value is specified.
876    In this case, attr:type is optional except when defining a
877    <<compile-time-constants, compile time constant>>, in which case it is
878    required when using some output generator paths.
879    If present the attribute must be a C scalar type corresponding to the
880    type of attr:value, although only `uint32_t`, `uint64_t`, and `float`
881    are currently meaningful.
882    attr:type is used by some output generators to generate constant
883    declarations, although the default behavior is to use C `#define` for
884    compile time constants.
885  * attr:alias - optional.
886    Name of another enumerant this is an alias of, used where token names
887    have been changed as a result of profile changes or for consistency
888    purposes.
889    An enumerant alias is simply a different attr:name for the exact same
890    attr:value or attr:bitpos.
891  * attr:protect - optional.
892    An additional preprocessor token used to protect an enum definition.
893
894[NOTE]
895.Note
896====
897Using attr:alias on a tag:enum means you want the attr:name defined by the
898tag to be treated as an alias of the token name in the attr:alias attribute
899value.
900For example, the following tag defines `VK_ALIAS` as an alias of `VK_VALUE`:
901
902[source,xml]
903--------------------------------------
904<enum name="VK_ALIAS" alias="VK_VALUE">
905--------------------------------------
906====
907
908[NOTE]
909.Note
910====
911In older versions of the schema, attr:type was described as allowing only
912the C integer suffix types `u` and `ull`, which is inconsistent with the
913current definition.
914However, attr:type was not actually used in the registry processing scripts
915or `vk.xml` at the time the current definition was introduced, so this is
916expected to be a benign change.
917====
918
919
920== Contents of tag:enum Tags
921
922tag:enum tags have no allowed contents.
923All information is contained in the attributes.
924
925
926[[tag-unused]]
927= Unused Enumerants (tag:unused Tag)
928
929Each tag:unused tag defines a range of enumerants which is allocated, but
930not yet assigned to specific enums.
931This just tracks the unused values for the Registrar's use, and is not used
932for header generation.
933
934[NOTE]
935.Note
936====
937tag:unused tags could be generated and inserted automatically, which would
938be a good way to avoid the attributes becoming out of date.
939However, they are rarely used in the Vulkan XML schema, unlike the OpenGL
940XML schema it was based on.
941====
942
943== Attributes of tag:unused Tags
944
945  * attr:start - required, attr:end - optional.
946    Integers defining the start and end of an unused range of enumerants.
947    attr:start must be {leq} attr:end.
948    If attr:end is not present, then attr:start defines a single unused
949    enumerant.
950    This range should not exceed the range reserved by the surrounding
951    tag:enums tag.
952  * attr:vendor - optional.
953    String describing the vendor or purposes to whom a reserved range of
954    enumerants is allocated.
955    Usually identical to the attr:vendor attribute of the surrounding
956    attr:enums block.
957  * attr:comment - optional.
958    Arbitrary string (unused).
959
960== Contents of tag:unused Tags
961
962None.
963
964
965[[tag-commands]]
966= Command Blocks (tag:commands Tag)
967
968The tag:commands tag contains definitions of each of the functions
969(commands) used in the API.
970
971== Attributes of tag:commands Tags
972
973  * attr:comment - optional.
974    Arbitrary string (unused).
975
976== Contents of tag:commands Tags
977
978Each tag:commands block contains zero or more tag:command tags, in arbitrary
979order (although they are typically ordered by sorting on the command name,
980to improve human readability).
981
982
983[[tag-command]]
984= Commands (tag:command Tag)
985
986The tag:command tag contains a structured definition of a single API command
987(function).
988
989== Attributes of tag:command Tags
990
991There are two ways to define a command.
992The first uses a set of attributes to the tag:command tag defining
993properties of the command used for constructing automatic validation rules,
994and the contents of the tag:command tag define the name, signature, and
995parameters of the command.
996In this case the allowed attributes include:
997
998  * attr:tasks - optional.
999    A string identifying the tasks this command performs, as described in
1000    the "`Queue Operation`" section of the <<vulkan-spec, Vulkan API
1001    Specification>>.
1002    The format of the string is one or more of the terms `"action"`,
1003    `"synchronization"`, `"state"`, and `"indirection"`, with multiple terms
1004    separated by commas (`","`).
1005  * attr:queues - optional.
1006    A string identifying the command queues this command can be placed on.
1007    The format of the string is one or more of the terms `"compute"`,
1008    `"decode"`, `"encode"`, `"graphics"`, `"transfer"`, `"sparse_binding"`,
1009    and `"opticalflow"`, with multiple terms separated by commas (`","`).
1010  * attr:successcodes - optional.
1011    A string describing possible successful return codes from the command,
1012    as a comma-separated list of Vulkan result code names.
1013  * attr:errorcodes - optional.
1014    A string describing possible error return codes from the command, as a
1015    comma-separated list of Vulkan result code names.
1016  * attr:renderpass - optional.
1017    A string identifying whether the command can be issued only inside a
1018    render pass (`"inside"`), only outside a render pass (`"outside"`), or
1019    both (`"both"`).
1020  * attr:videocoding - optional.
1021    A string identifying whether the command can be issued only inside a
1022    video coding scope (`"inside"`), only outside a video coding scope
1023    (`"outside"`), or both (`"both"`); the default is `"outside"` for
1024    commands that do not specify it.
1025  * attr:cmdbufferlevel - optional.
1026    A string identifying the command buffer levels that this command can be
1027    called by.
1028    The format of the string is one or more of the terms `"primary"` and
1029    `"secondary"`, with multiple terms separated by commas (`","`).
1030  * attr:comment - optional.
1031    Arbitrary string (unused).
1032
1033The second way of defining a command is as an alias of another command.
1034For example when an extension is promoted from extension to core status, the
1035commands defined by that extensions become aliases of the corresponding new
1036core commands.
1037In this case, only two attributes are allowed:
1038
1039  * attr:name - required.
1040    A string naming the command defined by the tag.
1041  * attr:alias - required.
1042    A string naming the command that attr:name is an alias of.
1043    The string must be the same as the attr:name value of another
1044    tag:command defining another command.
1045
1046Both forms of tag:command support these options:
1047
1048  * attr:api - optional <<schema:apiname, API names>> for which this
1049    definition is specialized, so that different APIs may have different
1050    values for the same token.
1051    This definition is only used if the requested API name matches the
1052    attribute.
1053    May be used to address subtle incompatibilities.
1054
1055== Contents of tag:command Tags
1056
1057  * tag:proto is required and must be the first element.
1058    It is a tag defining the C function prototype of a command as described
1059    below, up to the function name and return type but not including
1060    function parameters.
1061  * tag:param elements for each command parameter follow, defining its name
1062    and type, as described below.
1063    If a command takes no arguments, it has no tag:param tags.
1064
1065Following these elements, the remaining elements in a tag:command tag are
1066optional and may be in any order:
1067
1068  * tag:alias - optional.
1069    Has no attributes and contains a string which is the name of another
1070    command this command is an alias of, used when promoting a function from
1071    vendor to Khronos extension or Khronos extension to core API status.
1072    A command alias describes the case where there are two function names
1073    which implement the same behavior.
1074  * tag:description - optional.
1075    Unused text.
1076  * tag:implicitexternsyncparams - optional.
1077    Contains a list of tag:param tags, each containing asciidoc source text
1078    describing an object which is not a parameter of the command but is
1079    related to one, and which also <<tag-command:param:attr,requires
1080    external synchronization>>.
1081    The text is intended to be incorporated into the API specification.
1082
1083[NOTE]
1084.Note
1085====
1086Versions of the registry documentation prior to 1.1.93 asserted that command
1087aliases "`resolve to the _same_ entry point in the underlying layer stack.`"
1088Whilst this may be true on many implementations, it is not required - each
1089command alias must be queried separately through `vkGetInstanceProcAddr`
1090or `vkGetDeviceProcAddr`.
1091====
1092
1093
1094[[tag-command:proto]]
1095== Command Prototype (tag:proto Tags)
1096
1097The tag:proto tag defines the return type and name of a command.
1098
1099=== Attributes of tag:proto Tags
1100
1101None.
1102
1103// attr:group - group name, an arbitrary string.
1104//
1105// If the group name is defined, it may be interpreted as described in
1106// <<tag-group:meaning>>.
1107
1108=== Contents of tag:proto Tags
1109
1110The text elements of a tag:proto tag, with all other tags removed, is legal
1111C code describing the return type and name of a command.
1112In addition to text, it may contain two semantic tags:
1113
1114  * The tag:type tag is optional, and contains text which is a valid type
1115    name found in a tag:type tag.
1116    It indicates that this type must be previously defined for the
1117    definition of the command to succeed.
1118    Builtin C types, and any derived types which are expected to be found in
1119    other header files, should not be wrapped in tag:type tags.
1120  * The tag:name tag is required, and contains the command name being
1121    described.
1122
1123
1124[[tag-command:param]]
1125== Command Parameter (tag:param Tags)
1126
1127The tag:param tag defines the type and name of a parameter.
1128Its contents are very similar to the tag:member tag used to define struct
1129and union members.
1130
1131
1132[[tag-command:param:attr]]
1133=== Attributes of tag:param Tags
1134
1135  * attr:api - optional <<schema:apiname, API names>> for which this
1136    definition is specialized, so that different APIs may have different
1137    definitions for the same type.
1138    This definition is only used if the requested API name matches the
1139    attribute.
1140    May be used to address subtle incompatibilities.
1141  * attr:len - if the param is an array, len may be one or more of the
1142    following things, separated by commas (one for each array indirection):
1143    another param of that command; `"null-terminated"` for a string; `"1"`
1144    to indicate it is just a pointer (used for nested pointers); or an
1145    equation in math markup for incorporation in the specification (a LaTeX
1146    math expression delimited by `latexmath:[` and `]`.
1147    The only variables in the equation should be the names of this or other
1148    parameters.
1149  * attr:altlen - if the attr:len attribute is specified, and contains a
1150    `latexmath:` equation, this attribute should be specified with an
1151    equivalent equation using only C builtin operators, C math library
1152    function names, and variables as allowed for attr:len.
1153    It must be a valid C99 expression whose result is equal to attr:len for
1154    all possible inputs.
1155    It is a comma separated list that has size equal to only the `latexmath`
1156    item count in attr:len list.
1157    This attribute is intended to support consumers of the XML who need to
1158    generate validation code from the allowed length.
1159  * attr:optional - optional.
1160    A value of `"true"` specifies that this parameter can be omitted by
1161    providing `NULL` (for pointers), `VK_NULL_HANDLE` (for handles), or 0
1162    (for other scalar types).
1163    If not present, the value is assumed to be `"false"` (the parameter must
1164    not be omitted).
1165    If the parameter is a pointer to one of those types, multiple values may
1166    be provided, separated by commas - one for each pointer indirection.
1167+
1168--
1169[NOTE]
1170.Note
1171====
1172While the attr:optional attribute can be used for scalar types such as
1173integers, it does not affect the output generators included with the
1174<<vulkan-spec, Vulkan API Specification>>.
1175In this case, the attribute serves only as an indicator to human readers of
1176the XML.
1177
1178Explicitly specifying `optional="false"` is not supported, but
1179`optional="false,true"` is supported for a pointer type.
1180====
1181--
1182  * attr:selector - optional.
1183    If the parameter is a union, attr:selector identifies another parameter
1184    of the command that is used to select which of that union's members are
1185    valid.
1186  * attr:noautovalidity - prevents automatic validity language being
1187    generated for the tagged item.
1188    Only suppresses item-specific validity - parenting issues etc.
1189    are still captured.
1190  * attr:externsync - optional.
1191    A value of `"true"` indicates that this parameter (e.g. the object a
1192    handle refers to, or the contents of an array a pointer refers to) is
1193    modified by the command, and is not protected against modification in
1194    multiple app threads.
1195    If only certain members of an object or elements of an array are
1196    modified, multiple strings may be provided, separated by commas.
1197    Each string describes a member which is modified.
1198    For example, the `VkPresentInfoKHR` struct includes attr:externsync
1199    attributes for the `pPresentInfo` array indicating that only specific
1200    members of each element of the array are modified:
1201+
1202--
1203[source,xml]
1204--------------------------------------
1205<param externsync="pPresentInfo-&gt;pWaitSemaphores[],pPresentInfo-&gt;pSwapchains[]">const <type>VkPresentInfoKHR</type>* <name>pPresentInfo</name></param>
1206--------------------------------------
1207
1208Parameters which do not have an attr:externsync attribute are assumed to not
1209require external synchronization.
1210--
1211  * attr:objecttype - only applicable for parameters which are `uint64_t`
1212    values representing a Vulkan object handle.
1213    Specifies the name of another parameter which must be a `VkObjectType`
1214    or `VkDebugReportObjectTypeEXT` value specifying the type of object the
1215    handle refers to.
1216  * attr:validstructs - optional.
1217    Allowed only when the parameter type is a pointer to an abstract
1218    `VkBaseInStructure` or `VkBaseOutStructure` type.
1219    This is a comma-separated list of structures which can either be
1220    passed as the parameter, or can appear anywhere in the `pNext` chain of
1221    the parameter.
1222
1223
1224=== Contents of tag:param Tags
1225
1226The text elements of a tag:param tag, with all other tags removed, is legal
1227C code describing the type and name of a function parameter.
1228In addition it may contain two semantic tags:
1229
1230  * The tag:type tag is optional, and contains text which is a valid type
1231    name found in tag:type tag, and indicates that this type must be
1232    previously defined for the definition of the command to succeed.
1233    Builtin C types, and any derived types which are expected to be found in
1234    other header files, should not be wrapped in tag:type tags.
1235  * The tag:name tag is required, and contains the parameter name being
1236    described.
1237
1238== Example of a tag:commands Tag
1239
1240[source,xml]
1241--------------------------------------
1242<commands>
1243    <command>
1244        <proto><type>VkResult</type> <name>vkCreateInstance</name></proto>
1245        <param>const <type>VkInstanceCreateInfo</type>* <name>pCreateInfo</name></param>
1246        <param><type>VkInstance</type>* <name>pInstance</name></param>
1247    </command>
1248</commands>
1249--------------------------------------
1250
1251When processed into a C header, this results in
1252
1253[source,c]
1254--------------------------------------
1255VkResult vkCreateInstance(
1256    const VkInstanceCreateInfo* pCreateInfo,
1257    VkInstance* pInstance);
1258--------------------------------------
1259
1260
1261[[tag-feature]]
1262= API Features and Versions (tag:feature Tag)
1263
1264API features are described in individual tag:feature tags.
1265A feature is the set of interfaces (enumerants and commands) defined by a
1266particular API and version, such as Vulkan 1.0, and includes all profiles of
1267that API and version.
1268
1269== Attributes of tag:feature Tags
1270
1271  * attr:api - required comma-separated list of <<schema:apiname, API
1272    names>> for which this feature is defined, such as `vulkan`.
1273  * attr:name - required.
1274    Version name, used as the C preprocessor token under which the version's
1275    interfaces are protected against multiple inclusion.
1276    Example: `"VK_VERSION_1_0"`.
1277  * attr:number - required.
1278    Feature version number, usually a string interpreted as
1279    `majorNumber.minorNumber`.
1280    Example: `4.2`.
1281  * attr:sortorder - optional.
1282    A decimal number which specifies an order relative to other tag:feature
1283    tags when calling output generators.
1284    Defaults to `0`.
1285    Rarely used, for when ordering by attr:name is insufficient.
1286  * attr:protect - optional.
1287    An additional preprocessor token used to protect a feature definition.
1288    Usually another feature or extension attr:name.
1289    Rarely used, for odd circumstances where the definition of a feature or
1290    extension requires another to be defined first.
1291  * attr:comment - optional.
1292    Arbitrary string (unused).
1293
1294[NOTE]
1295.Note
1296====
1297The attr:name attribute used for Vulkan core versions, such as
1298`"VK_VERSION_1_0"`, is not an API construct.
1299It is used only as a preprocessor guard in the headers, and an asciidoctor
1300conditional in the specification sources.
1301The similar `"VK_API_VERSION_1_0"` symbols are part of the API and their
1302values are packed integers containing Vulkan core version numbers.
1303====
1304
1305== Contents of tag:feature Tags
1306
1307Zero or more <<tag-required,tag:require and tag:remove tags>>, in arbitrary
1308order.
1309Each tag describes a set of interfaces that is respectively required for, or
1310removed from, this feature, as described below.
1311
1312== Example of a tag:feature Tag
1313
1314[source,xml]
1315--------------------------------------
1316<feature api="vulkan" name="VK_VERSION_1_0" number="1.0">
1317    <require comment="Header boilerplate">
1318        <type name="vk_platform"/>
1319    </require>
1320    <require comment="API constants">
1321        <enum name="VK_MAX_PHYSICAL_DEVICE_NAME"/>
1322        <enum name="VK_LOD_CLAMP_NONE"/>
1323    </require>
1324    <require comment="Device initialization">
1325        <command name="vkCreateInstance"/>
1326    </require>
1327</feature>
1328--------------------------------------
1329
1330When processed into a C header for Vulkan, this results in:
1331
1332[source,c]
1333--------------------------------------
1334#ifndef VK_VERSION_1_0
1335#define VK_VERSION_1_0 1
1336#define VK_MAX_EXTENSION_NAME   256
1337#define VK_LOD_CLAMP_NONE       MAX_FLOAT
1338typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, VkInstance* pInstance);
1339#ifndef VK_NO_PROTOTYPES
1340VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(
1341    const VkInstanceCreateInfo*                 pCreateInfo,
1342    VkInstance*                                 pInstance);
1343#endif
1344#endif /* VK_VERSION_1_0 */
1345--------------------------------------
1346
1347
1348[[tag-extensions]]
1349= Extension Blocks (tag:extensions Tag)
1350
1351The tag:extensions tag contains definitions of each of the extensions which
1352are defined for the API.
1353
1354== Attributes of tag:extensions Tags
1355
1356  * attr:comment - optional.
1357    Arbitrary string (unused).
1358
1359== Contents of tag:extensions Tags
1360
1361Each tag:extensions block contains zero or more tag:extension tags, each
1362describing an API extension, in arbitrary order (although they are typically
1363ordered by sorting on the extension name, to improve human readability).
1364
1365
1366[[tag-extension]]
1367= API Extensions (tag:extension Tag)
1368
1369API extensions are described in individual tag:extension tags.
1370An extension is the set of interfaces defined by a particular API extension
1371specification, such as `ARB_multitexture`.
1372tag:extension is similar to tag:feature, but instead of having an
1373attr:number attribute, it instead has a attr:supported attribute, which
1374describes the set of API names which the extension can potentially be
1375implemented against.
1376
1377== Attributes of tag:extension Tags
1378
1379  * attr:name - required.
1380    Extension name, following the conventions in the <<vulkan-spec, Vulkan
1381    API Specification>>.
1382    Example: `name="VK_VERSION_1_0"`.
1383  * attr:number - required.
1384    A decimal number which is the registered, unique extension number for
1385    attr:name.
1386  * attr:sortorder - optional.
1387    A decimal number which specifies an order relative to other
1388    tag:extension tags when calling output generators.
1389    Defaults to `0`.
1390    Rarely used, for when ordering by attr:number is insufficient.
1391  * attr:author - optional.
1392    The author name, such as a full company name.
1393    If not present, this can be taken from the corresponding tag:tag
1394    attribute.
1395    However, `EXT` and other multi-vendor extensions may not have a
1396    well-defined author or contact in the tag.
1397    This attribute is not used in processing the XML.
1398    It is just metadata, mostly used to track the original author of an
1399    extension (which may have since been promoted to use a different author
1400    ID).
1401  * attr:contact - optional.
1402    The contact who registered or is currently responsible for extensions
1403    and layers using the tag, including sufficient contact information to
1404    reach the contact such as individual name together with GitHub username
1405    (`@username`), Khronos internal Gitlab username (`gitlab:@username`) if
1406    no public GitHub contact is available, or other contact information.
1407    If not present, this can be taken from the corresponding tag:tag
1408    attribute just like attr:author.
1409  * attr:type - required if the attr:supported attribute is not
1410    `'disabled'`.
1411    Must be either `'device'` or `'instance'`, if present.
1412  * [[depends-expressions]] attr:depends - optional.
1413    String containing a boolean expression of one or more API core version
1414    and extension names.
1415    The extension requires the expression in the string to be satisfied to
1416    use any functionality it defines (for instance extensions), or to use
1417    any device-level functionality it provides (for device extensions).
1418    Supported operators include `,` for logical OR, `+` for logical AND, and
1419    `(` `)` for grouping.
1420    `,` and `+` are of equal precedence, and lower than `(` `)`.
1421    Expressions must be evaluated left-to-right for operators of the same
1422    precedence.
1423    Terms which are core version names are true if the corresponding
1424    API version is supported.
1425    Terms which are extension names are true if the corresponding extension
1426    is enabled.
1427+
1428--
1429[NOTE]
1430.Note
1431====
1432attr:depends is a breaking change in Vulkan 1.3.241, replacing the
1433`requires` and `requiresCore` attributes.
1434For example, an extension which previously specified these two attributes in
1435`vk.xml`:
1436
1437* `requires="VK_KHR_dep_a,VK_EXT_dep_b"`
1438* `requiresCore="1.1"`
1439
1440should replace them both with
1441
1442* `depends="VK_VERSION_1_1+VK_KHR_dep_a+VK_EXT_dep_b"`
1443
1444Note that the use of `,` in the old `requires` attribute was treated as a
1445logical AND, and must be replaced by `+` in the `depends` attribute.
1446====
1447--
1448  * attr:protect - optional.
1449    An additional preprocessor token used to protect an extension
1450    definition.
1451    Usually another feature or extension attr:name.
1452    Rarely used, for odd circumstances where the definition of an extension
1453    requires another extension or a header file to be defined first.
1454  * attr:platform - optional.
1455    Indicates that the extension is specific to the platform identified by
1456    the attribute value, and should be emitted conditional on that platform
1457    being available, in a platform-specific header, etc.
1458    The attribute value must be the same as one of the tag:platform tag:name
1459    attribute values.
1460  * attr:supported - comma-separated list of required <<schema:apiname, API
1461    names>> for which this extension is defined.
1462    When the extension tag is just reserving an extension number, use
1463    `supported="disabled"` to indicate this extension should never be
1464    processed.
1465    Interfaces defined in a `disabled` extension block are tentative at best
1466    and must: not be generated or otherwise used by scripts processing the
1467    XML.
1468    The only exception to this rule is for scripts used solely for
1469    reserving, or checking for reserved bitflag values.
1470  * attr:ratified - optional comma-separated list of <<scheme:apiname, API
1471    names>> for which this extension has been ratified by the Khronos Board
1472    of Promoters.
1473    Defaults to the empty string if not specified.
1474  * attr:promotedto - optional.
1475    A Vulkan version or a name of an extension that this extension was
1476    _promoted_ to.
1477    E.g. `"VK_VERSION_1_1"`, or `"VK_KHR_draw_indirect_count"`.
1478  * attr:deprecatedby - optional.
1479    A Vulkan version or a name of an extension that _deprecates_ this
1480    extension.
1481    It may be an empty string.
1482    E.g. `"VK_VERSION_1_1"`, or `"VK_EXT_debug_utils"`, or `""`.
1483  * attr:obsoletedby - optional.
1484    A Vulkan version or a name of an extension that _obsoletes_ this
1485    extension.
1486    It may be an empty string.
1487    E.g. `"VK_VERSION_1_1"`, or `"VK_KHR_maintenance1"`, or `""`.
1488  * attr:provisional - optional.
1489    `"true"` if this extension is released provisionally.
1490    Defaults to `"false"` if not specified.
1491  * attr:specialuse - optional.
1492    If present, must contain one or more tokens separated by commas,
1493    indicating a special purpose of the extension.
1494    Tokens may include:
1495  ** 'cadsupport' - for support of CAD software.
1496  ** 'd3demulation' - for support of Direct3D emulation layers or libraries,
1497     or applications porting from Direct3D.
1498  ** 'debugging' - for debugging an application.
1499  ** 'devtools' - for support of developer tools, such as capture-replay
1500     libraries.
1501  ** 'glemulation' - for support of OpenGL and/or OpenGL ES emulation layers
1502     or libraries, or applications porting from those APIs.
1503  * attr:comment - optional.
1504    Arbitrary string (unused).
1505
1506[NOTE]
1507.Note
1508====
1509The attr:depends attribute is used to specify other extensions that *must*
1510be enabled for an extension to be enabled.
1511
1512In some cases, an extension may include functionality which is only defined
1513*if* another extension is enabled.
1514Such functionality should be specified within a tag:require tag, using the
1515attr:depends attribute to specify that extension.
1516====
1517
1518== Contents of tag:extension Tags
1519
1520Zero or more <<tag-required,tag:require and tag:remove tags>>, in arbitrary
1521order.
1522Each tag describes a set of interfaces that is respectively required for, or
1523removed from, this extension, as described below.
1524
1525== Example of an tag:extensions Tag
1526
1527[source,xml]
1528--------------------------------------
1529<extension name="VK_KHR_display_swapchain" number="4" supported="vulkan">
1530    <require>
1531        <enum value="9" name="VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION"/>
1532        <enum value="4" name="VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NUMBER"/>
1533        <enum value="&quot;VK_KHR_display_swapchain&quot;"
1534              name="VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME"/>
1535        <type name="VkDisplayPresentInfoKHR"/>
1536        <command name="vkCreateSharedSwapchainsKHR"/>
1537    </require>
1538</extension>
1539--------------------------------------
1540
1541The attr:supported attribute says that the extension is defined for the
1542default profile (`vulkan`).
1543When processed into a C header for the `vulkan` profile, this results in
1544header contents something like (assuming corresponding definitions of the
1545specified tag:type and tag:command elsewhere in the XML):
1546
1547[source,c]
1548--------------------------------------
1549#define VK_KHR_display_swapchain 1
1550#define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
1551#define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NUMBER 4
1552#define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
1553
1554typedef struct VkDisplayPresentInfoKHR {
1555    VkStructureType                             sType;
1556    const void*                                 pNext;
1557    VkRect2D                                    srcRect;
1558    VkRect2D                                    dstRect;
1559    VkBool32                                    persistent;
1560} VkDisplayPresentInfoKHR;
1561
1562typedef VkResult (VKAPI_PTR *PFN_vkCreateSharedSwapchainsKHR)(
1563    VkDevice device, uint32_t swapchainCount,
1564    const VkSwapchainCreateInfoKHR* pCreateInfos,
1565    const VkAllocationCallbacks* pAllocator,
1566    VkSwapchainKHR* pSwapchains);
1567
1568#ifndef VK_NO_PROTOTYPES
1569VKAPI_ATTR VkResult VKAPI_CALL vkCreateSharedSwapchainsKHR(
1570    VkDevice                                    device,
1571    uint32_t                                    swapchainCount,
1572    const VkSwapchainCreateInfoKHR*             pCreateInfos,
1573    const VkAllocationCallbacks*                pAllocator,
1574    VkSwapchainKHR*                             pSwapchains);
1575#endif
1576--------------------------------------
1577
1578
1579[[tag-required]]
1580= Required and Removed Interfaces (tag:require and tag:remove Tags)
1581
1582A tag:require block defines a set of interfaces (types, enumerants and
1583commands) 'required' by a tag:feature or tag:extension.
1584A tag:remove block defines a set of interfaces 'removed' by a tag:feature.
1585This is primarily for future profiles of an API which may choose to
1586deprecate and/or remove some interfaces.
1587Extensions should never remove interfaces, although this usage is allowed by
1588the schema).
1589Except for the tag name and behavior, the contents of tag:require and
1590tag:remove tags are identical.
1591
1592== Attributes of tag:require and tag:remove Tags
1593
1594  * attr:profile - optional.
1595    String name of an API profile.
1596    Interfaces in the tag are only required (or removed) if the specified
1597    profile is being generated.
1598    If not specified, interfaces are required (or removed) for all API
1599    profiles.
1600  * attr:comment - optional.
1601    Arbitrary string (unused).
1602  * attr:api - optional comma-separated list of <<schema:apiname, API
1603    names>> requiring or removing these interfaces.
1604    Interfaces in the tag are only required (or removed) if the requested
1605    API name matches an element of the attribute.
1606    If not specified, interfaces are required (or removed) for all APIs.
1607
1608[NOTE]
1609.Note
1610====
1611The attr:api attribute is only supported inside tag:extension tags, since
1612tag:feature tags already define a specific API.
1613====
1614
1615== Attributes of tag:require Tags
1616
1617These attributes are allowed only for a tag:require tag.
1618
1619  * attr:depends - optional, and only for tag:require tags.
1620    String containing a boolean expression of one or more API core version
1621    and extension names.
1622    The <<depends-expressions, syntax of this string>> is identical to that
1623    of the tag:extension attr:depends attribute.
1624    Interfaces in the tag are only required if the expression is satisfied.
1625+
1626--
1627[NOTE]
1628.Note
1629====
1630attr:depends is a breaking change in Vulkan 1.3.241, replacing the
1631`extension` and `feature` attributes.
1632====
1633--
1634
1635== Contents of tag:require and tag:remove Tags
1636
1637Zero or more of the following tags, in any order:
1638
1639=== Comment Tags
1640
1641<<tag-comment, tag:comment>> (as described above).
1642
1643=== Command Tags
1644
1645tag:command specifies an required (or removed) command defined in a
1646tag:commands block.
1647The tag has no content, but contains attributes:
1648
1649  * attr:name - required.
1650    Name of the command.
1651  * attr:comment - optional.
1652    Arbitrary string (unused).
1653
1654=== Enum Tags
1655
1656tag:enum specifies an required (or removed) enumerant defined in a tag:enums
1657block.
1658All forms of this tag support the following attributes:
1659
1660  * attr:name - required.
1661    Name of the enumerant.
1662  * attr:comment - optional.
1663    Arbitrary string (unused).
1664  * attr:api - optional comma-separated list of <<schema:apiname, API
1665    names>> for which this definition is specialized, so that different APIs
1666    may have different values for the same token.
1667    This definition is only used if the requested API name matches the
1668    attribute.
1669    May be used to address subtle incompatibilities.
1670
1671There are two forms of tag:enum tags:
1672
1673_Reference enums_ simply pull in the definition of an enumerant given in a
1674separate tag:enums block.
1675No attributes other than attr:name and attr:comment are supported for them.
1676tag:enum tags appearing inside tag:remove tags should always be reference
1677enums.
1678Reference enums may also be used inside tag:require tags, if the
1679corresponding value is defined in a tag:enums block.
1680This is typically used for constants not part of an enumerated type.
1681
1682_Extension enums_ define the value of an enumerant inline in an tag:feature
1683or tag:extensions block.
1684Typically these are used to add additional values specified by an extension
1685or core feature to an existing enumerated type.
1686There are a variety of attributes which are used to specify the value of the
1687enumerant:
1688
1689  * attr:value and attr:type - define a constant value in the same fashion
1690    as an tag:enum tag in an <<tag-enum,tag:enums>> block.
1691  * attr:bitpos - define a constant bitmask value in the same fashion as an
1692    <<tag-enum,tag:enum>> tag in an tag:enums block.
1693    attr:bitpos is a literal integer bit position in a bitmask.
1694    The same value and usage constraints apply to this bit position as are
1695    applied to the <<tag-enum, attr:bitpos attribute of an tag:enum tag.
1696  * attr:extends - the name of a separately defined enumerated type (e.g. a
1697    tag:type tag with attr:category``="enum"``) to which the extension
1698    enumerant is added.
1699    The enumerated type is required to complete the definition of the
1700    enumerant, in the same fashion as the attr:requires attribute of a
1701    tag:type tag.
1702    If not present, the enumerant is treated as a global constant value.
1703  * attr:extnumber - an extension number.
1704    The extension number in turn specifies the starting value of a block
1705    (range) of values reserved for enumerants defined by or associated with
1706    the corresponding tag:extension tag with the same attr:number.
1707    This is used when an extension or core feature needs to extend an
1708    enumerated type in a block defined by a different extension.
1709  * Attribute attr:offset - the offset within an extension block.
1710    If attr:extnumber is not present, the extension number defining that
1711    block is given by the attr:number attribute of the surrounding
1712    tag:extension tag.
1713    The numeric value of an enumerant is computed as defined in the
1714    ``Assigning Extension Token Values`" section of the <<vulkan-styleguide,
1715    Vulkan Documentation and Extensions: Procedures and Conventions>>
1716    document.
1717  * Attribute attr:dir - if present, the calculated enumerant value will be
1718    negative, instead of positive.
1719    Negative enumerant values are normally used only for Vulkan error codes.
1720    The attribute value must be specified as `dir="-"`.
1721  * attr:alias - the name of another enumerant this is an alias of.
1722    An enumerant alias is simply a different name for the same enumerant
1723    value.
1724    This is typically used when promoting an enumerant defined by an
1725    extension to a new core version of the API.
1726    The old extension enumerant is still defined, but as an alias of the new
1727    core enumerant.
1728    It may also be used when token names have been changed as a result of
1729    profile changes, or for consistency purposes.
1730  * attr:protect - define a preprocessor protection symbol for the enum in
1731    the same fashion as a tag:enum tag in an <<tag-enum,tag:enums>> block.
1732
1733Not all combinations of attributes are either meaningful or supported.
1734The attr:protect attribute may always be present.
1735For other attributes, the allowed combinations are:
1736
1737.Valid Combinations of attr:enum Attributes for Extension Enums
1738|====
1739| Description                   | attr:value | attr:bitpos | attr:alias | attr:offset | attr:extnumber | attr:dir | attr:extends
1740| Numeric value                 | *Yes*      | No          | No         | No          | No             | No       | *Yes*^2^
1741| Bitmask value                 | No         | *Yes*       | No         | No          | No             | No       | *Yes*^2^
1742| Alias of another enumerant    | No         | No          | *Yes*      | No          | No             | No       | *Yes*^2^
1743| Value added to an enumeration | No         | No          | No         | *Yes*       | *Yes*^1^       | *Yes*^3^ | *Yes*
1744|====
1745
1746[1]: Optional.
1747If attr:extnumber is not present, the tag:enum tag may only be within a
1748tag:extension.
1749Otherwise, the tag:enum tag may also be within a tag:feature.
1750
1751[2]: Optional.
1752If attr:extends is not present, the enumerant value is a global constant.
1753Otherwise, the value is added to the specified enumeration.
1754
1755[3]: Optional.
1756If not present, the computed value will be positive.
1757
1758Examples of <<tag-required-examples,various types of extension enumerants>>
1759are given below.
1760
1761
1762=== Type Tags
1763
1764tag:type specifies a required (or removed) type defined in a tag:types
1765block.
1766Most types are picked up implicitly by using the tag:type tags of commands,
1767but in a few cases, additional types need to be specified explicitly.
1768It is unlikely that a type would ever be removed, although this usage is
1769allowed by the schema.
1770The tag has no content, but contains elements:
1771
1772  * attr:name - required.
1773    Name of the type.
1774  * attr:comment - optional.
1775    Arbitrary string (unused).
1776
1777
1778[[tag-required-examples]]
1779== Examples of Extension Enumerants
1780
1781Examples of some of the supported extension enumerant tag:enum tags are
1782given below.
1783
1784[source,xml]
1785--------------------------------------
1786<extensions>
1787    <extension name="VK_KHR_test_extension" number="1" supported="vulkan">
1788        <require>
1789            <enum value="42" name="VK_KHR_TEST_ANSWER"/>
1790            <enum bitpos="29" name="VK_KHR_TEST_BITMASK"/>
1791            <enum offset="0" dir="-" extends="VkResult"
1792                  name="VK_ERROR_SURFACE_LOST_KHR"/>
1793            <enum offset="1" extends="VkResult"
1794                  name="VK_SUBOPTIMAL_KHR"/>
1795            <enum bitpos="30" extends="VkCullModeFlagBits"
1796                  name="VK_KHR_TEST_CULL_MODE_BIT"/>
1797        </require>
1798    </extension>
1799</extensions>
1800--------------------------------------
1801
1802The corresponding header file will include definitions like this:
1803
1804[source,c]
1805--------------------------------------
1806typedef enum VkResult {
1807    <previously defined VkResult enumerant values},
1808    VK_ERROR_SURFACE_LOST_KHR = -1000000000,
1809    VK_SUBOPTIMAL_KHR = 1000000001,
1810    VK_KHR_EXTENSION_BIT = 0x80000000,
1811};
1812
1813#define VK_KHR_test_extension 1
1814#define VK_KHR_theanswer 42
1815#define VK_KHR_bitmask 0x20000000
1816--------------------------------------
1817
1818
1819[[tag-formats]]
1820= Formats (tag:formats Tag)
1821
1822The tag:formats tag contains definitions of each of the image formats which
1823are defined for the API.
1824
1825== Attributes of tag:formats Tags
1826
1827None.
1828
1829//  * attr:comment - optional.
1830//    Arbitrary string (unused).
1831
1832== Contents of tag:formats Tags
1833
1834A tag:formats block contains zero or more tag:format tags, each describing
1835an image format, in arbitrary order.
1836
1837
1838[[tag-format]]
1839= Image Format (tag:format Tag)
1840
1841Image formats are described in individual tag:format tags.
1842An image format corresponds to a Vulkan `VkFormat` enumerant.
1843This tag contains information specifying the structure and meaning of
1844different parts of the format.
1845The meaning of different parts of the format information is described in
1846more detail in the "`Format Definition`" section of the <<vulkan-spec,
1847Vulkan API Specification>>.
1848
1849== Attributes of tag:format Tags
1850
1851  * attr:name - required.
1852    Format name, matching a `VkFormat` tag:enum attr:name.
1853    Example: `name="VK_FORMAT_R8_UNORM"`.
1854  * attr:class - required.
1855    Format class.
1856    A string whose value is shared by a group of formats which may be
1857    compatible, and is a textual description of something important that
1858    group has in common.
1859    Example: `class="8-bit"`.
1860  * attr:blockSize - required.
1861    A decimal integer which is the texel block size, in bytes, of the
1862    format.
1863  * attr:texelsPerBlock - required
1864    A decimal integer which is the number of texels in a texel block of the
1865    format.
1866  * attr:blockExtent - optional.
1867    Three-dimensional extent of a texel block.
1868    A comma-separated list of three decimal integers.
1869    If not present, `blockExtent="1,1,1"` is assumed.
1870  * attr:packed - optional.
1871    A decimal integer which is the number of bits into which the format is
1872    packed.
1873    If defined, a single image element in this format can be stored in the
1874    same space as a scalar type of this bit width.
1875  * attr:compressed - optional.
1876    A string whose value is shared by a group of formats which use the same
1877    general texture compression scheme, and is a textual description of that
1878    scheme.
1879    Example: `compressed="ASTC LDR"`.
1880  * attr:chroma - optional.
1881    A string used to mark if {YCbCr} samplers are required by default when
1882    using this format.
1883    Must be one of the three values `"420"`, `"422"`, or `"444"`
1884    corresponding to different {YCbCr} encodings.
1885
1886== Contents of tag:format Tags
1887
1888One or more <<tag-component,tag:component>> tags.
1889The order of tag:component tags corresponds to the memory order of
1890components of the format.
1891Each tag describes the size and format of that component.
1892
1893Zero or more <<tag-plane,tag:plane>> tags, in arbitrary order.
1894Each tag describes the scale of a specific image plane of the format
1895relative to the overall format.
1896
1897Zero or more <<tag-spirvimageformat,tag:spirvimageformat>> tags, in
1898arbitrary order.
1899Each tag describes a SPIR-V format name corresponding to the tag:format.
1900
1901== Example of a tag:format Tag
1902
1903[source,xml]
1904--------------------------------------
1905<format name="VK_FORMAT_G16_B16R16_2PLANE_420_UNORM" class="16-bit 2-plane 420" blockSize="6" texelsPerBlock="1" chroma="420">
1906    <component name="G" bits="16" numericFormat="UNORM" planeIndex="0"/>
1907    <component name="B" bits="16" numericFormat="UNORM" planeIndex="1"/>
1908    <component name="R" bits="16" numericFormat="UNORM" planeIndex="1"/>
1909    <plane index="0" widthDivisor="1" heightDivisor="1" compatible="VK_FORMAT_R16_UNORM"/>
1910    <plane index="1" widthDivisor="2" heightDivisor="2" compatible="VK_FORMAT_R16G16_UNORM"/>
1911</format>
1912--------------------------------------
1913
1914
1915[[tag-component]]
1916= Format Components (tag:component Tag)
1917
1918The tag:component tag contains definitions of each of the components which
1919are part of an image format.
1920
1921== Attributes of tag:component Tags
1922
1923  * attr:name - required.
1924    A string specifying the name of this component.
1925    Must be one of the values `"R"`, `"G"`, `"B"`, `"A"`, `"D"`, or `"S"`
1926    corresponding to red, green, blue, alpha, depth, and stencil components,
1927    respectively.
1928  * attr:bits - required.
1929    Must be either a decimal integer which is the number of bits in this
1930    component, or `"compressed"`, corresponding to a specific compression
1931    scheme.
1932  * attr:numericFormat - required.
1933    A string specifying the scalar data type of the component.
1934    Must be one of the following values:
1935  ** `"SFLOAT"` - signed floating-point numbers
1936  ** `"SINT"` - signed integer values in the range [-2^n-1^,2^n-1^-1]
1937  ** `"SNORM"` - signed normalized values in the range [-1,1]
1938  ** `"SRGB"` - R, G, and B components are unsigned normalized values that represent values using sRGB nonlinear encoding, while the A component (if one exists) is a regular unsigned normalized value
1939  ** `"SSCALED"` - signed integer values that get converted to floating-point in the range [-2^n-1^,2^n-1^-1]
1940  ** `"UFLOAT"` - unsigned floating-point numbers (used by packed, shared exponent, and some compressed formats)
1941  ** `"UINT"` - unsigned integer values in the range [0,2^n^-1]
1942  ** `"UNORM"` - unsigned normalized values in the range [0,1]
1943  ** `"USCALED"` - unsigned integer values that get converted to floating-point in the range [0,2^n^-1]
1944  * attr:planeIndex - optional.
1945    A decimal integer specifying which plane this component lies in.
1946    If present, must correspond to the attr:index attribute value of a
1947    tag:plane tag for the same tag:component.
1948
1949== Contents of tag:component Tags
1950
1951None.
1952
1953
1954[[tag-plane]]
1955= Format Planes (tag:plane Tag)
1956
1957The tag:plane tag contains definitions of each of the image planes which are
1958part of an image format.
1959
1960== Attributes of tag:plane Tags
1961
1962  * attr:index - required.
1963    An integer specifying the image plane being defined.
1964    Image planes are in the range [0,_p_-1] where _p_ is the number of
1965    planes in the format.
1966  * attr:widthDivisor - required.
1967    An integer specifying the relative width of this plane.
1968    A value of _k_ means that this plane is 1/_k_ the width of the overall
1969    format.
1970  * attr:heightDivisor - required.
1971    An integer specifying the relative height of this plane.
1972    A value of _k_ means that this plane is 1/_k_ the height of the overall
1973    format.
1974  * attr:compatible - required.
1975    A string naming another, single-plane format that this plane is
1976    compatible with.
1977    Must match the attr:name of another attr:format.
1978
1979== Contents of tag:plane Tags
1980
1981None.
1982
1983
1984[[tag-spirvimageformat]]
1985= SPIR-V Image Formats (tag:spirvimageformat Tag)
1986
1987The tag:spirvimageformat tag specifies the name of a SPIR-V image format
1988equivalent to this format.
1989
1990== Attributes of tag:spirvimageformat Tags
1991
1992  * attr:name - required.
1993    The name of the SPIR-V image format.
1994    Example: `name="R11fG11fB10f"`.
1995
1996== Contents of tag:spirvimageformat Tags
1997
1998None.
1999
2000
2001[[tag-spirvextensions]]
2002= SPIR-V Extensions (tag:spirvextensions Tag)
2003
2004The tag:spirvextensions tag contains definitions of each of the SPIR-V
2005extensions which are defined for the API.
2006
2007== Attributes of tag:spirvextensions Tags
2008
2009  * attr:comment - optional.
2010    Arbitrary string (unused).
2011
2012== Contents of tag:spirvextensions Tags
2013
2014Each tag:spirvextensions block contains zero or more tag:spirvextension tags, each
2015describing an single SPIR-V extension, in arbitrary order.
2016
2017
2018[[tag-spirvextension]]
2019= SPIR-V Extension (tag:spirvextension Tag)
2020
2021SPIR-V extensions are described in individual tag:spirvextension tags.
2022A SPIR-V extension is enabled by API versions or extensions.
2023
2024== Attributes of tag:spirvextension Tags
2025
2026  * attr:name - required.
2027    SPIR-V extension name.
2028    Example: `name="SPV_KHR_variable_pointers"`
2029
2030== Contents of tag:spirvextension Tags
2031
2032One or more <<tag-spirvenable,tag:enable>> tags, in arbitrary order.
2033Each tag describes a single enabling mechanism for the extension.
2034
2035== Example of a tag:spirvextensions Tag
2036
2037[source,xml]
2038--------------------------------------
2039<spirvextension name="SPV_KHR_multiview">
2040    <enable version="VK_VERSION_1_1"/>
2041    <enable extension="VK_KHR_multiview"/>
2042</spirvextension>
2043--------------------------------------
2044
2045
2046[[tag-spirvcapabilities]]
2047= SPIR-V Capabilities (tag:spirvcapabilities Tag)
2048
2049The tag:spirvcapabilities tag contains definitions of each of the SPIR-V
2050capabilities which are defined for the API.
2051
2052== Attributes of tag:spirvcapabilities Tags
2053
2054  * attr:comment - optional.
2055    Arbitrary string (unused).
2056
2057== Contents of tag:spirvcapabilities Tags
2058
2059Each tag:spirvcapabilities block contains zero or more tag:spirvcapability
2060tags, each describing an single SPIR-V capability, in arbitrary order.
2061
2062
2063[[tag-spirvcapability]]
2064= SPIR-V Capability (tag:spirvcapability Tag)
2065
2066SPIR-V capabilities are described in individual tag:spirvcapability tags.
2067A SPIR-V capability is enabled by API versions, extensions, features, or
2068properties.
2069
2070== Attributes of tag:spirvcapability Tags
2071
2072  * attr:name - required.
2073    SPIR-V capability name.
2074    Example: `name="SPV_KHR_variable_pointers"`
2075
2076== Contents of tag:spirvcapability Tags
2077
2078One or more <<tag-spirvenable,tag:enable>> tags, in arbitrary order.
2079Each tag describes a single enabling mechanism for the capability.
2080
2081== Example of a tag:spirvcapabilities Tag
2082
2083[source,xml]
2084--------------------------------------
2085<spirvcapability name="ImageCubeArray">
2086    <enable struct="VkPhysicalDeviceFeatures" feature="imageCubeArray" requires="VK_VERSION_1_0"/>
2087</spirvcapability>
2088<spirvcapability name="GroupNonUniform">
2089    <enable property="VkPhysicalDeviceVulkan11Properties" member="subgroupSupportedOperations" value="VK_SUBGROUP_FEATURE_BASIC_BIT" requires="VK_VERSION_1_1"/>
2090</spirvcapability>
2091--------------------------------------
2092
2093
2094[[tag-spirvenable]]
2095= SPIR-V Enables (tag:enable Tag)
2096
2097The tag:enable tag describes a single mechanism in the API which enables a
2098tag:spirvextension or tag:spirvcapability.
2099There are four forms of tag:enable tags corresponding to different ways the
2100API may advertise enablement, though not all forms may be used with
2101tag:spirvextension tags.
2102Each form is described separately below.
2103
2104[[tag-syncstage]]
2105= Sync Stage (tag:syncstage Tag)
2106
2107The tag:syncstage tag contains definitions of each Pipeline stage.
2108
2109== Attributes of tag:syncstage Tags
2110
2111  * attr:name - required.
2112    VkPipelineStageFlagBits2 name
2113  * attr:alias - optional.
2114    Semantically equivalent name which is an alias of attr:name.
2115
2116== Contents of tag:syncstage Tags
2117
2118More information about the Pipeline stage using either
2119tag:syncequivalent or tag:syncsupport
2120
2121[[tag-syncaccess]]
2122= Sync Access (tag:syncaccess Tag)
2123
2124The tag:syncaccess tag contains definitions of each Access mask.
2125
2126== Attributes of tag:syncaccess Tags
2127
2128  * attr:name - required.
2129    VkAccessFlagBits2 name
2130  * attr:alias - optional.
2131    Semantically equivalent name which is an alias of attr:name.
2132
2133== Contents of tag:syncaccess Tags
2134
2135More information about the Access mask using either
2136tag:syncequivalent or tag:syncsupport
2137
2138[[tag-syncpipeline]]
2139= Sync Pipeline (tag:syncpipeline Tag)
2140
2141The tag:syncpipeline tag contains definitions of each type of Pipeline.
2142
2143== Attributes of tag:syncpipeline Tags
2144
2145  * attr:name - required.
2146    A unique string identifying the pipeline.
2147
2148== Contents of tag:syncpipeline Tags
2149
2150The tag:syncpipeline lists each pipeline stage in logical order using
2151tag:syncpipelinestage. Stages have extra attributes to describe
2152special ordering within the list
2153
2154[[tag-syncsupport]]
2155= Sync Support (tag:syncsupport Tag)
2156
2157The tag:syncsupport tag contains information what support there is for
2158a given Sync element.
2159
2160== Attributes of tag:syncsupport Tags
2161
2162  * attr:queues - optional.
2163    A comma-separated list of Queue types that are supported.
2164  * attr:stage - optional.
2165    A comma-separated list of Sync Stages that are supported.
2166    This is used to cross-reference with tag:syncstage
2167
2168[[tag-syncequivalent]]
2169= Sync Equivalent (tag:syncequivalent Tag)
2170
2171The tag:syncequivalent tag contains information showing a one-to-many
2172relationship of Sync elements
2173
2174== Attributes of tag:syncsupport Tags
2175
2176  * attr:stage - optional.
2177    A comma-separated list of Sync Stages that are the OR logical
2178    equivalence of the parent Sync Element
2179  * attr:access - optional.
2180    A comma-separated list of Sync Accesses that are the OR logical
2181    equivalence of the parent Sync Element
2182
2183== Attributes for API Version Number Enables
2184
2185  * attr:version - required.
2186    An API feature name, matching a tag:feature attr:name attribute value.
2187
2188If the API version is supported, the SPIR-V extension or capability is
2189enabled.
2190
2191== Attributes for API Extension Enables
2192
2193  * attr:extension - required.
2194    An API extension name, matching an tag:extension attr:name attribute
2195    value.
2196
2197If the API extension is supported and enabled, the SPIR-V extension or
2198capability is enabled.
2199
2200== Attributes for API Feature Enables
2201
2202  * attr:struct - required.
2203    An API feature structure name, matching a tag:struct attr:name attribute
2204    value.
2205  * attr:feature - required.
2206    An API feature name, matching a tag:member tag:name value of the feature
2207    structure.
2208  * attr:requires - required.
2209    A comma-separated list of API feature version numbers and/or extension
2210    names.
2211  * attr:alias - optional.
2212    Another API feature name which is an alias of attr:feature.
2213    Needed when the same feature is provided by two different API versions
2214    or extensions.
2215
2216If one of the API feature version numbers or extensions in the attr:requires
2217list is supported or enabled, respectively; and if the attr:feature name is
2218enabled in the feature structure, the SPIR-V capability is enabled.
2219
2220API feature enables are not supported for tag:spirvextension tags.
2221
2222== Attributes for API Property Enables
2223
2224  * attr:property - required.
2225    An API property structure name, matching a tag:struct attr:name
2226    attribute value.
2227  * attr:member - required.
2228    An API property name, matching a tag:member tag:name value of the
2229    attr:property structure.
2230  * attr:value - required.
2231    A value, matching an API tag:enum tag:name value.
2232    If the property is a bitfield, tag:value must be a bitmask value
2233    belonging to the attr:member bitfield type.
2234    Otherwise, tag:value must be an tag:enum name defined for the
2235    attr:member enumeration type.
2236  * attr:requires - optional.
2237    A comma-separated list of API feature version numbers and/or extension
2238    names.
2239
2240If one of the API feature version numbers or extensions in the attr:requires
2241list is supported or enabled, respectively; and if the attr:member property
2242contains the tag:value bit, or matches the tag:value, the SPIR-V capability
2243is enabled.
2244
2245API property enables are not supported for tag:spirvextension tags.
2246
2247== Contents of tag:enable Tags
2248
2249None.
2250
2251
2252[[examples]]
2253= Examples / FAQ / How Do I?
2254
2255For people new to the Registry, it will not be immediately obvious how to
2256make changes.
2257This section includes some tips and examples that will help you make changes
2258to the Vulkan headers by changing the Registry XML description.
2259
2260First, follow the steps described to <<starting,get the Vulkan GitHub
2261repository>> containing the registry and assemble the tools necessary to
2262work with the XML registry.
2263Once you are able to regenerate the Vulkan headers from `vk.xml`, you can
2264start making changes.
2265
2266
2267== General Strategy
2268
2269If you are _adding_ to the API, perform the following steps to _create_ the
2270description of that API element:
2271
2272  * For each type, enum group, compile time constant, and command being
2273    added, create appropriate new tag:type, tag:enums, tag:enum, or
2274    tag:command tags defining the interface in question.
2275  * Make sure that all added types and commands appropriately tag their
2276    dependencies on other types by adding nested tag:type tags.
2277  * Make sure that each new tag defines the name of the corresponding type,
2278    enum group, constant, or command, and that structure/union types and
2279    commands tag the types and names of all their members and parameters.
2280    This is essential for the automatic dependency process to work.
2281
2282If you are _modifying_ existing APIs, just make appropriate changes in the
2283existing tags.
2284
2285Once the definition is added, proceed to the next section to create
2286dependencies on the changed feature.
2287
2288
2289== API Feature Dependencies
2290
2291When you add new API elements, they will not result in corresponding changes
2292in the generated header unless they are _required_ by the interface being
2293generated.
2294This makes it possible to include different API versions and extensions in a
2295single registry and pull them out as needed.
2296So you must introduce a dependency on new features in the corresponding
2297tag:feature tag.
2298
2299There are multiple API versions defined for Vulkan at this time.
2300The initial Vulkan 1.0 tag can be found by searching for
2301
2302[source,xml]
2303--------------------------------------
2304<feature api="vulkan" name="VK_VERSION_1_0"
2305--------------------------------------
2306
2307Inside a tag:feature tag are multiple tag:require tags.
2308Some of these tags are used to express extension interactions, and others
2309only as a logical grouping mechanism for related parts of that API feature.
2310
2311
2312=== API Feature Walkthrough
2313
2314This section walks through the first few required API features in the
2315`vk.xml` tag:feature tag, showing how each requirement pulls in type, token,
2316and command definitions and turns those into definitions in the C header
2317file `vulkan_core.h`.
2318
2319Consider the first few lines of the tag:feature:
2320
2321[source,xml]
2322--------------------------------------
2323<require comment="Header boilerplate">
2324    <type name="vk_platform"/>
2325</require>
2326<require comment="API constants">
2327    <enum name="VK_MAX_PHYSICAL_DEVICE_NAME"/>
2328    <enum name="VK_MAX_EXTENSION_NAME"/>
2329    ...
2330</require>
2331<require comment="Device initialization">
2332    <command name="vkCreateInstance"/>
2333    ...
2334--------------------------------------
2335
2336The first tag:require block says to require a type named `vk_platform`.
2337If you look at the beginning of the tag:types section, there is a
2338corresponding definition section:
2339
2340[source,xml]
2341--------------------------------------
2342<type name="vk_platform">#include "vk_platform.h"
2343#define VK_MAKE_VERSION(major, minor, patch) \
2344    ((major &lt;&lt; 22) | (minor &lt;&lt; 12) | patch)
2345    ...
2346--------------------------------------
2347
2348This section is invoked by the requirement and emits a bunch of boilerplate
2349C code.
2350The explicit dependency is not strictly required since `vk_platform` will be
2351required by many other types, but placing it first causes this to appear
2352first in the output file.
2353
2354Note that `vk_platform` does not correspond to an actual C type, but instead
2355to a collection of freeform preprocessor includes and macros and comments.
2356Most other tag:type tags do define a specific type and are much simpler, but
2357this approach can be used to inject arbitrary C into the Vulkan headers
2358*when there is no other way*.
2359In general inserting arbitrary C is strongly discouraged outside of specific
2360special cases like this.
2361
2362The next tag:require block pulls in some compile time constants.
2363These correspond to the definitions found in the first tag:enums section of
2364`vk.xml`:
2365
2366[source,xml]
2367--------------------------------------
2368<enums name="API Constants"
2369       comment="Vulkan hardcoded constants - not an enumerated type, part of the header boilerplate">
2370    <enum value="256"        name="VK_MAX_PHYSICAL_DEVICE_NAME"/>
2371    <enum value="256"        name="VK_MAX_EXTENSION_NAME"/>
2372    ...
2373--------------------------------------
2374
2375The third tag:require block starts pulling in some Vulkan commands.
2376The first command corresponds to the following definition found in the
2377tag:commands section of `vk.xml`:
2378
2379[source,xml]
2380--------------------------------------
2381<commands>
2382    <command>
2383        <proto><type>VkResult</type> <name>vkCreateInstance</name></proto>
2384        <param>const <type>VkInstanceCreateInfo</type>* <name>pCreateInfo</name></param>
2385        <param><type>VkInstance</type>* <name>pInstance</name></param>
2386    </command>
2387    ...
2388--------------------------------------
2389
2390In turn, the tag:command tag requires the tag:types `VkResult`,
2391`VkInstanceCreateInfo`, and `VkInstance` as part of its definition.
2392The definitions of these types are determined as follows:
2393
2394For `VkResult`, the corresponding required tag:type is:
2395
2396[source,xml]
2397--------------------------------------
2398<type name="VkResult" category="enum"/>
2399--------------------------------------
2400
2401Since this is an enumeration type, it simply links to an tag:enums tag with
2402the same name:
2403
2404[source,xml]
2405--------------------------------------
2406<enums name="VkResult" type="enum" comment="API result codes">
2407        <comment>Return codes (positive values)</comment>
2408    <enum value="0"     name="VK_SUCCESS"/>
2409    <enum value="1"     name="VK_UNSUPPORTED"/>
2410    <enum value="2"     name="VK_NOT_READY"/>
2411    ...
2412        <comment>Error codes (negative values)</comment>
2413    <enum value="-1"    name="VK_ERROR_OUT_OF_HOST_MEMORY" comment="A host memory allocation has failed"/>
2414    ...
2415--------------------------------------
2416
2417For `VkInstanceCreateInfo`, the required tag:type is:
2418
2419[source,xml]
2420--------------------------------------
2421<type category="struct" name="VkInstanceCreateInfo">
2422    <member values="VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
2423    <member>const void*                         <name>pNext</name></member>
2424    <member>const <type>VkApplicationInfo</type>* <name>pAppInfo</name></member>
2425    <member>const <type>VkAllocCallbacks</type>* <name>pAllocCb</name></member>
2426    <member><type>uint32_t</type>               <name>extensionCount</name></member>
2427    <member>const <type>char</type>*const*      <name>ppEnabledExtensionNames</name></member>
2428</type>
2429--------------------------------------
2430
2431This is a structure type, defining a C `struct` with all the members defined
2432in each tag:member tag in order.
2433In addition, it requires some other types, whose definitions are located by
2434name in exactly the same fashion.
2435
2436For the final direct dependency of the command, `VkInstance`, the required
2437tag:type is:
2438
2439[source,xml]
2440--------------------------------------
2441    <comment>Types which can be void pointers or class pointers, selected at compile time</comment>
2442<type>VK_DEFINE_BASE_HANDLE(<name>VkObject</name>)</type>
2443<type>VK_DEFINE_DISP_SUBCLASS_HANDLE(<name>VkInstance</name>, <type>VkObject</type>)</type>
2444--------------------------------------
2445
2446In this case, the type `VkInstance` is defined by a special compile time
2447macro which defines it as a derived class of `VkObject` (for `C```) or a
2448less typesafe definition (for C).
2449This macro is not part of the type dependency analysis, just the boilerplate
2450used in the header.
2451
2452If these are the only tag:feature dependencies in `vk.xml`, the resulting
2453`vulkan_core.h` header will look like this:
2454
2455[source,c]
2456--------------------------------------
2457#ifndef VULKAN_H_
2458#define VULKAN_H_ 1
2459
2460#ifdef __cplusplus
2461extern "C" {
2462#endif
2463
2464/*
2465** Copyright 2015-2023 The Khronos Group Inc.
2466    ...
2467*/
2468
2469/*
2470** This header is generated from the Khronos Vulkan XML API Registry.
2471**
2472** Generated on date 20170208
2473*/
2474
2475
2476#define VK_VERSION_1_0 1
2477#include "vk_platform.h"
2478#define VK_MAKE_VERSION(major, minor, patch) \
2479    ((major << 22) | (minor << 12) | patch)
2480
2481// Vulkan API version supported by this file
2482#define VK_API_VERSION VK_MAKE_VERSION(0, 104, 0)
2483
2484#if defined (__cplusplus) && (VK_UINTPTRLEAST64_MAX == UINTPTR_MAX)
2485    #define VK_TYPE_SAFE_COMPATIBLE_HANDLES 1
2486#endif
2487
2488#if defined(VK_TYPE_SAFE_COMPATIBLE_HANDLES) && !defined(VK_DISABLE_TYPE_SAFE_HANDLES)
2489    #define VK_DEFINE_PTR_HANDLE(_obj) struct _obj##_T { char _placeholder; }; typedef _obj##_T* _obj;
2490    #define VK_DEFINE_PTR_SUBCLASS_HANDLE(_obj, _base) struct _obj##_T : public _base##_T {}; typedef _obj##_T* _obj;
2491
2492    #define VK_DEFINE_BASE_HANDLE(_obj) VK_DEFINE_PTR_HANDLE(_obj)
2493    #define VK_DEFINE_DISP_SUBCLASS_HANDLE(_obj, _base) VK_DEFINE_PTR_SUBCLASS_HANDLE(_obj, _base)
2494    #define VK_DEFINE_NONDISP_SUBCLASS_HANDLE(_obj, _base) VK_DEFINE_PTR_SUBCLASS_HANDLE(_obj, _base)
2495#else
2496    #define VK_DEFINE_BASE_HANDLE(_obj) typedef VkUintPtrLeast64 _obj;
2497    #define VK_DEFINE_DISP_SUBCLASS_HANDLE(_obj, _base) typedef uintptr_t _obj;
2498    #define VK_DEFINE_NONDISP_SUBCLASS_HANDLE(_obj, _base) typedef VkUintPtrLeast64 _obj;
2499#endif
2500
2501typedef enum {
2502    VK_SUCCESS = 0,
2503    VK_UNSUPPORTED = 1,
2504    VK_NOT_READY = 2,
2505    ...
2506} VkResult;
2507typedef enum {
2508    VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
2509    ...
2510} VKStructureType;
2511typedef struct {
2512    VkStructureType                             sType;
2513    const void*                                 pNext;
2514    const char*                                 pAppName;
2515    uint32_t                                    appVersion;
2516    const char*                                 pEngineName;
2517    uint32_t                                    engineVersion;
2518    uint32_t                                    apiVersion;
2519} VkApplicationInfo;
2520typedef enum {
2521    VK_SYSTEM_ALLOC_TYPE_API_OBJECT = 0,
2522    ...
2523} VkSystemAllocType;
2524typedef void* (VKAPI_PTR *PFN_vkAllocFunction)(
2525    void*                           pUserData,
2526    size_t                          size,
2527    size_t                          alignment,
2528    VkSystemAllocType               allocType);
2529typedef void (VKAPI_PTR *PFN_vkFreeFunction)(
2530    void*                           pUserData,
2531    void*                           pMem);
2532typedef struct {
2533    void*                                       pUserData;
2534    PFN_vkAllocFunction                         pfnAlloc;
2535    PFN_vkFreeFunction                          pfnFree;
2536} VkAllocCallbacks;
2537typedef struct {
2538    VkStructureType                             sType;
2539    const void*                                 pNext;
2540    const VkApplicationInfo*                    pAppInfo;
2541    const VkAllocCallbacks*                     pAllocCb;
2542    uint32_t                                    extensionCount;
2543    const char*const*                           ppEnabledExtensionNames;
2544} VkInstanceCreateInfo;
2545VK_DEFINE_BASE_HANDLE(VkObject)
2546VK_DEFINE_DISP_SUBCLASS_HANDLE(VkInstance, VkObject)
2547#define VK_MAX_PHYSICAL_DEVICE_NAME       256
2548#define VK_MAX_EXTENSION_NAME             256
2549typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, VkInstance* pInstance);
2550#ifndef VK_NO_PROTOTYPES
2551VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(
2552    const VkInstanceCreateInfo*                 pCreateInfo,
2553    VkInstance*                                 pInstance);
2554#endif
2555
2556#ifdef __cplusplus
2557}
2558#endif
2559
2560#endif
2561--------------------------------------
2562
2563Note that several additional types are pulled in by the type dependency
2564analysis, but only those types, commands, and tokens required by the
2565specified features are generated.
2566
2567
2568[[compile-time-constants]]
2569== How to Add a Compile Time Constant
2570
2571Go to the desired tag:feature or tag:extension tag.
2572Add (if not present) a nested tag:require block labelled
2573
2574[source,xml]
2575--------------------------------------
2576<require comment="API constants">
2577--------------------------------------
2578
2579In this block, add an (appropriately indented) tag like
2580
2581[source,xml]
2582--------------------------------------
2583    <enum name="VK_THE_ANSWER"/>
2584--------------------------------------
2585
2586Then go to the tag:enums block labelled
2587
2588[source,xml]
2589--------------------------------------
2590<enums comment="Misc. hardcoded constants - not an enumerated type">
2591--------------------------------------
2592
2593In this block, add a tag whose attr:name attribute matches the attr:name you
2594defined above and whose attr:value attribute is the value to give the
2595constant:
2596
2597[source,xml]
2598--------------------------------------
2599    <enum value="42" type="uint32_t" name="VK_THE_ANSWER"/>
2600--------------------------------------
2601
2602The attr:type attribute must be present, and must have one of the allowed
2603values `uint32_t`, `uint64_t`, or `float`.
2604
2605
2606[[compile-time-constants-format]]
2607== Allowed Format of Compile Time Constants
2608
2609The attr:value attribute must be a legal C99 constant scalar expression when
2610evaluated at compilation time.
2611Allowed expressions are additionally restricted to the following syntax:
2612
2613  * a single C decimal integer or floating-point value
2614  * optionally prefixed with `~`
2615  * optionally suffixed with `U`, `UL`, `ULL`, or `F`
2616  * and the entire expression optionally surrounded by paired `(` and `)`.
2617
2618
2619== How to Add a Struct or Union Type
2620
2621For this example, assume we want to define a type corresponding to a C
2622`struct` defined as follows:
2623
2624[source,c]
2625--------------------------------------
2626typedef struct {
2627    VkStructureType          sType;
2628    const void*              pNext;
2629    const VkApplicationInfo* pAppInfo;
2630    const VkAllocCallbacks*  pAllocCb;
2631    uint32_t                 extensionCount;
2632    const char*const*        ppEnabledExtensionNames;
2633} VkInstanceCreateInfo;
2634--------------------------------------
2635
2636If `VkInstanceCreateInfo` is the type of a parameter of a command in the
2637API, make sure that command's definition (see below for how to add a
2638command) puts `VkInstanceCreateInfo` in nested tag:type tags where it is
2639used.
2640
2641Otherwise, if the struct type is not used directly by a command in the API,
2642nor required by a chain of type dependencies for other commands, an explicit
2643tag:type dependency should be added to the tag:feature tag.
2644Go to the tag:types tag and search for the nested block labelled
2645
2646[source,xml]
2647--------------------------------------
2648<require comment="Types not directly used by the API. Include e.g. structs that are not parameter types of commands, but still defined by the API.">
2649    ...
2650--------------------------------------
2651
2652In this block, add a tag whose attr:name attribute matches the attr:name of
2653the struct type being defined:
2654
2655[source,xml]
2656--------------------------------------
2657<require comment="API types not used by commands">
2658    <type name="VkInstanceCreateInfo"/>
2659    ...
2660--------------------------------------
2661
2662Then go to the tag:types tag and add a new tag:type tag defining the struct
2663names and members, somewhere below the corresponding comment, like this:
2664
2665[source,xml]
2666--------------------------------------
2667<types>
2668    ...
2669        <comment>Struct types</comment>
2670    <type category="struct" name="VkInstanceCreateInfo">
2671        <member><type>VkStructureType</type>
2672                <name>sType</name></member>
2673        <member>const void*
2674                <name>pNext</name></member>
2675        <member>const <type>VkApplicationInfo</type>*
2676                <name>pAppInfo</name></member>
2677        <member>const <type>VkAllocCallbacks</type>*
2678                <name>pAllocCb</name></member>
2679        <member><type>uint32_t</type>
2680                <name>extensionCount</name></member>
2681        <member>const <type>char</type>*const*
2682                <name>ppEnabledExtensionNames</name></member>
2683    </type>
2684    ...
2685--------------------------------------
2686
2687If any of the member types are types also defined in the header, make sure
2688to enclose those type names in nested tag:type tags, as shown above.
2689Basic C types should not be tagged.
2690
2691If the type is a C `union`, rather than a `struct`, then set the value of
2692the attr:category attribute to `"union"` instead of `"struct"`.
2693
2694
2695== How to Add an Enumerated Type
2696
2697For this example, assume we want to define a type corresponding to a C
2698`enum` defined as follows:
2699
2700[source,c]
2701--------------------------------------
2702typedef enum {
2703    VK_DEVICE_CREATE_VALIDATION_BIT = 0x00000001,
2704    VK_DEVICE_CREATE_MULTI_DEVICE_IQ_MATCH_BIT = 0x00000002;
2705} VkDeviceCreateFlagBits.
2706--------------------------------------
2707
2708If `VkDeviceCreateFlagBits` is the type of a parameter to a command in the
2709API, or of a member in a structure or union, make sure that command
2710parameter or struct member's definition puts `VkDeviceCreateFlagBits` in
2711nested tag:type tags where it is used.
2712
2713Otherwise, if the enumerated type is not used directly by a command in the
2714API, nor required by a chain of type dependencies for commands and structs,
2715an explicit tag:type dependency should be added to the tag:feature tag in
2716exactly the same fashion as described above for `struct` types.
2717
2718Next, go to the line labelled
2719
2720[source,xml]
2721--------------------------------------
2722<comment>Vulkan enumerant (token) definitions</comment>
2723--------------------------------------
2724
2725At an appropriate point below this line, add an tag:enums tag whose
2726attr:name attribute matches the tag:type name `VkDeviceCreateFlagBits`, and
2727whose contents correspond to the individual fields of the enumerated type:
2728
2729[source,xml]
2730--------------------------------------
2731<enums name="VkDeviceCreateFlagBits" type="bitmask">
2732    <enum bitpos="0" name="VK_DEVICE_CREATE_VALIDATION_BIT"/>
2733    <enum bitpos="1" name="VK_DEVICE_CREATE_MULTI_DEVICE_IQ_MATCH_BIT"/>
2734</enums>
2735--------------------------------------
2736
2737Several other attributes of the tag:enums tag can be set.
2738In this case, the attr:type attribute is set to `"bitmask"`, indicating that
2739the individual enumerants represent elements of a bitmask.
2740
2741The individual tag:enum tags define the enumerants, just like the definition
2742for compile time constants described above.
2743In this case, because the enumerants are bits in a bitmask, their values are
2744specified using the attr:bitpos attribute.
2745The value of this attribute must be an integer in the range [0,30]
2746specifying a single bit number, and the resulting value is printed as a
2747hexadecimal constant corresponding to that bit.
2748
2749It is also possible to specify enumerant values using the attr:value
2750attribute, in which case the specified numeric value is passed through to
2751the C header unchanged.
2752
2753
2754[[adding-bitflags]]
2755== How to Add Bit Flags
2756
2757Bit masks are defined by two types in the xml - the type of the mask itself,
2758and the type of the valid flags.
2759
2760For this example, assume we want to define bit flags that can handle up to
276164 independent values as follows:
2762
2763[source,c]
2764--------------------------------------
2765// Flag bits for VkExampleFlagBits
2766typedef VkFlags64 VkExampleFlagBits;
2767static const VkExampleFlagBits VK_EXAMPLE_NONE = 0;
2768static const VkExampleFlagBits VK_EXAMPLE_FIRST_BIT = 0x00000001;
2769static const VkExampleFlagBits VK_EXAMPLE_SECOND_BIT = 0x00000002;
2770
2771typedef VkFlags64 VkExampleFlags;
2772--------------------------------------
2773
2774An explicit tag:type dependency should be added to the tag:feature tag in
2775exactly the same fashion as described above for `struct` types.
2776
2777Firstly, a definition is needed for the flags type used as a parameter to
2778commands or member of functions.
2779Go to the line labelled:
2780
2781[source,xml]
2782--------------------------------------
2783<comment>Bitmask types</comment>
2784--------------------------------------
2785
2786At the end of the list of `VkFlags` and `VkFlags64` types, add a definition
2787of the flags type like so:
2788
2789[source,xml]
2790--------------------------------------
2791<type bitvalues="VkExampleFlagBits" category="bitmask">typedef <type>VkFlags64</type> <name>VkExampleFlags</name>;</type>
2792--------------------------------------
2793
2794The attr:category defines this as a `"bitmask"` type.
2795The attr:bitvalues attribute identifies the `*FlagBits` entry defining the
2796flag bits associated with this type.
2797
2798Next, go to the line labelled:
2799
2800[source,xml]
2801--------------------------------------
2802<comment>Types generated from corresponding enums tags below</comment>
2803--------------------------------------
2804
2805At an appropriate point in the list of enum types after this comment, add
2806the following line:
2807
2808[source,xml]
2809--------------------------------------
2810<type name="VkExampleFlagBits" category="enum"/>
2811--------------------------------------
2812
2813This defines a type for the flag bits for generators that need it.
2814The attr:category attribute of `"enum"` identifies that this is an
2815enumerated type.
2816
2817Finally, go to the line labelled:
2818
2819[source,xml]
2820--------------------------------------
2821<comment>Vulkan enumerant (token) definitions</comment>
2822--------------------------------------
2823
2824At the end of the list of enum definitions below this line, add an tag:enums
2825tag whose attr:name attribute matches the tag:type name `VkExampleFlagBits`,
2826and whose contents correspond to the individual fields of the enumerated
2827type:
2828
2829[source,xml]
2830--------------------------------------
2831<enums name="VkExampleFlagBits" type="bitmask" bitwidth="64">
2832    <enum value="0" name="VK_EXAMPLE_NONE"/>
2833    <enum bitpos="0" name="VK_EXAMPLE_FIRST_BIT"/>
2834    <enum bitpos="1" name="VK_EXAMPLE_SECOND_BIT"/>
2835</enums>
2836--------------------------------------
2837
2838The attr:type attribute is set to `"bitmask"`, indicating that the
2839individual enumerants represent elements of a bitmask.
2840The attr:bitwidth attribute is set to `"64"` indicating that this is a
284164-bit flag type.
2842
2843The individual tag:enum tags define the enumerants, just like the definition
2844for compile time constants described above.
2845In this case, a "no flags" type is defined in `VK_EXAMPLE_NONE` with the
2846attr:value attribute defining it to have a hard value of 0.
2847The other types have their values are specified using the attr:bitpos
2848attribute, as these are actual bit flag values.
2849The value of this attribute must be an integer in the range [0,63]
2850specifying a single bit number, and the resulting value is printed as a
2851hexadecimal constant corresponding to that bit.
2852
2853
2854=== 32-bit Flags
2855
2856Bit flags can also be defined using 32-bit C enum types.
2857Doing so is broadly similar to 64-bit bit flags, but with a few key
2858differences.
2859For this example, assume we want to define the same type as above, but
2860corresponding to a C `enum` and flags type defined as follows:
2861
2862[source,c]
2863--------------------------------------
2864typedef enum VkExampleFlagBits {
2865    VK_EXAMPLE_NONE
2866    VK_DEVICE_CREATE_VALIDATION_BIT = 0x00000001,
2867    VK_DEVICE_CREATE_MULTI_DEVICE_IQ_MATCH_BIT = 0x00000002;
2868} VkExampleFlagBits;
2869
2870typedef VkFlags VkExampleFlags;
2871--------------------------------------
2872
2873To add this to the xml, entries need to be added to the XML in the same way
2874as above, but with slightly different attributes:
2875
2876For the flag type definition, the entry should use `VkFlags` instead of
2877`VkFlags64`, and require the flag bits type, instead of specifying the
2878attr:bitvalues attribute:
2879
2880[source,xml]
2881--------------------------------------
2882<type requires="VkExampleFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkExampleFlags</name>;</type>
2883--------------------------------------
2884
2885For the definition of the enumerated flag values themselves, the bitwidth
2886needs to either be changed to `"32"`, or omitted entirely (which defaults to
2887a bitwidth of 32) as follows:
2888
2889[source,xml]
2890--------------------------------------
2891<enums name="VkExampleFlagBits" type="bitmask">
2892--------------------------------------
2893
2894Note that 32-bit bitmasks must use an integer in the range [0,30] - C enums
2895are only guaranteed to support signed 32-bit integer values, and defining an
2896unsigned value for the 31st bit could change the size of the enum type.
2897The generator scripts will warn about values exceeding this range.
2898
2899
2900== How to Add a Command
2901
2902For this example, assume we want to define the command:
2903
2904[source,c]
2905--------------------------------------
2906VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(
2907    const VkInstanceCreateInfo*                 pCreateInfo,
2908    VkInstance*                                 pInstance);
2909--------------------------------------
2910
2911Commands must always be explicitly required in the tag:feature tag.
2912In that tag, you can use an existing tag:require block including API
2913features which the new command should be grouped with, or define a new
2914block.
2915For this example, add a new block, and require the command by using the
2916tag:command tag inside that block:
2917
2918[source,xml]
2919--------------------------------------
2920<feature api="vulkan" name="VK_VERSION_1_0" number="1.0" comment="Vulkan core API interface definitions">
2921    ...
2922    <require comment="Device initialization">
2923        <command name="vkCreateInstance"/>
2924    </require>
2925    ...
2926</feature>
2927--------------------------------------
2928
2929The tag:require block may include a attr:comment attribute whose value is a
2930descriptive comment of the contents required within that block.
2931The comment is not currently used in header generation, but might be in the
2932future, so use comments which are polite and meaningful to users of the
2933generated header files.
2934
2935Then go to the tag:commands tag and add a new tag:command tag defining the
2936command, preferably sorted into alphabetic order with other commands for
2937ease of reading, as follows:
2938
2939[source,xml]
2940--------------------------------------
2941<commands comment="Vulkan command definitions">
2942    ...
2943    <command>
2944        <proto><type>VkResult</type>
2945               <name>vkCreateInstance</name></proto>
2946        <param>const <type>VkInstanceCreateInfo</type>*
2947               <name>pCreateInfo</name></param>
2948        <param><type>VkInstance</type>*
2949               <name>pInstance</name></param>
2950    </command>
2951    ...
2952</commands>
2953--------------------------------------
2954
2955The tag:proto tag defines the return type and function name of the command.
2956The tag:param tags define the command's parameters in the order in which
2957they are passed, including the parameter type and name.
2958The contents are laid out in the same way as the structure tag:member tags
2959described previously.
2960
2961
2962== More Complicated API Representations
2963
2964The registry schema can represent a good deal of additional information, for
2965example by creating multiple tag:feature tags defining different API
2966versions and extensions.
2967This capability is not yet relevant to Vulkan.
2968Those capabilities will be documented as they are needed.
2969
2970
2971== More Complicated Output Formats and Other Languages
2972
2973The registry schema is oriented towards C-language APIs.
2974Types and commands are defined using syntax which is a subset of C,
2975especially for structure members and command parameters.
2976It would be possible to use a language-independent syntax for representing
2977such information, but since we are writing a C API, any such representation
2978would have to be converted into C anyway at some stage.
2979
2980The `vulkan.h` header is written using an _output generator_ object in the
2981Python scripts.
2982This output generator is specialized for C, but the design of the scripts is
2983intended to support writing output generators for other languages as well as
2984purposes such as documentation (e.g. generating asciidoc fragments
2985corresponding to types and commands for use in the API specification and
2986reference pages).
2987When targeting other languages, the amount of parsing required to convert
2988type declarations into other languages is small.
2989However, it will probably be necessary to modify some of the boilerplate C
2990text, or specialize the tags by language, to support such generators.
2991
2992
2993== Additional Semantic Tagging
2994
2995The schema is being extended to support semantic tags describing various
2996properties of API features, such as:
2997
2998  * constraints on allowed scalar values to function parameters (non-`NULL`,
2999    normalized floating-point, etc.)
3000  * length of arrays corresponding to function pointer parameters
3001  * miscellaneous properties of commands such as whether the application or
3002    system is responsible for threadsafe use; which queues they may be
3003    issued on; whether they are aliases or otherwise related to other
3004    commands; etc.
3005
3006These tags will be used by other tools for purposes such as helping create
3007validation layers, generating serialization code, and so on.
3008We would like to eventually represent everything about the API that is
3009amenable to automatic processing within the registry schema.
3010Please make suggestions on the GitHub issue tracker.
3011
3012
3013[[general:stability]]
3014== Stability of the XML Database and Schema
3015
3016The Vulkan XML schema is evolving in response to corresponding changes in
3017the Vulkan API and ecosystem.
3018Most such change will probably be confined to adding attributes to existing
3019tags and properly expressing the relationships to them, and making API
3020changes corresponding to accepted feature requests.
3021Changes to the schema should be described in the <<changelog,change log>> of
3022this document.
3023Changes to the `.xml` files and Python scripts are logged in GitHub history.
3024
3025
3026[[changelog]]
3027= Change Log
3028
3029  * 2023-06-28 - remove support for tag:member and tag:param attr:optional
3030    attribute value `"false"` (internal issue 3548).
3031  * 2023-06-14 - removed deprecated attr:start and attr:end from tag:enums
3032  * 2023-05-18 - Add tag:sync to help define all sync objects in the XML
3033  * 2023-03-29 - add tag:extension attr:ratified attribute to express
3034    ratification status.
3035  * 2023-02-26 - add normative references section, cite it as needed, and
3036    update description of tag:extension tags to refer to the style guide for
3037    computing numeric enumerant values (public issue 2069).
3038  * 2023-02-22 - specify that attr:depends expressions are
3039    <<depends-expressions, evaluated left-to-right>> for operators of the
3040    same precedence (public issue 2062).
3041  * 2023-02-14 - replace tag:extension attributes attr:requiresCore and
3042    attr:requires, and tag:require attributes attr:feature and
3043    attr:extension, by a new attr:depends attribute. This is an intentional
3044    breaking change to support a more flexible and consistent expression
3045    syntax for these dependencies (internal issues 2883, 3272).
3046  * 2023-01-11 - add attr:deprecated attribute to tag:enum, tag:type,
3047    and tag:type tag:member tags.
3048  * 2022-11-23 - update tag:command attr:queues syntax to include all queue
3049    types currently in use.
3050  * 2022-08-12 - update tag:requires attr:extension syntax to support
3051    logical OR and AND constructs for multiple extensions (internal issue
3052    2922).
3053  * 2022-07-11 - Add attr:videocoding attribute to <<tag-command,tag:command>>
3054    tags to indicate whether a command buffer command can be recorded inside,
3055    outside, or both inside and outside of a video coding scope.
3056  * 2022-06-29 - Add tag:command attribute attr:tasks (internal issue 3117).
3057  * 2022-06-22 - Add attr:validstructs attribute to command
3058    <<tag-command:param:attr, tag:param>> tags when using an abstract
3059    `VkBaseInStructure` or `VkBaseOutStructure` as the formal parameter
3060    type.
3061  * 2022-06-16 - Add `VkSparseImageFormatProperties*` to the list of
3062    structure types allowed to have 'limittype' member attributes.
3063  * 2022-06-08 - Add `exact`, `bits`, `mul` and `pot` limit types.
3064  * 2022-06-08 - Update description of types to which the attr:limittype
3065    attribute of structure tag:member tags can be applied (internal issue
3066    3101).
3067  * 2022-06-08 - Update description of tag:extension attr:requires attribute
3068    such that the specified extensions must be *enabled*, not just
3069    *supported*. This is consistent with the following NOTE, the
3070    specification description of "`required extensions`", and actual use in
3071    the XML of this attribute (internal issue 3116).
3072  * 2021-12-13 - Add attr:api attribute to the tag:member and tag:param
3073    tags.
3074  * 2021-11-29 - Add attr:api attribute to the tag:command tag.
3075  * 2021-10-11 - Add description of the tag:formats tag for describing
3076    Vulkan `VkFormat` image formats, and of the tag:spirvextensions and
3077    tag:spirvcapabilities tags for describing enabling mechanisms for SPIR-V
3078    extensions (internal issue 2484).
3079  * 2021-09-13 - Further clarify that attr:api and attr:supported attributes
3080    are comma-separated list of API names (internal issue 2809).
3081  * 2021-08-22 - Update introductory descriptions of toolchain and scripts.
3082  * 2021-08-15 - Add an explicit description of the tag:enum attr:extends
3083    attribute as introducing a requirement for the enumerated type being
3084    extended.
3085  * 2021-07-12 - Note that tag:extension tags describing instance extensions
3086    must not have dependencies on device extensions (internal issue 2387).
3087  * 2021-06-14 - Add an `objecttype` attribute which specifies the
3088    relationship between a Vulkan handle and another member or parameter
3089    specifying the type of object that handle refers to (public issue 1536).
3090  * 2021-06-06 - Update description of the attr:supported attribute of
3091    <<tag-extension, tag:extension tags>> to mandate that `disabled`
3092    extensions are not processed (public issue 1549).
3093  * 2021-04-21 - Add the attr:limittype attribute to <<tag-type, structure
3094    tag:member tags>>, to describe how queried limits are interpreted
3095    (internal issue 2427).
3096  * 2021-03-30 - Add a description of the <<compile-time-constants-format,
3097    allowed format of compile time constants>> (internal merge request
3098    4451).
3099  * 2021-03-22 - Update allowed values for the attr:type attribute of
3100    tag:enum tags and make it mandatory (internal issue 2564).
3101  * 2021-01-11 - Expand the scope of the attr:optional attribute tag:member
3102    and tag:param tags to specify that the member or parameter may be 0 for
3103    all scalar types, not just bitmasks and array sizes (internal issue
3104    2435).
3105  * 2020-11-23 - Add `objtypeenum` attribute to <<tag:type, tag:type>> tags
3106    to link the object name to the corresponding `VK_OBJECT_TYPE_*`
3107    enumerant, if any (internal issue 2393).
3108  * 2020-11-22 - Add requirement that `pNext` members have the
3109    `optional="true"` attribute set (internal issue 2428).
3110  * 2020-10-14 - Remove advice to set the attr:noautovalidity attribute on
3111    the `pNext` member of extending structures in the <<tag:type, tag:type
3112    tag>>, since the validity generator scripts now take care of this
3113    (internal issue 2335).
3114  * 2020-06-02 - Add description of how to switch between 64- and 32-bit
3115    flags.
3116  * 2020-05-07 - Update description of <<schema:apiname, API Names>> to
3117    current usage, including allowing specifying multiple API names for a
3118    given feature or extension.
3119  * 2020-04-29 - Expand use of attr:category `basetype` in tag:type tags to
3120    include external API types.
3121  * 2020-02-20 - Clarify that tag:enum tags inside tag:remove tags must be
3122    reference enums, not containing attributes defining values.
3123  * 2020-01-13 - Restrict attr:bitpos to [0,30] to avoid poorly defined
3124    compiler behavior.
3125  * 2019-08-25 - Add attr:sortorder attribute to tag:feature and
3126    tag:extension tags.
3127  * 2018-12-06 - Specify that command aliases are not guaranteed to resolve
3128    to the same entry point in the underlying layer stack, matching a
3129    related clarification in the Vulkan Specification.
3130  * 2018-10-01 - Add description of the default value of attr:optional
3131    member and parameter attributes, if not specified.
3132  * 2018-08-28 - Add optional attr:provisional attribute to tag:extension
3133    tags.
3134  * 2018-07-07 - Add optional attr:promotedto, attr:deprecatedby, and
3135    attr:obsoletedby attributes to tag:extension tags.
3136  * 2018-06-25 - Remove attr:vendorids tags for Khronos vendor IDs.
3137  * 2018-05-08 - Add tag:driverids and tag:driverid tags for describing
3138    Vulkan driver implementation identification information.
3139  * 2018-04-15 - Add attr:requiresCore.
3140  * 2018-03-07 - Updated for Vulkan 1.1 release.
3141  * 2018-02-21 - Add descriptions of the attr:extnumber and attr:alias
3142    attributes used for defining tag:enum attributes, the attr:alias
3143    attribute used for defining tag:type aliases, the attr:name and
3144    attr:alias attributes used for defining tag:command aliases, the
3145    attr:platform attribute of tag:extension tags, and the attr:feature
3146    attribute of tag:require tags; and update the document to the header
3147    naming and grouping scheme used starting in Vulkan 1.1.
3148  * 2018-01-07 - Add tag:platforms and tag:platform tags for describing
3149    Vulkan platform names and preprocessor symbols.
3150  * 2017-09-10 - Define syntax of member and parameter attr:altlen
3151    attributes, for use by code generators.
3152  * 2017-09-01 - Define syntax of member and parameter attr:len attributes
3153    consistently and correctly for current uses of latexmath:
3154  * 2017-08-24 - Note that the tag:extension attribute attr:type must be
3155    specified if the extension is not disabled.
3156  * 2017-07-27 - Finish removing validextensionstructs attribute and
3157    replacing it with structextends.
3158  * 2017-07-14 - Add comment attributes or tags as valid content in several
3159    places, replacing XML comments which could not be preserved by XML
3160    transformation tools.
3161  * 2017-02-20 - Change to asciidoctor markup and move into the
3162    specification source directory for ease of building.
3163  * 2016-09-27 - Remove tag:validity and tag:usage tags, since these
3164    explicit usage statements have been moved to the specification source.
3165  * 2016-08-26 - Update for the single-branch model.
3166  * 2016-07-28 - Add attr:type and attr:requires attributes to tag:extension
3167    tags.
3168  * 2016-02-22 - Change math markup in attr:len attributes to use asciidoc
3169    `latexmath:[$` and `$]` delimiters.
3170  * 2016-02-19 - Add attr:successcodes and attr:errorcodes attributes of
3171    tag:command tags.
3172    Add a subsection to the introduction describing the schema choices and
3173    how to file issues against the registry.
3174  * 2016-02-07 - Add attr:vendorids tags for Khronos vendor IDs.
3175  * 2015-12-10 - Add attr:author and attr:contact attributes for
3176    tag:extension tags.
3177  * 2015-12-07 - Move `vulkan/vulkan.h` to a subdirectory.
3178  * 2015-12-01 - Add tag:tags tags for author tags.
3179  * 2015-11-18 - Bring documentation and schema up to date for extension
3180    enumerants.
3181  * 2015-11-02 - Bring documentation and schema up to date with several
3182    recent merges, including tag:validity tags.
3183    Still out of date WRT extension enumerants, but that will change soon.
3184  * 2015-09-08 - Rename `threadsafe` attribute to attr:externsync, and
3185    `implicitunsafeparams` tag to attr:implicitexternsync.
3186  * 2015-09-07 - Update tag:command tag description to remove the
3187    attr:threadsafe attribute and replace it with a combination of
3188    attr:threadunsafe attributes on individual parameters, and
3189    tag:implicitunsafeparams tags describing additional unsafe objects for
3190    the command.
3191  * 2015-08-04 - Add `basetype` and `funcpointer` attr:category values for
3192    type tags, and explain the intended use and order in which types in each
3193    category are emitted.
3194  * 2015-07-02 - Update description of Makefile targets.
3195    Add descriptions of attr:threadsafe, attr:queues, and attr:renderpass
3196    attributes of <<tag-command,tag:command>> tags, and of attr:modified
3197    attributes of <<tag-command:param,tag:param>> tags.
3198  * 2015-06-17 - add descriptions of allowed attr:category attribute values
3199    of tag:type tags, used to group and sort related categories of
3200    declarations together in the generated header.
3201  * 2015-06-04 - Add <<examples,examples of making changes and additions>>
3202    to the registry.
3203  * 2015-06-03 - Move location to new `vulkan` Git repository.
3204    Add definition of tag:type tags for C struct/unions.
3205    Start adding <<examples,examples of making changes>>.
3206  * 2015-06-02 - Branch from OpenGL specfile documentation and bring up to
3207    date with current Vulkan schema.
3208  * 2015-07-10 - Remove contractions to match the style guide.
3209  * 2015-07-19 - Move this document from LaTeX to asciidoc source format and
3210    make minor changes to markup.
3211