Skip to content

Commit

Permalink
Add discussion of processing frameworks being responsible for all def…
Browse files Browse the repository at this point in the history
…ined attributes and tags (#2417)

and refer to it for sortorder and protect attributes

Closes #2395
  • Loading branch information
oddhack authored Aug 22, 2024
1 parent 306edf6 commit 58d38a5
Showing 1 changed file with 52 additions and 6 deletions.
58 changes: 52 additions & 6 deletions registry.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,40 @@ There are a variety of output generators included:
* `extensionStubSource.py` - generate a simple C extension loader.


[[implementations]]
= Alternate Registry Processing Frameworks

We encourage people needing to process registry XML to use the Python
generator framework.
It has been successfully used by many other projects, such as OpenXR and
many of its software components

Be aware that the schema is not static.
Over time, we have introduced a number of non-breaking changes in the form
of additional XML tags and attributes.
On rare occasion we have made a breaking change, such as replacing the
attr:requires syntax and attr:requiresCore attributes for specifying
extension and version dependencies with the attr:depends attribute.

While such changes are supported in the Python scripts when they are made,
downstreams using other XML processing code are responsible for tracking and
implementing corresponding changes.


[[implementations-rare]]
== Rarely Used Tags and Attributes

If you do implement your own XML processing framework, you are responsible
for complying with the interpretation of the schema and its contents, and
producing results consistent with the Python framework.

Choosing to not implement processing of certain tags or attributes may
produce incorrect outputs.
If you are doing this because the tags or attributes are not currently used
in the Vulkan XML, you may want to flag a warning or error when they are
encountered.


[[schema]]
= Vulkan Registry Schema

Expand Down Expand Up @@ -1355,15 +1389,24 @@ feature.
A decimal number which specifies an order relative to other tag:feature
tags when calling output generators.
Defaults to `0`.
Rarely used, for when ordering by attr:name is insufficient.
Used when ordering by attr:name is insufficient.
* attr:protect - optional.
An additional preprocessor token used to protect a feature definition.
Usually another feature or extension attr:name.
Rarely used, for odd circumstances where the definition of a feature or
extension requires another to be defined first.
Used when the definition of a feature or extension requires another to
be defined first.
* attr:comment - optional.
Arbitrary string (unused).

[NOTE]
====
The attr:sortorder and attr:protect attributes may not be used
in the XML at times.
If writing an <<implementations, alternate registry processing framework>>,
refer to the notes on <<implementations-rare, rarely used tags and
attributes>>.
====

[NOTE]
====
The attr:name attribute used for Vulkan core versions, such as
Expand Down Expand Up @@ -1459,7 +1502,7 @@ implemented against.
A decimal number which specifies an order relative to other
tag:extension tags when calling output generators.
Defaults to `0`.
Rarely used, for when ordering by attr:number is insufficient.
Used when ordering by attr:number is insufficient.
* attr:author - optional.
The author name, such as a full company name.
If not present, this can be taken from the corresponding tag:tag
Expand Down Expand Up @@ -1520,8 +1563,8 @@ logical AND, and must be replaced by `+` in the `depends` attribute.
An additional preprocessor token used to protect an extension
definition.
Usually another feature or extension attr:name.
Rarely used, for odd circumstances where the definition of an extension
requires another extension or a header file to be defined first.
Used when the definition of a feature or extension requires another to
be defined first.
* attr:platform - optional.
Indicates that the extension is specific to the platform identified by
the attribute value, and should be emitted conditional on that platform
Expand Down Expand Up @@ -3213,6 +3256,9 @@ Changes to the `.xml` files and Python scripts are logged in GitHub history.
[[changelog]]
= Change Log

* Added notes on <<implementations, alternate registry processing
frameworks>> and referred to them for rarely used attributes in the
<<tag-feature, tag:feature>> tag (public issue 2395).
* 2024-07-18 - Remove out of date guidance that builtin and external types
should not be wrapped in tag:type tags, replaced with actual examples in
the <<tag-type, tag:type>> section (public issue 2394).
Expand Down

0 comments on commit 58d38a5

Please sign in to comment.