Skip to content

Commit

Permalink
Changes from OpenXR 1.1.37.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: b84815a669b7ab8721ff5117872d8af17b601754
  • Loading branch information
rpavlik committed May 25, 2024
1 parent 14902d8 commit a7c7a6e
Show file tree
Hide file tree
Showing 121 changed files with 1,138 additions and 458 deletions.
5 changes: 3 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
*.png binary

# git-lfs big files
*.pdf filter=lfs diff=lfs merge=lfs -text
*.glb filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.glb filter=lfs diff=lfs merge=lfs -text
src/conformance/**/*.png filter=lfs diff=lfs merge=lfs -text

# Shell/python scripts that don't end in .sh
specification/makeAllExts eol=lf
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ generated-includes
cmake_install.cmake
cmake_uninstall.cmake
cmake-build-*
specification/vendor/bundle/

# Marker file for a snapshot build
SNAPSHOT
Expand Down
1 change: 1 addition & 0 deletions changes/conformance/mr.2882.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
New test: Add interactive tests for `XR_KHR_composition_layer_equirect` and `XR_KHR_composition_layer_equirect2`.
1 change: 1 addition & 0 deletions changes/conformance/mr.3247.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
New test: Add test which creates a session but does not call `xrDestroySession`.
1 change: 1 addition & 0 deletions changes/conformance/mr.3329.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improvement: Use new `XR_API_VERSION_1_0` and `XR_API_VERSION_1_1` defines.
1 change: 1 addition & 0 deletions changes/conformance/mr.3345.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improvement: Relax too strict palm/grip_surface pose assumptions.
1 change: 1 addition & 0 deletions changes/conformance/mr.3350.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix: Skip StereoWithFoveatedInset-interactive if runtime does not support it.
1 change: 1 addition & 0 deletions changes/conformance/mr.3355.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improvement: Add missing extension name tags to test cases.
1 change: 1 addition & 0 deletions changes/conformance/mr.3356.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improvement: Code cleanup and documentation in helper utilities.
4 changes: 4 additions & 0 deletions changes/conformance/mr.3357.gl.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- mr.3357.gl
---
Improvement: Code cleanups and clang-tidy fixes.
1 change: 1 addition & 0 deletions changes/conformance/mr.3357.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix: Dangling pointer in action test.
1 change: 1 addition & 0 deletions changes/conformance/mr.3358.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improvement: Improve readability of test sources.
1 change: 1 addition & 0 deletions maintainer-scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ getSDKSourceFilenames() {
checkCodespell \
CMakeLists.txt \
format_file.sh \
open-in-docker.sh \
LICENSE \
openxr-codespell.exclude \
runClangFormat.sh \
Expand Down
17 changes: 13 additions & 4 deletions specification/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ SHELL = /usr/bin/env bash
QUIET ?= @
VERYQUIET ?= @
PYTHON ?= python3
ifneq (,$(strip $(BUNDLER)))
ASCIIDOC ?= bundle exec asciidoctor --trace
HEXAPDF ?= bundle exec hexapdf
else
ASCIIDOC ?= asciidoctor
HEXAPDF ?= hexapdf
endif
RM = rm -f
RMRF = rm -rf
MKDIR = mkdir -p
Expand All @@ -33,7 +39,7 @@ endif
VERSIONS := XR_VERSION_1_0 XR_VERSION_1_1 XR_LOADER_VERSION_1_0
VERSIONOPTIONS := $(foreach version,$(VERSIONS),-feature $(version))

SPECREVISION = 1.1.36
SPECREVISION = 1.1.37
REVISION_COMPONENTS = $(subst ., ,$(SPECREVISION))
MAJORMINORVER = $(word 1,$(REVISION_COMPONENTS)).$(word 2,$(REVISION_COMPONENTS))

Expand Down Expand Up @@ -343,7 +349,7 @@ pdfA4: $(PDFA4SPEC)
ASCIIDOCTOR_TARGETS += $(PDFSPEC) $(PDFA4SPEC)

# Target-specific variables and deps customizing the AsciiDoctor rule
$(PDFSPEC) $(PDFA4SPEC): BACKEND_ARGS=--backend pdf --require asciidoctor-pdf -a compress -r ./scripts/pdf-index-customizer.rb
$(PDFSPEC) $(PDFA4SPEC): BACKEND_ARGS=--backend pdf --require asciidoctor-pdf -a compress --require ./scripts/pdf-index-customizer.rb
$(PDFSPEC): PAGESIZE=LETTER
$(PDFA4SPEC): PAGESIZE=A4
$(PDFSPEC) $(PDFA4SPEC): $(COMMONDOCS)
Expand Down Expand Up @@ -647,14 +653,17 @@ $(REGISTRYOUTDIR)/headers/openxr: | $(REGISTRYOUTDIR)/headers
$(QUIET)$(MKDIR) "$@"

release-htmlpdf: html pdf $(REGISTRYOUTDIR)/pdf $(REGISTRYOUTDIR)/html
-asciidoctor-pdf-optimize $(PDFSPEC)
$(QUIET)$(CP) $(PDFSPEC) $(REGISTRYOUTDIR)/pdf/$(SPEC_FILENAME_STEM).pdf
$(ECHO) "[hexapdf] $(call MAKE_RELATIVE,$(REGISTRYOUTDIR)/pdf/$(SPEC_FILENAME_STEM).pdf)"
$(QUIET)$(HEXAPDF) optimize --force $(PDFSPEC) $(REGISTRYOUTDIR)/pdf/$(SPEC_FILENAME_STEM).pdf
$(ECHO) "[cp] $(call MAKE_RELATIVE,$(REGISTRYOUTDIR)/html/$(SPEC_FILENAME_STEM).html)"
$(QUIET)$(CP) $(HTMLSPEC) $(REGISTRYOUTDIR)/html/$(SPEC_FILENAME_STEM).html
.PHONY: release-htmlpdf


release: release-htmlpdf manhtmlpages loader styleguide extprocess | $(REGISTRYOUTDIR) $(REGISTRYOUTDIR)/man
$(ECHO) "[cp] $(call MAKE_RELATIVE,$(REGISTRYOUTDIR))/{styleguide,extprocess,loader}.html"
$(QUIET)$(CP) $(OUTDIR)/styleguide.html $(OUTDIR)/extprocess.html $(OUTDIR)/loader.html $(REGISTRYOUTDIR)
$(ECHO) "[cp] $(REGISTRYOUTDIR)/man/html"
$(QUIET)$(CP) -R $(MANHTMLDIR) $(REGISTRYOUTDIR)/man/html
.PHONY: release

Expand Down
30 changes: 25 additions & 5 deletions specification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ SPDX-License-Identifier: CC-BY-4.0

Before building the specification, install the necessary prerequisite tools as described later in this document.

You may instead choose to use the `open-in-docker.sh` script,
which will mount the repository in a container built from an image with all the necessary tools installed.
See that script for more details.
You can find the associated Dockerfile at https://github.com/KhronosGroup/DockerContainers/blob/master/Dockerfile.openxr
You may instead choose to use the `open-in-docker.sh` script, available in the
OpenXR-Docs (spec source) and OpenXR-SDK-Source (SDK, for loader docs build)
repo as well as the internal monorepo. This script which will mount the
repository in a container built from an image with all the necessary tools
installed: these are regularly pushed to Docker Hub. See that script for more
details. You can find the associated Dockerfile at
<https://github.com/KhronosGroup/DockerContainers/blob/main/openxr.Dockerfile>

## Conditional Inclusion of Extensions

Expand Down Expand Up @@ -91,6 +94,10 @@ specified by the Makefile variable `$(OUTDIR)` (by default,
It is recommended to build these targets using a "helper" script from above,
unless you want to only build the core spec without any extensions.

Most of these are not supported if building in `OpenXR-SDK-Source`: this
repository is mostly software, and the only contained AsciiDoc content is the
loader design document source.

These targets are currently supported.

* API spec:
Expand Down Expand Up @@ -119,6 +126,10 @@ For example:
make styleguide
```

Many of these are not supported if building in `OpenXR-SDK-Source`: this
repository is mostly software, and the only contained AsciiDoc content is the
loader design document source.

* "OpenXR Documentation and Extensions" guide (aka Style Guide):
* `styleguide` - Single-file HTML5 in `$(OUTDIR)/styleguide.html`
* OpenXR Extensions Process guide:
Expand Down Expand Up @@ -219,7 +230,8 @@ parts you don't use) completely before trying to install.
> Asciidoctor-pdf versions before `1.5.0.alpha15` have issues with multi-page
valid usage blocks, in that the background only renders for the first page.
`alpha.15` fixes this issue (as well as a few others); do not use prior
versions.
versions. On the other hand, versions later than 1.6.2 break our index
customization script, so 1.6.2 is ideal.

Only the `asciidoctor` and `rouge` gems (and their dependencies) are needed if
you do not intend to build PDF versions of the spec and supporting documents.
Expand All @@ -230,6 +242,14 @@ people submitting MRs with substantial changes to the Specification are
responsible for verifying that their branches build *both* `html` and `pdf`
targets.

The easiest way to get the right version of these gems is to use "bundler":

```sh
bundle install
```

Then, pass `BUNDLER=1` to each `make` (or wrapper script) invocation.

### Platforms and System Packages

#### Windows
Expand Down
74 changes: 72 additions & 2 deletions specification/registry/xr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ maintained in the default branch of the Khronos OpenXR GitHub project.
<tag name="OPPO" author="OPPO" contact="Buyi Xu @fantastxu, Haomiao Jiang @hjiang36"/>
<tag name="PLUTO" author="Pluto VR" contact="Jared Cheshier @Jared, Sophia Baldonado @sophia"/>
<tag name="QCOM" author="Qualcomm Technologies" contact="Armelle @alaine_qcom, Martin Renschler @martinr"/>
<tag name="RZR" author="Razer" contact="Alexandre Hulsken @ahulsken, Eric Vezzoli @EricVezzoli"/>
<tag name="STARBREEZE" author="Starbreeze" contact="David Srour @dsrour"/>
<tag name="TOBII" author="Tobii" contact="Denny Rönngren @denron"/>
<tag name="ULTRALEAP" author="Ultraleap" contact="Robert Blenkinsopp @rblenkinsopp"/>
Expand Down Expand Up @@ -133,7 +134,16 @@ maintained in the default branch of the Khronos OpenXR GitHub project.
updates them automatically by processing a line at a time.
-->
<type category="define">// OpenXR current version number.
#define <name>XR_CURRENT_API_VERSION</name> <type>XR_MAKE_VERSION</type>(1, 1, 36)</type>
#define <name>XR_CURRENT_API_VERSION</name> <type>XR_MAKE_VERSION</type>(1, 1, 37)</type>

<!--
Defines for a fixed major.minor version of OpenXR preserving the shared patch version.
-->
<type category="define">// OpenXR 1.0 version number
#define <name>XR_API_VERSION_1_0</name> <type>XR_MAKE_VERSION</type>(1, 0, XR_VERSION_PATCH(XR_CURRENT_API_VERSION))</type>

<type category="define">// OpenXR 1.1 version number
#define <name>XR_API_VERSION_1_1</name> <type>XR_MAKE_VERSION</type>(1, 1, XR_VERSION_PATCH(XR_CURRENT_API_VERSION))</type>

<!--
NOTE: For avoidance of ambiguity, there should only be 1 <name> tag immediately in
Expand Down Expand Up @@ -7658,6 +7668,7 @@ typedef XrResult (XRAPI_PTR *<name>PFN_xrCreateApiLayerInstance</name>)(
</require>
<require comment="API version">
<type name="XR_CURRENT_API_VERSION"/>
<type name="XR_API_VERSION_1_0"/>
<type name="XR_VERSION_MAJOR"/>
<type name="XR_VERSION_MINOR"/>
<type name="XR_VERSION_PATCH"/>
Expand Down Expand Up @@ -7844,6 +7855,10 @@ typedef XrResult (XRAPI_PTR *<name>PFN_xrCreateApiLayerInstance</name>)(


<feature api="openxr" name="XR_VERSION_1_1" number="1.1">
<require comment="API version">
<type name="XR_API_VERSION_1_1"/>
</require>

<require comment="Promoted from XR_KHR_maintenance1">

<!-- new structs -->
Expand Down Expand Up @@ -8627,7 +8642,7 @@ typedef XrResult (XRAPI_PTR *<name>PFN_xrCreateApiLayerInstance</name>)(

<extension name="XR_FB_composition_layer_alpha_blend" number="42" type="instance" supported="openxr">
<require>
<enum value="2" name="XR_FB_composition_layer_alpha_blend_SPEC_VERSION"/>
<enum value="3" name="XR_FB_composition_layer_alpha_blend_SPEC_VERSION"/>
<enum value="&quot;XR_FB_composition_layer_alpha_blend&quot;" name="XR_FB_COMPOSITION_LAYER_ALPHA_BLEND_EXTENSION_NAME"/>
<type name="XrBlendFactorFB"/>
<type name="XrCompositionLayerAlphaBlendFB"/>
Expand Down Expand Up @@ -10612,6 +10627,12 @@ typedef XrResult (XRAPI_PTR *<name>PFN_xrCreateApiLayerInstance</name>)(
<extend interaction_profile_path="/interaction_profiles/oculus/touch_controller">
<component subpath="/input/palm_ext/pose" type="XR_ACTION_TYPE_POSE_INPUT"/>
</extend>
<extend interaction_profile_path="/interaction_profiles/facebook/touch_controller_pro">
<component subpath="/input/palm_ext/pose" type="XR_ACTION_TYPE_POSE_INPUT"/>
</extend>
<extend interaction_profile_path="/interaction_profiles/meta/touch_controller_plus">
<component subpath="/input/palm_ext/pose" type="XR_ACTION_TYPE_POSE_INPUT"/>
</extend>
<extend interaction_profile_path="/interaction_profiles/valve/index_controller">
<component subpath="/input/palm_ext/pose" type="XR_ACTION_TYPE_POSE_INPUT"/>
</extend>
Expand Down Expand Up @@ -15214,6 +15235,55 @@ typedef XrResult (XRAPI_PTR *<name>PFN_xrCreateApiLayerInstance</name>)(
</require>
</extension>

<extension name="XR_EXT_spatial_anchor" number="739" type="instance" supported="disabled">
<require>
<enum value="1" name="XR_EXT_spatial_anchor_SPEC_VERSION"/>
<enum value="&quot;XR_EXT_spatial_anchor&quot;" name="XR_EXT_SPATIAL_ANCHOR_EXTENSION_NAME"/>
</require>
</extension>

<extension name="XR_EXT_spatial_anchor_persistence" number="740" type="instance" supported="disabled">
<require>
<enum value="1" name="XR_EXT_spatial_anchor_persistence_SPEC_VERSION"/>
<enum value="&quot;XR_EXT_spatial_anchor_persistence&quot;" name="XR_EXT_SPATIAL_ANCHOR_PERSISTENCE_EXTENSION_NAME"/>
</require>
</extension>

<extension name="XR_EXT_spatial_entity" number="741" type="instance" supported="disabled">
<require>
<enum value="1" name="XR_EXT_spatial_entity_SPEC_VERSION"/>
<enum value="&quot;XR_EXT_spatial_entity&quot;" name="XR_EXT_SPATIAL_ENTITY_EXTENSION_NAME"/>
</require>
</extension>

<extension name="XR_EXT_spatial_entity_discovery" number="742" type="instance" supported="disabled">
<require>
<enum value="1" name="XR_EXT_spatial_entity_discovery_SPEC_VERSION"/>
<enum value="&quot;XR_EXT_spatial_entity_discovery&quot;" name="XR_EXT_SPATIAL_ENTITY_DISCOVERY_EXTENSION_NAME"/>
</require>
</extension>

<extension name="XR_EXT_extension_743" number="743" type="instance" supported="disabled">
<require>
<enum value="1" name="XR_EXT_extension_743_SPEC_VERSION"/>
<enum value="&quot;XR_EXT_extension_743&quot;" name="XR_EXT_EXTENSION_743_EXTENSION_NAME"/>
</require>
</extension>

<extension name="XR_EXT_extension_744" number="744" type="instance" supported="disabled">
<require>
<enum value="1" name="XR_EXT_extension_744_SPEC_VERSION"/>
<enum value="&quot;XR_EXT_extension_744&quot;" name="XR_EXT_EXTENSION_744_EXTENSION_NAME"/>
</require>
</extension>

<extension name="XR_EXT_extension_745" number="745" type="instance" supported="disabled">
<require>
<enum value="1" name="XR_EXT_extension_745_SPEC_VERSION"/>
<enum value="&quot;XR_EXT_extension_745&quot;" name="XR_EXT_EXTENSION_745_EXTENSION_NAME"/>
</require>
</extension>

</extensions>

</registry>
10 changes: 3 additions & 7 deletions specification/scripts/extensionmetadocgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def specLink(self, xrefName, xrefText, isRefpage = False):

def conditionalLinkCoreAPI(self, apiVersion, linkSuffix, isRefpage):
versionMatch = re.match(f"{self.conventions.api_version_prefix}(\\d+)_(\\d+)", apiVersion)
assert versionMatch
major = versionMatch.group(1)
minor = versionMatch.group(2)

Expand Down Expand Up @@ -295,9 +296,7 @@ def makeMetafile(self, extensions, SPV_deps, isRefpage = False):
separator = ''
else:
separator = '+'
write(separator + '\n--\n' +
dependencyMarkup(self.depends) +
'--', file=fp)
write(f"{separator}\n--\n{dependencyMarkup(self.depends)}--", file=fp)
else:
# Do not specify the base API redundantly, but put something
# here to avoid formatting trouble.
Expand Down Expand Up @@ -328,10 +327,7 @@ def versionKey(name):

names = sorted(sorted(interacts), key=versionKey)
for name in names:
if "_VERSION_" in name:
write(f"* Interacts with {self.conventions.formatVersion(name)}", file=fp)
else:
write(f"* Interacts with {self.conventions.formatExtension(name)}", file=fp)
write(f"* Interacts with {self.conventions.formatVersionOrExtension(name)}", file=fp)

if self.name in SPV_deps:
self.writeTag('SPIR-V Dependencies', None, isRefpage, fp)
Expand Down
8 changes: 4 additions & 4 deletions specification/scripts/parse_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def push_first(toks):
exprStack.append(toks[0])

# An identifier (version or extension name)
dependencyIdent = Word(alphanums + '_')
dependencyIdent = Word(f"{alphanums}_")

# Infix expression for depends expressions
dependencyExpr = pp.infixNotation(dependencyIdent,
Expand Down Expand Up @@ -303,7 +303,7 @@ def markupTraverse(expr, level = 0, root = True):
- root - True only on initial call"""

if level > 0:
prefix = '{nbsp}{nbsp}' * level * 2 + ' '
prefix = f"{'{nbsp}{nbsp}' * level * 2} "
else:
prefix = ''
str = ''
Expand All @@ -318,9 +318,9 @@ def markupTraverse(expr, level = 0, root = True):

str = str + markupTraverse(elem, level = nextlevel, root = False)
elif elem in ('+', ','):
str = str + f'{prefix}{opMarkupAsciidoc(elem)} +\n'
str = f"{str}{prefix}{opMarkupAsciidoc(elem)} +\n"
else:
str = str + f'{prefix}{leafMarkupAsciidoc(elem)} +\n'
str = f"{str}{prefix}{leafMarkupAsciidoc(elem)} +\n"

return str

Expand Down
4 changes: 2 additions & 2 deletions specification/scripts/reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ def parseTree(self):
stage_flag = enum.get('alias')
featureName = elem.get('depends') if elem.get('depends') is not None else featureInfo.name
if stage_flag in sync_pipeline_stage_condition:
sync_pipeline_stage_condition[stage_flag] += "," + featureName
sync_pipeline_stage_condition[stage_flag] += f",{featureName}"
else:
sync_pipeline_stage_condition[stage_flag] = featureName
elif groupName == "VkAccessFlagBits2":
Expand All @@ -780,7 +780,7 @@ def parseTree(self):
access_flag = enum.get('alias')
featureName = elem.get('depends') if elem.get('depends') is not None else featureInfo.name
if access_flag in sync_access_condition:
sync_access_condition[access_flag] += "," + featureName
sync_access_condition[access_flag] += f",{featureName}"
else:
sync_access_condition[access_flag] = featureName

Expand Down
5 changes: 1 addition & 4 deletions specification/scripts/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@
print('Replacing version lines in the registry')
for line in fileinput.input('registry/xr.xml', inplace=True):
printed = False
if 'XR_CURRENT_API_VERSION' in line:
if '<name>XR_CURRENT_API_VERSION</name>' in line:
if 'XR_MAKE_VERSION' in line:
printed = True
print('#define <name>XR_CURRENT_API_VERSION</name> <type>XR_MAKE_VERSION</type>(%s, %s, %s)</type>' % spec_version)
if 'type name' in line:
printed = True
print(' <type name="XR_CURRENT_API_VERSION"/>')
if not printed:
print(f"{line}", end='')

Expand Down
2 changes: 1 addition & 1 deletion specification/scripts/xml_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def check_enum_naming(self, enum_type):
stripped_enum_type = stripped_enum_type.replace("FlagBits", "")
# This is how we apply the "convert type to enum value name" transform: pretend it's a structure type,
# then replace "XR_TYPE_" with the generic prefix "XR_"
start = self.conventions.generate_structure_type_from_name(stripped_enum_type).replace("XR_TYPE", "XR") + "_"
start = f"{self.conventions.generate_structure_type_from_name(stripped_enum_type).replace('XR_TYPE', 'XR')}_"

value_names = get_enum_value_names(self.db.registry, enum_type)

Expand Down
Loading

0 comments on commit a7c7a6e

Please sign in to comment.