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