diff --git a/.appveyor.yml b/.appveyor.yml index b17f46f82..6ce4f687a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -version: 1.0.29.{build} +version: 1.0.30.{build} image: Visual Studio 2017 diff --git a/.reuse/dep5 b/.reuse/dep5 index 3df6553ac..c905fc9a8 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -1,7 +1,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: OpenXR Upstream-Contact: Ryan Pavlik -Source: https://khronos.org/registry/OpenXR/ +Source: https://registry.khronos.org/OpenXR/ Files: changes/conformance/* changes/registry/* @@ -54,8 +54,8 @@ Comment: Unmodified, vendored copy of a subset of the tiny-gltf repo v2.8.9 Files: src/external/d3dx12/* Copyright: Copyright (c) Microsoft Corporation. License: MIT -Comment: Unmodified, vendored copy of DirectX-Headers commit da7aedb - of https://github.com/microsoft/DirectX-Headers filtered to just d3dx12 headers +Comment: Unmodified, vendored copy of d3dx12.h from directx-vs-templates commit 86b9c45 + This repo includes ifdefs to improve compatibility with older Windows SDK verions. Files: src/external/mikktspace/* Copyright: 2011 by Morten S. Mikkelsen diff --git a/CHANGELOG.SDK.md b/CHANGELOG.SDK.md index af900f4d8..5fda1938b 100644 --- a/CHANGELOG.SDK.md +++ b/CHANGELOG.SDK.md @@ -19,6 +19,45 @@ along with any public pull requests that have been accepted. In this repository in particular, since it is primarily software, pull requests may be integrated as they are accepted even between periodic updates. +## OpenXR SDK 1.0.30 (2023-09-20) + +This release is primarily a quality improvement release, fixing a range of +issues in the registry and SDK, including fixing a loader bug related to layers, +in addition to a new vendor extension and an updated vendor extension. + +- Registry + - Add missing enum tags for enum-sized array struct members. + ([internal MR 2731](https://gitlab.khronos.org/openxr/openxr/merge_requests/2731)) + - Fix EGL "get proc addr" function pointer typedef. + ([internal MR 2939](https://gitlab.khronos.org/openxr/openxr/merge_requests/2939)) + - New vendor extension: `XR_YVR_controller_interaction` + ([internal MR 2841](https://gitlab.khronos.org/openxr/openxr/merge_requests/2841)) + - `XR_BD_controller_interaction`: Add support for G3 devices + ([internal MR 2872](https://gitlab.khronos.org/openxr/openxr/merge_requests/2872)) + - Fix specification errors highlighted by fixed tooling. + ([internal MR 2923](https://gitlab.khronos.org/openxr/openxr/merge_requests/2923)) +- SDK + - Add installable manual page for `openxr_runtime_list_json`. + ([internal MR 2899](https://gitlab.khronos.org/openxr/openxr/merge_requests/2899)) + - Remove unused diagram exports from loader directory. + ([internal MR 2907](https://gitlab.khronos.org/openxr/openxr/merge_requests/2907)) + - Update URLs in manual pages. + ([internal MR 2935](https://gitlab.khronos.org/openxr/openxr/merge_requests/2935)) + - Validation Layer: Remove conditional `XR_KHR_headless` support as the extension + is not part of OpenXR 1.0. + ([internal MR 2901](https://gitlab.khronos.org/openxr/openxr/merge_requests/2901)) + - build system: Add CTest support for running the loader test. + ([internal MR 2289](https://gitlab.khronos.org/openxr/openxr/merge_requests/2289), + [OpenXR-SDK-Source issue 309](https://github.com/KhronosGroup/OpenXR-SDK-Source/issues/309), + [internal issue 1733](https://gitlab.khronos.org/openxr/openxr/issues/1733)) + - hello_xr: Clean up how we specify the default graphics plugin on Android. + ([internal MR 2917](https://gitlab.khronos.org/openxr/openxr/merge_requests/2917)) + - list_json: Add missing return statement for exit code. + ([internal MR 2936](https://gitlab.khronos.org/openxr/openxr/merge_requests/2936)) + - loader: fix for implicit/explicit api layer loading logic + ([OpenXR-SDK-Source PR 421](https://github.com/KhronosGroup/OpenXR-SDK-Source/pull/421), + [internal issue 2079](https://gitlab.khronos.org/openxr/openxr/issues/2079)) + ## OpenXR SDK 1.0.29 (2023-08-25) This release contains several fixes to the specification registry, improvements diff --git a/CMakeLists.txt b/CMakeLists.txt index 43ab332be..03df11be5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ cmake_minimum_required(VERSION 3.0) project(OPENXR) find_package(PythonInterp 3) +include(CTest) # Enable IDE GUI folders. "Helper targets" that don't have interesting source code should set their FOLDER property to this set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/maintainer-scripts/common.sh b/maintainer-scripts/common.sh index 065300c24..540578be0 100644 --- a/maintainer-scripts/common.sh +++ b/maintainer-scripts/common.sh @@ -187,6 +187,7 @@ getSDKSourceFilenames() { maintainer-scripts/build-and-publish-aar-snapshot.sh \ maintainer-scripts/publish-aar \ specification/.gitignore \ + specification/config/attribs.adoc \ specification/registry/*.xml \ specification/scripts \ specification/loader \ diff --git a/specification/Makefile b/specification/Makefile index fcf693386..c9f16147e 100644 --- a/specification/Makefile +++ b/specification/Makefile @@ -32,7 +32,7 @@ ifneq (,$(strip $(VERY_STRICT))) ASCIIDOC := $(ASCIIDOC) --failure-level WARN endif -SPECREVISION = 1.0.29 +SPECREVISION = 1.0.30 REVISION_COMPONENTS = $(subst ., ,$(SPECREVISION)) MAJORMINORVER = $(word 1,$(REVISION_COMPONENTS)).$(word 2,$(REVISION_COMPONENTS)) @@ -57,7 +57,7 @@ PYAPIMAP := $(GENDIR)/apimap.py RBAPIMAP := $(GENDIR)/apimap.rb METADIR := $(GENDIR)/meta -VK_REF_PAGE_ROOT := https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html +VK_REF_PAGE_ROOT := https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/ MAKE_RELATIVE = $(patsubst $(CURDIR)/%,%,$(1)) @@ -406,7 +406,7 @@ MANSOURCES = $(CORESOURCES) $(VENSOURCES) $(KHRSOURCES) MANGENERATED = $(wildcard $(REFPATH)/*) MANHTML = $(MANSOURCES:$(REFPATH)/%.txt=$(MANHTMLDIR)/%.html) MANDEPS = $(GENINCLUDE) $(GENDEPENDS) -HTML_SPEC_RELATIVE ?= ../../$(SPEC_FILENAME_STEM).html +HTML_SPEC_RELATIVE ?= ../../html/$(SPEC_FILENAME_STEM).html # Asciidoctor options to build refpages # @@ -421,8 +421,7 @@ ADOCREFOPTS = -a stylesheet=khronos.css \ -a refprefix='refpage.' \ -a isrefpage \ -a html_spec_relative='$(HTML_SPEC_RELATIVE)' \ - -a imagesdir=$(CURDIR)/sources \ - -a vkRefPageRoot='$(VK_REF_PAGE_ROOT)' + -a imagesdir=$(CURDIR)/sources # Pure makefile lowercase function, generated by a script. make_lower = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$(1))))))))))))))))))))))))))) diff --git a/specification/config/attribs.adoc b/specification/config/attribs.adoc new file mode 100644 index 000000000..734efcc63 --- /dev/null +++ b/specification/config/attribs.adoc @@ -0,0 +1,101 @@ +// Copyright (c) 2015-2023, The Khronos Group Inc. +// +// SPDX-License-Identifier: CC-BY-4.0 + +// Various special / math symbols, matching LaTeX names. +// The pass:[+ ] notation avoids asciidoctor EOL treatment of the attribute. + +// Special symbols - not used in [eq] spans +:sym1: ✓ +:sym2: † +:reg: ® +:trade: ™ + +// Math operators and logic symbols +:times: × +:cdot: ⋅ +:plus: pass:[+ ] +:geq: ≥ +:leq: ≤ +:neq: ≠ +:leftarrow: ← +:uparrow: ↑ +:rightarrow: → +:downarrow: ↓ +:elem: ∈ +:lnot: ¬ +:land: ∧ +:lor: ∨ +:oplus: ⊕ +:lceil: ⌈ +:rceil: ⌉ +:lfloor: ⌊ +:rfloor: ⌋ +:vert: | +:partial: ∂ +:onehalf: ½ +:onequarter: ¼ +:threequarters: ¾ +:ldots: … +:forall: ∀ +:sqrt: √ +:inf: ∞ +:plusmn: ± + +// Greek letters +:alpha: α +:beta: β +:gamma: γ +:DeltaUpper: Δ +:delta: δ +:epsilon: ε +:eta: η +:theta: θ +:lambda: λ +:pi: π +:rho: ρ +:sigma: σ +:tau: τ +:phi: ϕ + +// Word break opportunity tag for HTML +ifdef::backend-html5[] +:wbro: pass:[] +endif::backend-html5[] +ifndef::backend-html5[] +:wbro: +endif::backend-html5[] + +// Placeholders for synchronization block text +:externsynctitle: Thread Safety +:externsyncprefix: Access to + +// next chain link to avoid broken links in ref pages +// This section is not in a ref page so cross-file-links is not the right attribute to check. +ifdef::doctype-manpage[] +:uri-next-chain: {html_spec_relative}#valid-usage-for-structure-pointer-chains +endif::doctype-manpage[] +ifndef::doctype-manpage[] +:uri-next-chain: #valid-usage-for-structure-pointer-chains +endif::doctype-manpage[] + +// URIs used in the spec: +// If it's in the main spec and extracted to the ref pages, put it here. + +// OpenXR URIs +:uri-openxr-registry-root: https://registry.khronos.org/OpenXR +:uri-openxr-ratified-spec: {uri-openxr-registry-root}/specs/1.0-khr/html/xrspec.html +:uri-github-openxr-docs: https://github.com/KhronosGroup/OpenXR-Docs + +// glTF URIs +:uri-gltf2: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html +:uri-gltf2-basisu: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_basisu + +// Vulkan URIs +:uri-vk-ref-page-root: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html +:uri-vkCreateInstance: {uri-vk-ref-page-root}/vkCreateInstance.html +:uri-VkInstanceCreateInfo: {uri-vk-ref-page-root}/VkInstanceCreateInfo.html +:uri-VkAllocationCallbacks: {uri-vk-ref-page-root}/VkAllocationCallbacks.html +:uri-vkCreateDevice: {uri-vk-ref-page-root}/vkCreateDevice.html +:uri-VkDeviceCreateInfo: {uri-vk-ref-page-root}/VkDeviceCreateInfo.html +:uri-VkAllocationCallbacks: {uri-vk-ref-page-root}/VkAllocationCallbacks.html diff --git a/specification/loader/api_layer.adoc b/specification/loader/api_layer.adoc index 9f1d986dc..07a9fb4cd 100644 --- a/specification/loader/api_layer.adoc +++ b/specification/loader/api_layer.adoc @@ -9,7 +9,7 @@ This section details how the loader interacts with API layers. [[api-layer-call-chains-and-distributed-dispatch]] -=== API Layer Call Chains and Distributed Dispatch === +=== API Layer Call Chains and Distributed Dispatch Remember, an API layer does not need to intercept all commands, instead, it can choose to intercept only a subset. @@ -54,7 +54,7 @@ OpenXR functions to the first entity in the call chain. [[api-layer-discovery]] -=== API Layer Discovery === +=== API Layer Discovery As mentioned in the <> section, API layers can be categorized into two categories: @@ -87,7 +87,7 @@ files to identify the names and attributes of API layers and their extensions. [[desktop-api-layer-discovery]] -==== Desktop API Layer Discovery ==== +==== Desktop API Layer Discovery On Desktop systems (such as Windows and Linux) JSON formatted manifest files are used to store OpenXR component information. @@ -102,7 +102,7 @@ The following sections define the standard locations the OpenXR loader searches when looking for JSON manifest files. [[windows-manifest-registry-usage]] -===== Windows Manifest Registry Usage ===== +===== Windows Manifest Registry Usage On Windows, the OpenXR loader will scan the Windows registry for details on JSON manifest files in the following locations: @@ -239,7 +239,7 @@ being loaded. [[linux-manifest-search-paths]] -===== Linux Manifest Search Paths ===== +===== Linux Manifest Search Paths On Linux, the OpenXR loader will scan for JSON manifest files using the following base folders: @@ -335,7 +335,7 @@ $HOME/.local/share/openxr/1/api_layers/implicit.d [[overriding-the-default-api-layer-paths]] -===== Overriding the Default API Layer Paths ===== +===== Overriding the Default API Layer Paths There may be times that a developer wishes to force the loader to use their own explicit API layers (or specific explicit API layers). @@ -374,7 +374,7 @@ export XR_API_LAYER_PATH=::> with the extension @@ -414,7 +414,7 @@ order for implicit and explicit API layers: 5. `/odm/etc/openxr/__major_ver__/api_layers/explicit.d` [[api-layer-manifest-file-format]] -==== API Layer Manifest File Format ==== +==== API Layer Manifest File Format On Windows, Linux and Android, the loader uses manifest files to discover API layers. @@ -578,7 +578,7 @@ files for each (all of which may point to the same shared library). [[api-layer-manifest-file-version-history]] -===== API Layer Manifest File Version History ===== +===== API Layer Manifest File Version History The current highest supported API layer manifest file format supported is 1.0.0. @@ -604,7 +604,7 @@ The fields of the 1.0.0 file format include: [[loader-api-layer-interface-negotiation]] -=== Loader/API Layer Interface Negotiation === +=== Loader/API Layer Interface Negotiation Now that an API layer has been discovered, an application can choose to load it (or it is loaded by default if it is an implicit API layer). @@ -752,7 +752,7 @@ struct XrNegotiateApiLayerRequest { `xrCreateInstance` time. [[loader-api-layer-negotiation-process]] -==== Loader/API Layer Negotiation Process ==== +==== Loader/API Layer Negotiation Process Once the loader has obtained a valid address to the API layer's fname:xrNegotiateLoaderApiLayerInterface function, the loader will create a @@ -826,14 +826,14 @@ individually. [[api-layer-interface-versions]] -==== API Layer Interface Versions ==== +==== API Layer Interface Versions The current API layer interface is at version 1. The following sections detail the differences between the various versions. [[api-layer-interface-version-1]] -===== API Layer Interface Version 1 ===== +===== API Layer Interface Version 1 * Defined manifest file version 1.0.0. * Introduced the concept of negotiation. @@ -842,7 +842,7 @@ The following sections detail the differences between the various versions. [[api-layer-intercept-requirements]] -=== API Layer Intercept Requirements === +=== API Layer Intercept Requirements * API Layers intercept an OpenXR command by defining a C/C++ function with signature *identical* to the OpenXR API for that command. @@ -873,7 +873,7 @@ The following sections detail the differences between the various versions. [[api-layer-conventions-and-rules]] -=== API Layer Conventions and Rules === +=== API Layer Conventions and Rules An API layer, when inserted into an otherwise compliant OpenXR implementation, must still result in a compliant OpenXR implementation. @@ -909,7 +909,7 @@ Therefore, it must follow some conventions and rules defined below: [[api-layer-create-instance-process]] -=== API Layer Create Instance Process === +=== API Layer Create Instance Process After <> and any directed `xrEnumerateInstanceExtensionProperties` calls, the next time @@ -1017,10 +1017,10 @@ During the `xrCreateInstance` call, the following happens: the application): .. Record the API layer's name, `xrGetInstanceProcAddr` address, and the `xrCreateApiLayerInstance` address. -.. Build a `XrApiLayerNextInfo` structure for the API layer recording the name and - command addresses. -... If this is the first API layer (the one closest to the runtime) we want it - to enter the loader again when we're done. +.. Build a `XrApiLayerNextInfo` structure for the API layer recording the + name and command addresses. +... If this is the first API layer (the one closest to the runtime) we want + it to enter the loader again when we're done. So, the loader sets the following: .... `XrApiLayerNextInfo.nextGetInstanceProcAddr` = `loaderXrTermGetInstanceProcAddr` @@ -1029,10 +1029,10 @@ During the `xrCreateInstance` call, the following happens: .... `XrApiLayerNextInfo.next` = NULL ... Otherwise, the loader sets the information to the previous API layer's information: -.... `XrApiLayerNextInfo.nextGetInstanceProcAddr` = - Previous `XrApiLayerNextInfo.loaderXrTermGetInstanceProcAddr` -.... `XrApiLayerNextInfo.nextCreateLayerInstance` = - Previous `XrApiLayerNextInfo.loaderXrTermCreateLayerInstance` +.... `XrApiLayerNextInfo.nextGetInstanceProcAddr` = Previous + `XrApiLayerNextInfo.loaderXrTermGetInstanceProcAddr` +.... `XrApiLayerNextInfo.nextCreateLayerInstance` = Previous + `XrApiLayerNextInfo.loaderXrTermCreateLayerInstance` .... `XrApiLayerNextInfo.next` = address to previous `XrApiLayerNextInfo` . The loader will then update the `XrApiLayerCreateInfo.nextInfo` to point to the last created `XrApiLayerNextInfo` since this is the first API layer in the @@ -1051,9 +1051,9 @@ During the `xrCreateInstance` call, the following happens: down the call-chain to the next fname:xrCreateApiLayerInstance, using a pointer to its sname:XrApiLayerCreateInfo structure instead of the one that was passed in during its fname:xrCreateApiLayerInstance command. -.. If the call passes, this API layer may choose to setup its own dispatch table to - the next API layer's commands using the returned `XrInstance`, the next - API layer's `xrGetInstanceProcAddr` and the +.. If the call passes, this API layer may choose to setup its own dispatch + table to the next API layer's commands using the returned `XrInstance`, + the next API layer's `xrGetInstanceProcAddr` and the fname:GeneratedXrPopulateDispatchTable utility command provided in the generated `xr_generated_dispatch_table.h` header. . Finally, the API layer should return the result passed in from the next API layer. diff --git a/specification/loader/appendicies.adoc b/specification/loader/appendicies.adoc index 8016a6acc..4abf1f3bf 100644 --- a/specification/loader/appendicies.adoc +++ b/specification/loader/appendicies.adoc @@ -5,7 +5,7 @@ [[Appendicies]] == Appendicies == -=== Table of Debug Environment Variables === +=== Table of Debug Environment Variables The following are all the Debug Environment Variables available for use with the loader. @@ -56,7 +56,7 @@ discovery. |==== -=== Glossary of Terms === +=== Glossary of Terms .Glossary of Terms diff --git a/specification/loader/application.adoc b/specification/loader/application.adoc index 89d7e6356..b7c295236 100644 --- a/specification/loader/application.adoc +++ b/specification/loader/application.adoc @@ -11,11 +11,11 @@ structure which, in turn, is passed into the `XrInstanceCreateInfo` structure. If either the loader or the active runtime do not support the requested version, they may return an error and fail instance creation. -Refer to the <> documentation on -`xrCreateInstance` for more information about this. +Refer to the link:{uri-openxr-ratified-spec}[OpenXR API Specification] +documentation on `xrCreateInstance` for more information about this. [[interfacing-with-openxr-functions]] -=== Interfacing with OpenXR Functions === +=== Interfacing with OpenXR Functions There are two ways an application can choose interface with OpenXR functions through the loader: @@ -28,7 +28,7 @@ extensions supported by the runtime, and any commands exposed by enabled API layers. [[openxr-direct-exports]] -==== OpenXR Direct Exports ==== +==== OpenXR Direct Exports The loader library on Windows and Linux will directly export all core OpenXR commands for the OpenXR version it supports. @@ -112,7 +112,7 @@ chain. [[openxr-indirect-linking]] -==== OpenXR Indirect Linking ==== +==== OpenXR Indirect Linking With loader indirect linking an application dynamically generates its own dispatch table of OpenXR commands. @@ -137,7 +137,7 @@ image::images/app_dispatch_table_call_chain.svg[align="center", title="Call Chai [[openxr-loader-library-name]] -==== OpenXR Loader Library Name ==== +==== OpenXR Loader Library Name The OpenXR loader's dynamic library name is dependent on the user's underlying operating system. @@ -157,7 +157,7 @@ versions of OpenXR. [[application-api-layer-usage]] -=== Application API Layer Usage === +=== Application API Layer Usage Applications desiring OpenXR functionality beyond what the core API offers may use various API layers or extensions. @@ -201,7 +201,7 @@ to ensure that you are using it properly. [[implicit-vs-explicit-api-layers]] -==== Implicit vs Explicit API Layers ==== +==== Implicit vs Explicit API Layers Explicit API layers are API layers which are enabled by an application (e.g. with the `xrCreateInstance` function) or by setting a @@ -260,7 +260,7 @@ explicit is dependent on the operating system, as shown in the table below. [[forcing-api-layer-folders]] -==== Forcing API Layer Folders (Desktop Only) ==== +==== Forcing API Layer Folders (Desktop Only) Desktop developers may also override the way the loader searches for API layers. @@ -272,7 +272,7 @@ Paths>> section under "API Layer Interaction". [[forced-loading-of-api-layers]] -==== Forced Loading of API Layers (Desktop Only) ==== +==== Forced Loading of API Layers (Desktop Only) Desktop developers may want to enable API layers that are not enabled by the given application they are using. @@ -325,7 +325,7 @@ export XR_ENABLE_API_LAYERS=XR_APILAYER_LUNARG_test1:XR_APILAYER_LUNARG_test2 [[overall-api-layer-ordering]] -==== Overall API Layer Ordering ==== +==== Overall API Layer Ordering The overall ordering of all API layers by the loader based on the above looks as follows: @@ -345,7 +345,7 @@ or after the loader calls it. [[application-usage-of-extensions]] -=== Application Usage of Extensions === +=== Application Usage of Extensions Extensions are optional functionality provided by the loader, an API layer, or a runtime. @@ -355,7 +355,8 @@ These extensions can be created by a runtime vendor to expose new runtime and/or XR hardware functionality, or by an API layer writer to expose some internal feature, or by the loader to add additional loader functionality. Information about various extensions can be found in the -<>, and `openxr.h` header file. +link:{uri-openxr-ratified-spec}[OpenXR API Specification], and `openxr.h` +header file. To use extension functionality, the application should: call `xrEnumerateInstanceExtensionProperties` to determine if the extension is @@ -376,9 +377,9 @@ layer) then only extensions from that API layer are enumerated. Duplicate extensions (e.g. an implicit API layer and runtime might report support for the same extension) are eliminated by the loader. -For duplicates, the API layer version is reported and the runtime version -is culled according to the loader ordering - an extension name is removed -from the extension request list after loading the layer. +For duplicates, the API layer version is reported and the runtime version is +culled according to the loader ordering - an extension name is removed from +the extension request list after loading the layer. If an application fails to enable the extension using the "enabledExtensionNames" field in the `XrInstanceCreateInfo` structure passed diff --git a/specification/loader/debug.adoc b/specification/loader/debug.adoc index eb4cfa237..b8356cb0a 100644 --- a/specification/loader/debug.adoc +++ b/specification/loader/debug.adoc @@ -9,7 +9,7 @@ There may be times that a developer wishes to debug the loader. The following sections define useful tips in debugging the OpenXR loader. [[loader-logging]] -=== Loader Logging === +=== Loader Logging The user can define the `XR_LOADER_DEBUG` environment variable which will enable logging. @@ -54,7 +54,7 @@ export XR_LOADER_DEBUG=error ---- ==== -=== Additional Debug Suggestions === +=== Additional Debug Suggestions If you are seeing issues which may be related to the loader's use of either an API layer or a runtime, there is another setting that may assist you in diff --git a/specification/loader/design.adoc b/specification/loader/design.adoc index 434899e92..b7dd1aa3f 100644 --- a/specification/loader/design.adoc +++ b/specification/loader/design.adoc @@ -14,9 +14,9 @@ The overall class diagram looks roughly like the following: image::images/class_diagram.svg[align="center", title="Loader Class Diagram"] [[class-roles]] -=== Class Roles === +=== Class Roles -==== Manifest File Classes ==== +==== Manifest File Classes The Desktop OpenXR loader uses JSON manifest files for information about available <> and @@ -132,7 +132,7 @@ void ApiLayerManifestFile::CreateIfValid( instance of `ApiLayerManifestFile` and add it to this vector. -==== Library Interface Classes ==== +==== Library Interface Classes The OpenXR loader is responsible with interfacing with other libraries to complete its tasks. @@ -257,7 +257,7 @@ static XrResult ApiLayerInterface::LoadApiLayers( layer that is enabled and has completed loading and negotiation. -==== The LoaderInstance Class ==== +==== The LoaderInstance Class The primary OpenXR object is the `XrInstance`, and from that most other data is either queried or created. @@ -313,7 +313,7 @@ sequence called `loaderXrTermCreateInstance` after the last API layer in order to create the runtime instance. -==== Logging Classes ==== +==== Logging Classes .LoaderLogger @@ -498,7 +498,7 @@ Two steps are required before the loader enables this class: * Calling fname:xrCreateDebugUtilsMessengerEXT. [[automatically-generated-code]] -=== Automatically Generated Code === +=== Automatically Generated Code In order to allow the OpenXR loader to be as flexible as possible, we generate a large portion of the code automatically using the xr.xml registry @@ -532,16 +532,16 @@ process: l| xr_loader_generated.cpp |==== -==== xr_generated_dispatch_table.h ==== +==== xr_generated_dispatch_table.h This C-style header contains the definition of the sname:XrGeneratedDispatchTable structure. This structure can be used to store function pointers for any OpenXR commands defined in the xr.xml at the time the loader was built. It includes slots for both core and extension function pointers. -Currently, the provided API Layers use this structure and the loader -uses a structure which has a subset of the function pointers (defined -in `xr_generated_dispatch_table_core.h`). +Currently, the provided API Layers use this structure and the loader uses a +structure which has a subset of the function pointers (defined in +`xr_generated_dispatch_table_core.h`). A partial listing from the generated table follows: @@ -590,14 +590,14 @@ void GeneratedXrPopulateDispatchTable( `xrGetInstanceProcAddr`. -==== xr_generated_dispatch_table.c ==== +==== xr_generated_dispatch_table.c This file is paired with the above `xr_generated_dispatch_table.h` header and only implements the fname:GeneratedXrPopulateDispatchTable function used to populate the elements of a dispatch table. -==== xr_loader_generated.hpp ==== +==== xr_loader_generated.hpp `xr_loader_generated.hpp` contains prototypes for all the manually defined instance command trampoline and terminator functions. @@ -605,13 +605,13 @@ This is done so that they can be referenced in the `xr_loader_generated.cpp` source file which is used for `xrGetInstanceProcAddr` as well as setting up the loader dispatch table. -==== xr_loader_generated.cpp ==== +==== xr_loader_generated.cpp The `xr_loader_generated.cpp` source file contains the implementation of all generated OpenXR trampoline functions. [[manually-implemented-code]] -=== Manually Implemented Code === +=== Manually Implemented Code Some OpenXR command terminator and trampoline functions need to be manually implemented in the loader. @@ -646,7 +646,7 @@ implemented in the loader. |==== [[functional-flow]] -=== Functional Flow === +=== Functional Flow The loader supports a single XrInstance at a time in order to avoid tracking handle values and their relationship to the `LoaderInstance`. @@ -656,7 +656,7 @@ This enables the loader to work with future extensions and handle types without change. [[platform-specific-behavior]] -=== Platform-Specific Behavior === +=== Platform-Specific Behavior The OpenXR loader design is intended to be flexible on supported on a variety of platforms. @@ -667,7 +667,7 @@ OpenXR loader. [[library-handling]] -==== Library Handling ==== +==== Library Handling The loader works with libraries and runtimes which are exposed as either a static or dynamic external library files. @@ -770,8 +770,8 @@ fname:LoaderPlatformLibraryGetProcAddrError function: const char *LoaderPlatformLibraryGetProcAddrError( const std::string &path); ---- - * pname:path must: be a constant string containing the name of the - entry point that was attempted to be queried during the previous + * pname:path must: be a constant string containing the name of the entry + point that was attempted to be queried during the previous fname:LoaderPlatformLibraryGetProcAddr call. The returned C-style character string contains any available @@ -779,7 +779,7 @@ platform-specific error code that may have occurred. [[environment-variable-usage]] -==== Environment Variable Usage ==== +==== Environment Variable Usage Several environment variables are used in the OpenXR loader, especially on the Desktop (Windows/Linux). @@ -843,7 +843,7 @@ appropriate method will be used. Otherwise, it will fall back to the standard fname:PlatformUtilsGetEnv call. [[active-runtime-file-management]] -==== Active Runtime File Management ==== +==== Active Runtime File Management .Querying the Active Runtime File name diff --git a/specification/loader/loader.adoc b/specification/loader/loader.adoc index a9d92c4c1..37c100ce0 100644 --- a/specification/loader/loader.adoc +++ b/specification/loader/loader.adoc @@ -1,5 +1,5 @@ // Copyright (c) 2017-2023, The Khronos Group Inc. -// Copyright notice at https://www.khronos.org/registry/speccopyright.html +// Copyright notice at https://registry.khronos.org/speccopyright.html // // SPDX-License-Identifier: CC-BY-4.0 @@ -19,6 +19,7 @@ All Rights reserved. toc::[] +include::{config}/attribs.adoc[] [[introduction]] = Introduction = @@ -29,8 +30,8 @@ Intended use of this document is as a detailed design document and a tool for learning general OpenXR loader behavior. In the event of any discrepancies between this document and the -https://www.khronos.org/registry/OpenXR[OpenXR specification], that -document is authoritative. +{uri-openxr-registry-root}[OpenXR specification], that document is +authoritative. OpenXR(TM) and the OpenXR logo are trademarks owned by The Khronos Group Inc. diff --git a/specification/loader/overview.adoc b/specification/loader/overview.adoc index a3cfc3d69..7587ed7d9 100644 --- a/specification/loader/overview.adoc +++ b/specification/loader/overview.adoc @@ -31,23 +31,24 @@ different modules, including the loader, API layers, and runtimes. image::images/high_level_loader.svg[align="center", title="High Level View of the OpenXR Loader"] -=== Who Should Read This Document === +=== Who Should Read This Document While this document is primarily targeted at developers of https://www.khronos.org/openxr[OpenXR] runtimes or API layers, and those wishing to contribute to the OpenXR loader; the information contained in it may be useful to anyone wanting a better understanding of OpenXR. -The <> should be used as the primary -means of understanding the OpenXR API and all care has been made to not -conflict with any element of that document. -In any case where this document and the <> differ, behavior as defined by the OpenXR specification -must: be considered the correct standard. +The link:{uri-openxr-ratified-spec}[OpenXR API Specification] should be used +as the primary means of understanding the OpenXR API and all care has been +made to not conflict with any element of that document. +In any case where this document and the +link:{uri-openxr-ratified-spec}[OpenXR API Specification] differ, behavior +as defined by the OpenXR specification must: be considered the correct +standard. [[openxr-loader]] -=== OpenXR Loader === +=== OpenXR Loader The loader is critical to detecting, exposing, and possibly loading any available OpenXR runtime or API layer on the system. @@ -61,10 +62,10 @@ between the loader and: * <> * <> -In addition, this document also covers various <> elements of the OpenXR loader. -==== Goals of the Loader ==== +==== Goals of the Loader The loader was designed with the following goals in mind. @@ -77,7 +78,7 @@ OpenXR application. [[openxr-api-layers]] -=== OpenXR API Layers === +=== OpenXR API Layers API layers are optional components that augment the OpenXR system. They may intercept, evaluate, modify, and insert existing OpenXR commands on @@ -107,7 +108,7 @@ document. [[openxr-runtimes]] -=== OpenXR Runtimes === +=== OpenXR Runtimes OpenXR works with multiple runtimes each supporting one or more devices. Each OpenXR runtime controls a complete VR/AR/MR system. @@ -121,7 +122,7 @@ For more information on how the OpenXR interacts with runtimes, refer to the <> section of this document. [[openxr-objects]] -=== OpenXR Objects === +=== OpenXR Objects OpenXR uses an object model to control the scope of a particular action or operation. @@ -144,7 +145,7 @@ do take an object. [[openxr-call-chains]] -=== OpenXR Call Chains === +=== OpenXR Call Chains When an (optional) API layer is loaded, the loader links together a _call chain_ that includes each function selected by the layer. diff --git a/specification/loader/runtime.adoc b/specification/loader/runtime.adoc index d2c0da885..1e36d362a 100644 --- a/specification/loader/runtime.adoc +++ b/specification/loader/runtime.adoc @@ -2,6 +2,8 @@ // // SPDX-License-Identifier: CC-BY-4.0 +:uri-xdg-basedir: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html + [[runtime-interaction]] == Runtime Interaction == @@ -10,7 +12,7 @@ runtime to properly interact. [[runtime-discovery]] -=== Runtime Discovery === +=== Runtime Discovery OpenXR may have a choice of multiple runtimes on a user's system. The selection of the active runtime is handled external to the loader. @@ -33,8 +35,7 @@ by an external entity (on those platforms that support updating). ===== Linux Active Runtime Location On Linux, the active runtime information is contained inside a -JSON-formatted file located in a standard -https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html[XDG +JSON-formatted file located in a standard {uri-xdg-basedir}[XDG configuration directory] or the system's standard global configuration directory (typically `/etc`), under the relative path: @@ -419,7 +420,7 @@ Each installed runtime should add a `DWORD` value under that key. The `DWORD`'s name is the full path to the runtime's manifest Similarly to how Implicit API layers can control their activation state in -the registry, as described in <>: +the registry, as described in <>: * A value of `0` indicates that the runtime can be discovered by tools that want to enumerate all installed runtimes. @@ -654,7 +655,7 @@ must: provide documentation on how to properly package the necessary files. [[overriding-the-default-runtime-usage]] -==== Overriding the Default Runtime Usage ==== +==== Overriding the Default Runtime Usage There may be times that a developer wishes to ignore the standard runtime discovery process and force the loader to use a specific runtime. @@ -695,7 +696,7 @@ export XR_RUNTIME_JSON=/home/user/.config/openxr/1/steamxr.json [[loader-runtime-interface-negotiation]] -=== Loader/Runtime Interface Negotiation === +=== Loader/Runtime Interface Negotiation The OpenXR symbols exported by a runtime must not clash with the loader's exported OpenXR symbols. @@ -795,7 +796,7 @@ the application is exiting, or some period of inactivity occurs. [[loader-runtime-negotiation-process]] -==== Loader/Runtime Negotiation Process ==== +==== Loader/Runtime Negotiation Process Once the loader has obtained a valid address to the runtime's fname:xrNegotiateLoaderRuntimeInterface function, the loader will create a @@ -855,7 +856,7 @@ fname:xrNegotiateLoaderRuntimeInterface function and each runtime then must: [[runtime-exporting-of-commands]] -==== Runtime Exporting of Commands ==== +==== Runtime Exporting of Commands The fname:xrNegotiateLoaderRuntimeInterface should be directly exported by a runtime so that using "GetProcAddress" on Windows or "dlsym" on Linux, @@ -876,14 +877,14 @@ with `-Bsymbolic`. [[runtime-interface-versions]] -==== Runtime Interface Versions ==== +==== Runtime Interface Versions The current Runtime Interface is at version 1. The following sections detail the differences between the various versions. [[runtime-interface-version-1]] -===== Runtime Interface Version 1 ===== +===== Runtime Interface Version 1 * Defined manifest file version 1.0.0. * Introduced the concept of negotiation. @@ -891,7 +892,7 @@ The following sections detail the differences between the various versions. [[additional-loader-requirements]] -=== Additional Loader Requirements === +=== Additional Loader Requirements * The loader must: not call the runtime for `xrEnumerateApiLayerProperties` * The loader must: not call the runtime for diff --git a/specification/loader/source.adoc b/specification/loader/source.adoc index a6b8cba4b..55b30d8b0 100644 --- a/specification/loader/source.adoc +++ b/specification/loader/source.adoc @@ -13,7 +13,7 @@ releasing of loader changes for all supported platforms. However, the OpenXR loader is an Open Source project that does accept contributions from the OpenXR community. -=== Building Instructions === +=== Building Instructions The latest instructions for building the OpenXR source can always be found in the BUILDING.md file. @@ -22,7 +22,7 @@ build steps in this file in order to reduce unnecessary duplication. [[cmake-usage]] -==== CMake Usage ==== +==== CMake Usage All OpenXR source utilizes the CMake tool to generate platform-specific build files. @@ -77,20 +77,20 @@ generate the header yourself (preferred), or supply equivalent definitions: ==== -=== Contributing to the Loader === +=== Contributing to the Loader Khronos would be pleased if you decided to contribute to the loader source code. [[coding-standard]] -=== Coding Standard === +=== Coding Standard The following sections define what coding standard is in place for the OpenXR loader code. Every attempt must: be made to follow these rules when adding new code. -==== General Format of Code ==== +==== General Format of Code The loader code is formatted using clang-format with the following settings: @@ -103,7 +103,7 @@ Clang-format is required: to be executed prior to committing new code whenever possible. -==== Language Selection ==== +==== Language Selection Internally, the loader is implemented using the pass:[C++] language, taking advantage of pass:[C++]11 standard features. @@ -223,13 +223,13 @@ static void checkAllFilesInThePath(const std::string &search_path) { ==== -==== API Naming ==== +==== API Naming Identifiers in the OpenXR API (e.g. types, parameters, constants, etc.) all follow a set of naming rules, providing a consistent scheme for developers. -===== General Naming Rules ===== +===== General Naming Rules Names of all identifiers should: generally be written with full words, avoiding abbreviations whenever possible, as a concise description of what @@ -252,7 +252,7 @@ Also, as a general rule, Hungarian notation should: not be avoided whenever possible. -===== Naming of Files and Directories ===== +===== Naming of Files and Directories All files and files must: be named with lower-snake-case names. Additionally, any C-language files must: end with either .c or .h, while any @@ -271,7 +271,7 @@ loader_interfaces.h ==== -===== Naming of #Defines ===== +===== Naming of #Defines All #defines must: be named in all-caps upper-snake-case and must be defined to a specific value. @@ -287,7 +287,7 @@ to a specific value. ==== -===== Variable Naming ===== +===== Variable Naming .Local Variables All local variables and function/method parameters must: use @@ -319,7 +319,7 @@ std::vector<> g_my_global_file_list; ==== -===== Function and Parameter Naming ===== +===== Function and Parameter Naming Functions must: use lower-camel-case for their naming and function parameters must: use lower-snake-case for their naming. @@ -337,7 +337,7 @@ void thisOtherFunction2() { ---- ==== -===== Structure/Enumeration Naming ===== +===== Structure/Enumeration Naming Structures and Enumerations must: be named using upper-camel-case. @@ -370,7 +370,7 @@ enum XrLoaderInterfaceStructs { ---- ==== -===== Class Component Naming ===== +===== Class Component Naming The specific components of a class must be named in the following ways: diff --git a/specification/registry/xr.xml b/specification/registry/xr.xml index add5a2c79..7bbddee4e 100644 --- a/specification/registry/xr.xml +++ b/specification/registry/xr.xml @@ -82,7 +82,6 @@ maintained in the default branch of the Khronos OpenXR GitHub project. - @@ -132,7 +131,7 @@ maintained in the default branch of the Khronos OpenXR GitHub project. updates them automatically by processing a line at a time. --> // OpenXR current version number. -#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 29) +#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 30) - typedef void *(*PFN_xrEglGetProcAddressMNDX)(const char *name); + typedef PFN_xrVoidFunction (*PFN_xrEglGetProcAddressMNDX)(const char *name); XrStructureType type @@ -1491,7 +1490,7 @@ maintained in the default branch of the Khronos OpenXR GitHub project. XrStructureType type const void* next XrSpatialGraphNodeTypeMSFT nodeType - uint8_t nodeId[XR_GUID_SIZE_MSFT] + uint8_t nodeId[XR_GUID_SIZE_MSFT] XrPosef pose @@ -1508,7 +1507,7 @@ maintained in the default branch of the Khronos OpenXR GitHub project. XrStructureType type void* next - uint8_t nodeId[XR_GUID_SIZE_MSFT] + uint8_t nodeId[XR_GUID_SIZE_MSFT] XrPosef poseInNodeSpace @@ -1890,8 +1889,8 @@ maintained in the default branch of the Khronos OpenXR GitHub project. XrStructureType type void* next - char parentNodeName[XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT] - char nodeName[XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT] + char parentNodeName[XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT] + char nodeName[XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT] XrStructureType type @@ -2281,7 +2280,7 @@ maintained in the default branch of the Khronos OpenXR GitHub project. XrStructureType type void* next uint32_t vendorId - char modelName[XR_MAX_RENDER_MODEL_NAME_SIZE_FB] + char modelName[XR_MAX_RENDER_MODEL_NAME_SIZE_FB] XrRenderModelKeyFB modelKey uint32_t modelVersion XrRenderModelFlagsFB flags @@ -2508,7 +2507,7 @@ maintained in the default branch of the Khronos OpenXR GitHub project. uint64_t trackedKeyboardId XrVector3f size XrKeyboardTrackingFlagsFB flags - char name[XR_MAX_KEYBOARD_TRACKING_NAME_SIZE_FB] + char name[XR_MAX_KEYBOARD_TRACKING_NAME_SIZE_FB] XrStructureType type @@ -2631,12 +2630,12 @@ maintained in the default branch of the Khronos OpenXR GitHub project. XrStructureType type const void* next - XrColor4f textureColorMap[XR_PASSTHROUGH_COLOR_MAP_MONO_SIZE_FB] + XrColor4f textureColorMap[XR_PASSTHROUGH_COLOR_MAP_MONO_SIZE_FB] XrStructureType type const void* next - uint8_t textureColorMap[XR_PASSTHROUGH_COLOR_MAP_MONO_SIZE_FB] + uint8_t textureColorMap[XR_PASSTHROUGH_COLOR_MAP_MONO_SIZE_FB] XrStructureType type @@ -5102,7 +5101,7 @@ maintained in the default branch of the Khronos OpenXR GitHub project. XrResult xrSetColorSpaceFB XrSession session - const XrColorSpaceFB colorspace + const XrColorSpaceFB colorSpace @@ -5524,7 +5523,7 @@ maintained in the default branch of the Khronos OpenXR GitHub project. XrResult xrSetMarkerTrackingPredictionVARJO XrSession session uint64_t markerId - XrBool32 enabled + XrBool32 enable @@ -6272,6 +6271,18 @@ maintained in the default branch of the Khronos OpenXR GitHub project. + + + + + + + + + + + + @@ -6316,6 +6327,32 @@ maintained in the default branch of the Khronos OpenXR GitHub project. + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6619,7 +6656,7 @@ maintained in the default branch of the Khronos OpenXR GitHub project. - + @@ -10510,10 +10547,11 @@ maintained in the default branch of the Khronos OpenXR GitHub project. - + + @@ -10530,6 +10568,13 @@ maintained in the default branch of the Khronos OpenXR GitHub project. + + + + + + + @@ -10538,19 +10583,22 @@ maintained in the default branch of the Khronos OpenXR GitHub project. + + + - - - - + + + + @@ -11384,10 +11432,33 @@ maintained in the default branch of the Khronos OpenXR GitHub project. - + - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/specification/scripts/genRef.py b/specification/scripts/genRef.py index 5a72a6aca..041840108 100644 --- a/specification/scripts/genRef.py +++ b/specification/scripts/genRef.py @@ -882,15 +882,14 @@ def genExtension(baseDir, extpath, name, info): fp = open(pageName, 'w', encoding='utf-8') # OpenXR-specific - sections = OrderedDict() - sections['Specification'] = 'See link:{html_spec_relative}#%s[ %s] in the main specification for complete information.' % ( - name, name) + ref_page_sections = OrderedDict() + ref_page_sections['Specification'] = f'See link:{{html_spec_relative}}#{name}[{name}] in the main specification for complete information.' refPageShell(name, "{} extension".format(ext_type), fp, appbody, - sections=sections, + sections=ref_page_sections, tail_content=tail_content) # Restore leveloffset for boilerplate in refPageTail diff --git a/specification/scripts/spec_tools/entity_db.py b/specification/scripts/spec_tools/entity_db.py index 99a7d62eb..e408c0a63 100644 --- a/specification/scripts/spec_tools/entity_db.py +++ b/specification/scripts/spec_tools/entity_db.py @@ -287,7 +287,7 @@ def getMemberNames(self, commandOrStruct): ret = [] for member in members: name_tag = member.find('name') - if name_tag: + if name_tag is not None: ret.append(name_tag.text) return ret diff --git a/specification/scripts/validitygenerator.py b/specification/scripts/validitygenerator.py index b121f705e..5b18c112d 100644 --- a/specification/scripts/validitygenerator.py +++ b/specification/scripts/validitygenerator.py @@ -1086,8 +1086,8 @@ def makeStructureExtensionPointer(self, blockname, param): self.logMsg( 'diag', 'makeStructureExtensionPointer: struct', struct, 'IS NOT required') - entry += '{} must: be {} or a valid pointer to the <>'.format( - self.makeParameterName(param_name), self.null) + link = "link:{uri-next-chain}[next structure in a structure chain]" + entry += f'{self.makeParameterName(param_name)} must: be {self.null} or a valid pointer to the {link}' if not extensionstructs: return entry entry += '. See also: ' diff --git a/specification/scripts/xrconventions.py b/specification/scripts/xrconventions.py index 2d59c0c50..0c6506994 100644 --- a/specification/scripts/xrconventions.py +++ b/specification/scripts/xrconventions.py @@ -205,7 +205,7 @@ def specURL(self, spectype='api'): instead. N.b. this may need to change on a per-refpage basis if there are multiple documents involved. """ - return 'https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html' + return 'https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html' @property def xml_api_name(self): diff --git a/src/api_layers/core_validation.cpp b/src/api_layers/core_validation.cpp index 11116e14f..96da1cd0d 100644 --- a/src/api_layers/core_validation.cpp +++ b/src/api_layers/core_validation.cpp @@ -660,10 +660,6 @@ XRAPI_ATTR XrResult XRAPI_CALL CoreValidationXrCreateSession(XrInstance instance auto const &enabled_extensions = gen_instance_info->enabled_extensions; has_headless |= (enabled_extensions.end() != std::find(enabled_extensions.begin(), enabled_extensions.end(), XR_MND_HEADLESS_EXTENSION_NAME)); -#ifdef XR_KHR_headless - has_headless |= (enabled_extensions.end() != - std::find(enabled_extensions.begin(), enabled_extensions.end(), XR_KHR_HEADLESS_EXTENSION_NAME)); -#endif // XR_KHR_headless bool got_right_graphics_binding_count = (num_graphics_bindings_found == 1); if (!got_right_graphics_binding_count && has_headless) { diff --git a/src/loader/api_layer_interface.cpp b/src/loader/api_layer_interface.cpp index 5560c31a5..c9e24ec40 100644 --- a/src/loader/api_layer_interface.cpp +++ b/src/loader/api_layer_interface.cpp @@ -237,21 +237,23 @@ XrResult ApiLayerInterface::LoadApiLayers(const std::string& openxr_command, uin for (const auto& layer_name : enabled_explicit_api_layer_names) { bool found_this_layer = false; - for (auto it = explicit_layer_manifest_files.begin(); it != explicit_layer_manifest_files.end();) { - bool erased_layer_manifest_file = false; - - if (layers_already_found.count(layer_name) > 0) { - found_this_layer = true; - } else if (layer_name == (*it)->LayerName()) { - found_this_layer = true; - layers_already_found.insert(layer_name); - enabled_layer_manifest_files_in_init_order.push_back(std::move(*it)); - it = explicit_layer_manifest_files.erase(it); - erased_layer_manifest_file = true; - } + if (layers_already_found.count(layer_name) > 0) { + found_this_layer = true; + } else { + for (auto it = explicit_layer_manifest_files.begin(); it != explicit_layer_manifest_files.end();) { + bool erased_layer_manifest_file = false; + + if (layer_name == (*it)->LayerName()) { + found_this_layer = true; + layers_already_found.insert(layer_name); + enabled_layer_manifest_files_in_init_order.push_back(std::move(*it)); + it = explicit_layer_manifest_files.erase(it); + erased_layer_manifest_file = true; + } - if (!erased_layer_manifest_file) { - it++; + if (!erased_layer_manifest_file) { + it++; + } } } diff --git a/src/loader/images/high_level_loader_black.png b/src/loader/images/high_level_loader_black.png deleted file mode 100644 index c4479bb9d..000000000 Binary files a/src/loader/images/high_level_loader_black.png and /dev/null differ diff --git a/src/loader/images/high_level_loader_black.png.license b/src/loader/images/high_level_loader_black.png.license deleted file mode 100644 index c57cf3cad..000000000 --- a/src/loader/images/high_level_loader_black.png.license +++ /dev/null @@ -1,3 +0,0 @@ -Copyright 2017, Lunar-G - -SPDX-License-Identifier: CC-BY-4.0 diff --git a/src/loader/images/instance_call_chain_black.png b/src/loader/images/instance_call_chain_black.png deleted file mode 100644 index 39ff943a4..000000000 Binary files a/src/loader/images/instance_call_chain_black.png and /dev/null differ diff --git a/src/loader/images/instance_call_chain_black.png.license b/src/loader/images/instance_call_chain_black.png.license deleted file mode 100644 index c57cf3cad..000000000 --- a/src/loader/images/instance_call_chain_black.png.license +++ /dev/null @@ -1,3 +0,0 @@ -Copyright 2017, Lunar-G - -SPDX-License-Identifier: CC-BY-4.0 diff --git a/src/loader/images/loader_layer_order_calls_black.png b/src/loader/images/loader_layer_order_calls_black.png deleted file mode 100644 index b577142ef..000000000 Binary files a/src/loader/images/loader_layer_order_calls_black.png and /dev/null differ diff --git a/src/loader/images/loader_layer_order_calls_black.png.license b/src/loader/images/loader_layer_order_calls_black.png.license deleted file mode 100644 index c57cf3cad..000000000 --- a/src/loader/images/loader_layer_order_calls_black.png.license +++ /dev/null @@ -1,3 +0,0 @@ -Copyright 2017, Lunar-G - -SPDX-License-Identifier: CC-BY-4.0 diff --git a/src/tests/c_compile_test/AndroidManifest.xml b/src/tests/c_compile_test/AndroidManifest.xml index 5785d0849..6e7a8a3b9 100644 --- a/src/tests/c_compile_test/AndroidManifest.xml +++ b/src/tests/c_compile_test/AndroidManifest.xml @@ -1,7 +1,6 @@ diff --git a/src/tests/c_compile_test/build.gradle b/src/tests/c_compile_test/build.gradle index 102a7462c..f5a6e9278 100644 --- a/src/tests/c_compile_test/build.gradle +++ b/src/tests/c_compile_test/build.gradle @@ -4,22 +4,11 @@ // Open this directory in Android Studio, or build with Gradle, // to build the "c_compile_test" sample application -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' - } -} -repositories { - google() - mavenCentral() +plugins { + id 'com.android.application' version '7.4.2' } -apply plugin: 'com.android.application' // These next few lines are just to make the version match the OpenXR release. project.ext.repoRoot = file('../../../') @@ -29,6 +18,7 @@ android { compileSdk 29 ndkVersion "21.4.7075529" buildToolsVersion = "30.0.3" + namespace 'org.khronos.openxr.c_compile_test' defaultConfig { applicationId "org.khronos.openxr.c_compile_test" @@ -40,8 +30,7 @@ android { externalNativeBuild { cmake { - arguments '-DANDROID_STL=c++_shared', - '-DBUILD_API_LAYERS=OFF', + arguments '-DBUILD_API_LAYERS=OFF', '-DBUILD_TESTS=ON', '-DBUILD_LOADER=ON', '-DBUILD_CONFORMANCE_TESTS=OFF', diff --git a/src/tests/c_compile_test/settings.gradle b/src/tests/c_compile_test/settings.gradle new file mode 100644 index 000000000..ee7baa552 --- /dev/null +++ b/src/tests/c_compile_test/settings.gradle @@ -0,0 +1,21 @@ +// Copyright (c) 2020-2023, The Khronos Group Inc. +// +// SPDX-License-Identifier: Apache-2.0 + +pluginManagement { + + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} diff --git a/src/tests/hello_xr/AndroidManifest.xml b/src/tests/hello_xr/AndroidManifest.xml index f8fb1155a..af8e5ead5 100644 --- a/src/tests/hello_xr/AndroidManifest.xml +++ b/src/tests/hello_xr/AndroidManifest.xml @@ -1,7 +1,6 @@ diff --git a/src/tests/hello_xr/CMakeLists.txt b/src/tests/hello_xr/CMakeLists.txt index 42782ef79..ec3ca74f5 100644 --- a/src/tests/hello_xr/CMakeLists.txt +++ b/src/tests/hello_xr/CMakeLists.txt @@ -29,6 +29,21 @@ if(ANDROID) ${VULKAN_SHADERS} $) target_link_libraries(hello_xr ${ANDROID_LIBRARY} ${ANDROID_LOG_LIBRARY}) + + # Only for Android because it lacks a command line + set(HELLOXR_DEFAULT_GRAPHICS_PLUGIN "OpenGLES" CACHE STRING "Which graphics plugin should be used by default for Hello XR artifacts?") + # These are the recognized options: provide them as a helper in the CMake GUI + set_property(CACHE HELLOXR_DEFAULT_GRAPHICS_PLUGIN PROPERTY STRINGS "OpenGLES" "Vulkan") + + # Now handle the value, normally provided by Gradle + if(HELLOXR_DEFAULT_GRAPHICS_PLUGIN STREQUAL "OpenGLES") + message(STATUS "hello_xr will default to OpenGL ES graphics plugin") + target_compile_definitions(hello_xr PRIVATE DEFAULT_GRAPHICS_PLUGIN_OPENGLES) + elseif(HELLOXR_DEFAULT_GRAPHICS_PLUGIN STREQUAL "Vulkan") + message(STATUS "hello_xr will default to Vulkan graphics plugin") + target_compile_definitions(hello_xr PRIVATE DEFAULT_GRAPHICS_PLUGIN_VULKAN) + endif() + else() add_executable(hello_xr ${LOCAL_SOURCE} diff --git a/src/tests/hello_xr/build.gradle b/src/tests/hello_xr/build.gradle index 69f2b4d70..a2a77c7a8 100644 --- a/src/tests/hello_xr/build.gradle +++ b/src/tests/hello_xr/build.gradle @@ -4,22 +4,11 @@ // Open this directory in Android Studio, or build with Gradle, // to build the "hello_xr" sample application -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' - } -} -repositories { - google() - mavenCentral() +plugins { + id 'com.android.application' version '7.4.2' } -apply plugin: 'com.android.application' // These next few lines are just to make the version match the OpenXR release. project.ext.repoRoot = file('../../../') @@ -29,6 +18,7 @@ android { compileSdk 29 ndkVersion "21.4.7075529" buildToolsVersion = "30.0.3" + namespace 'org.khronos.openxr.hello_xr' defaultConfig { applicationId "org.khronos.openxr.hello_xr" @@ -40,8 +30,7 @@ android { externalNativeBuild { cmake { - arguments '-DANDROID_STL=c++_shared', - '-DBUILD_API_LAYERS=OFF', + arguments '-DBUILD_API_LAYERS=OFF', '-DBUILD_TESTS=ON', '-DBUILD_LOADER=ON', '-DBUILD_CONFORMANCE_TESTS=OFF', @@ -81,14 +70,14 @@ android { OpenGLES { dimension 'api' applicationIdSuffix '.opengles' - externalNativeBuild.cmake.cppFlags '-DDEFAULT_GRAPHICS_PLUGIN_OPENGLES' + externalNativeBuild.cmake.arguments += '-DHELLOXR_DEFAULT_GRAPHICS_PLUGIN=OpenGLES' resValue "string", "app_name", "Hello XR (OpenGL ES)" } Vulkan { dimension 'api' applicationIdSuffix '.vulkan' - externalNativeBuild.cmake.cppFlags '-DDEFAULT_GRAPHICS_PLUGIN_VULKAN' + externalNativeBuild.cmake.arguments += '-DHELLOXR_DEFAULT_GRAPHICS_PLUGIN=Vulkan' resValue "string", "app_name", "Hello XR (Vulkan)" } diff --git a/src/tests/hello_xr/gradle.properties b/src/tests/hello_xr/gradle.properties index 71d051014..f065318c5 100644 --- a/src/tests/hello_xr/gradle.properties +++ b/src/tests/hello_xr/gradle.properties @@ -4,4 +4,7 @@ org.gradle.jvmargs=-Xmx2048m android.useAndroidX=true -android.enableJetifier=true +android.enableJetifier=false +android.defaults.buildfeatures.buildconfig=false +android.nonFinalResIds=true +android.nonTransitiveRClass=true diff --git a/src/tests/hello_xr/hello_xr.1 b/src/tests/hello_xr/hello_xr.1 index 281ad90ac..bea9ecd88 100644 --- a/src/tests/hello_xr/hello_xr.1 +++ b/src/tests/hello_xr/hello_xr.1 @@ -95,5 +95,5 @@ application itself. .Ex -std .Sh SEE ALSO .Xr openxr_runtime_list 1 , -https://www.khronos.org/registry/OpenXR/ , +https://registry.khronos.org/OpenXR/ , https://github.com/KhronosGroup/OpenXR-SDK-Source/tree/main/src/tests/hello_xr diff --git a/src/tests/hello_xr/settings.gradle b/src/tests/hello_xr/settings.gradle index 6c347217e..ee7baa552 100644 --- a/src/tests/hello_xr/settings.gradle +++ b/src/tests/hello_xr/settings.gradle @@ -2,3 +2,20 @@ // // SPDX-License-Identifier: Apache-2.0 +pluginManagement { + + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} diff --git a/src/tests/list/openxr_runtime_list.1 b/src/tests/list/openxr_runtime_list.1 index 0d1a979bd..3af517ab2 100644 --- a/src/tests/list/openxr_runtime_list.1 +++ b/src/tests/list/openxr_runtime_list.1 @@ -31,5 +31,5 @@ Available instance extensions and their versions. .Ex -std .Sh SEE ALSO .Xr hello_xr 1 , -https://www.khronos.org/registry/OpenXR/ , +https://registry.khronos.org/OpenXR/ , https://github.com/KhronosGroup/OpenXR-SDK-Source/tree/main/src/tests/list diff --git a/src/tests/list_json/AndroidManifest.xml b/src/tests/list_json/AndroidManifest.xml index 3accaeb16..11ecf7d52 100644 --- a/src/tests/list_json/AndroidManifest.xml +++ b/src/tests/list_json/AndroidManifest.xml @@ -1,7 +1,6 @@ diff --git a/src/tests/list_json/CMakeLists.txt b/src/tests/list_json/CMakeLists.txt index a9c45cb4a..48b80d378 100644 --- a/src/tests/list_json/CMakeLists.txt +++ b/src/tests/list_json/CMakeLists.txt @@ -70,4 +70,7 @@ if(NOT ANDROID) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT openxr_runtime_list_json) endif() +if(NOT WIN32) + install(FILES openxr_runtime_list_json.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/ COMPONENT ManPages) +endif() diff --git a/src/tests/list_json/build.gradle b/src/tests/list_json/build.gradle index 049be2a76..a59fd1509 100644 --- a/src/tests/list_json/build.gradle +++ b/src/tests/list_json/build.gradle @@ -4,22 +4,11 @@ // Open this directory in Android Studio, or build with Gradle, // to build the "list_json" sample application -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' - } -} -repositories { - google() - mavenCentral() +plugins { + id 'com.android.application' version '7.4.2' } -apply plugin: 'com.android.application' // These next few lines are just to make the version match the OpenXR release. project.ext.repoRoot = file('../../../') @@ -29,6 +18,7 @@ android { compileSdk 29 ndkVersion "21.4.7075529" buildToolsVersion = "30.0.3" + namespace 'org.khronos.openxr.list_json' defaultConfig { applicationId "org.khronos.openxr.list_json" @@ -40,8 +30,7 @@ android { externalNativeBuild { cmake { - arguments '-DANDROID_STL=c++_shared', - '-DBUILD_API_LAYERS=OFF', + arguments '-DBUILD_API_LAYERS=OFF', '-DBUILD_TESTS=ON', '-DBUILD_LOADER=ON', '-DBUILD_CONFORMANCE_TESTS=OFF', diff --git a/src/tests/list_json/list_json.cpp b/src/tests/list_json/list_json.cpp index a0718f444..25d7c19c7 100644 --- a/src/tests/list_json/list_json.cpp +++ b/src/tests/list_json/list_json.cpp @@ -327,6 +327,6 @@ void android_main(struct android_app* app) { #else // !defined(XR_USE_PLATFORM_ANDROID) -int main() { main_body(); } +int main() { return main_body(); } #endif // defined(XR_USE_PLATFORM_ANDROID) diff --git a/src/tests/list_json/openxr_runtime_list_json.1 b/src/tests/list_json/openxr_runtime_list_json.1 new file mode 100644 index 000000000..054dda880 --- /dev/null +++ b/src/tests/list_json/openxr_runtime_list_json.1 @@ -0,0 +1,26 @@ +.\" Composed by Ryan Pavlik +.\" Copyright 2023, Collabora, Ltd. +.\" SPDX-License-Identifier: Apache-2.0 +.Dd August 7, 2023 +.Dt OPENXR_RUNTIME_LIST_JSON 1 +.Os +.Sh NAME \" Section Header - required - don't modify +.Nm openxr_runtime_list_json +.Nd A small OpenXR application that reports information about your OpenXR runtime in a JSON format +.Sh SYNOPSIS \" Section Header - required - don't modify +.Nm +.Sh DESCRIPTION \" Section Header - required - don't modify +.Nm +is a small non-interactive application written using the +.Tn OpenXR +API, that outputs data about your runtime to standard output in a JSON format. +.Pp +It accepts no arguments. +The data reported is intended to resemble the file format used by OpenXR-Inventory, so that the output may redirected to a file and then edited to perform updates to that database. +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr openxr_runtime_list 1 , +https://github.com/KhronosGroup/OpenXR-Inventory , +https://registry.khronos.org/OpenXR/ , +https://github.com/KhronosGroup/OpenXR-SDK-Source/tree/main/src/tests/list_json diff --git a/src/tests/list_json/settings.gradle b/src/tests/list_json/settings.gradle new file mode 100644 index 000000000..ee7baa552 --- /dev/null +++ b/src/tests/list_json/settings.gradle @@ -0,0 +1,21 @@ +// Copyright (c) 2020-2023, The Khronos Group Inc. +// +// SPDX-License-Identifier: Apache-2.0 + +pluginManagement { + + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} diff --git a/src/tests/loader_test/CMakeLists.txt b/src/tests/loader_test/CMakeLists.txt index bf18db138..c1d9bddf0 100644 --- a/src/tests/loader_test/CMakeLists.txt +++ b/src/tests/loader_test/CMakeLists.txt @@ -54,6 +54,10 @@ if(WIN32) target_link_libraries(loader_test PRIVATE d3d11) endif() +add_test(NAME loader_test + COMMAND loader_test + WORKING_DIRECTORY "$") + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources/layers) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources/runtimes)