Skip to content

Commit

Permalink
Changes from OpenXR 1.0.32.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 0a6bbc30cf10fdec436dfa81abf27747251a0821
  • Loading branch information
rpavlik committed Nov 29, 2023
1 parent 0208d8d commit 8ecba63
Show file tree
Hide file tree
Showing 62 changed files with 2,948 additions and 1,703 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2022-2023, The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0

# Improves the Python editing experience with vscode.
PYTHONPATH=specification/scripts:src/scripts:external/python
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ CMakeFiles
*.tar.gz
*.log
pregen/
sources-jar/
docs-jar/
generated-includes
cmake_install.cmake
cmake_uninstall.cmake
Expand Down Expand Up @@ -60,7 +62,7 @@ local.properties
!.azure-pipelines/nuget/NugetTemplate/build
!.clang-format
!.clang-tidy
!.cmake-format.json
!.cmake-format.py
!.editorconfig
!.git-blame-ignore-revs
!.git-keep
Expand All @@ -73,11 +75,13 @@ local.properties
!.markdownlint.yaml
!.proclamation.json
!.reuse
!/.env

# Output artifact
*.aar
*.pom
clang-format-patches/
/*.jar

# Key stores
*.jks
4 changes: 2 additions & 2 deletions .proclamation.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"#": "This is a config file for proclamation, the changelog combiner: https://gitlab.com/ryanpavlik/proclamation",
"$schema": "https://ryanpavlik.gitlab.io/proclamation/proclamation.schema.json",
"#": "This is a config file for proclamation, the changelog combiner: https://gitlab.com/proclamation/proclamation",
"$schema": "https://proclamation.gitlab.io/proclamation/proclamation.schema.json",
"projects": [
{
"project_name": "OpenXR SDK",
Expand Down
100 changes: 77 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,22 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author:
#

# Note: This is the top-level CMake file for the OpenXR project.
# It should contain only definitions that are applicable to the
# entire project and includes for the sub-directories.

cmake_minimum_required(VERSION 3.0...3.16)
cmake_minimum_required(VERSION 3.16)
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)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake predefined targets")
set_property(
GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake predefined targets"
)
set(LOADER_FOLDER "Loader")
set(HELPER_FOLDER "Helpers")
set(CODEGEN_FOLDER "Generated")
Expand All @@ -39,7 +38,11 @@ set(LOADER_TESTS_FOLDER "Loader Tests")
set(API_LAYERS_FOLDER "Layers")
set(SAMPLES_FOLDER "Samples")

option(BUILD_FORCE_GENERATION "Force re-generation of files even in the presence of pre-generated copies, replacing those copies." OFF)
option(
BUILD_FORCE_GENERATION
"Force re-generation of files even in the presence of pre-generated copies, replacing those copies."
OFF
)

if(BUILD_FORCE_GENERATION AND NOT PYTHON_EXECUTABLE)
message(FATAL_ERROR "BUILD_FORCE_GENERATION requires Python")
Expand All @@ -49,7 +52,11 @@ string(TOUPPER "${CMAKE_GENERATOR_PLATFORM}" CMAKE_GENERATOR_PLATFORM_UPPER)

# Artifact organization
if(WIN32 OR ANDROID)
option(INSTALL_TO_ARCHITECTURE_PREFIXES "Install platform-specific files to architecture-specific directories, for packaging" OFF)
option(
INSTALL_TO_ARCHITECTURE_PREFIXES
"Install platform-specific files to architecture-specific directories, for packaging"
OFF
)
endif()

if(WIN32 AND INSTALL_TO_ARCHITECTURE_PREFIXES)
Expand Down Expand Up @@ -78,16 +85,26 @@ if(WIN32 AND INSTALL_TO_ARCHITECTURE_PREFIXES)
elseif(ANDROID AND INSTALL_TO_ARCHITECTURE_PREFIXES)
# This organizes things like a prefab module
set(PREFAB_INSTALL_DIR prefab)
set(PREFAB_MODULE_INSTALL_DIR ${PREFAB_INSTALL_DIR}/modules/openxr_loader)
set(CMAKE_INSTALL_LIBDIR ${PREFAB_MODULE_INSTALL_DIR}/libs/android.${ANDROID_ABI} CACHE STRING "Where to install libraries")
set(PREFAB_HEADER_MODULE_INSTALL_DIR
"${PREFAB_INSTALL_DIR}/modules/headers"
)
set(PREFAB_LOADER_MODULE_INSTALL_DIR
"${PREFAB_INSTALL_DIR}/modules/openxr_loader"
)
set(CMAKE_INSTALL_LIBDIR
"${PREFAB_LOADER_MODULE_INSTALL_DIR}/libs/android.${ANDROID_ABI}"
CACHE STRING "Where to install libraries"
)
set(CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_LIBDIR})
set(CMAKE_INSTALL_INCLUDEDIR ${PREFAB_MODULE_INSTALL_DIR}/include)
set(CMAKE_INSTALL_INCLUDEDIR ${PREFAB_HEADER_MODULE_INSTALL_DIR}/include)

unset(NDK_MAJOR_VERSION)
if(CMAKE_ANDROID_NDK)
file(STRINGS "${CMAKE_ANDROID_NDK}/source.properties" NDK_PROPERTIES)
foreach(_line ${NDK_PROPERTIES})
if("${_line}" MATCHES "Pkg.Revision = ([0-9]+)[.]([0-9]+)[.]([0-9]+)")
if("${_line}" MATCHES
"Pkg.Revision = ([0-9]+)[.]([0-9]+)[.]([0-9]+)"
)
set(NDK_MAJOR_VERSION ${CMAKE_MATCH_1})
endif()
endforeach()
Expand All @@ -97,41 +114,78 @@ elseif(ANDROID AND INSTALL_TO_ARCHITECTURE_PREFIXES)
if(NDK_MAJOR_VERSION)
message(STATUS "Building using NDK major version ${NDK_MAJOR_VERSION}")
else()
message(FATAL_ERROR "Could not parse the major version from ${CMAKE_ANDROID_NDK}/source.properties")
message(
FATAL_ERROR
"Could not parse the major version from ${CMAKE_ANDROID_NDK}/source.properties"
)
endif()

elseif(NOT ANDROID)
include(GNUInstallDirs)
endif()

# Path separators ( : or ; ) are not handled well in CMake.
# This seems like a reasonable approach.
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
set(CODEGEN_PYTHON_PATH
"${PROJECT_SOURCE_DIR}/specification/scripts;${PROJECT_SOURCE_DIR}/src/scripts;$ENV{PYTHONPATH}"
)
else()
set(CODEGEN_PYTHON_PATH
"${PROJECT_SOURCE_DIR}/specification/scripts:${PROJECT_SOURCE_DIR}/src/scripts:$ENV{PYTHONPATH}"
)
endif()

add_subdirectory(include)
add_subdirectory(src)

# uninstall target
if(NOT TARGET uninstall)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE
@ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
configure_file(
src/cmake/cmake_uninstall.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE
@ONLY
)
add_custom_target(
uninstall
COMMAND
${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)
set_target_properties(uninstall PROPERTIES FOLDER ${HELPER_FOLDER})
endif()

find_program(BASH_COMMAND NAMES bash)
if(BASH_COMMAND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/specification/Makefile")
option(BUILD_SPECIFICATION "Run './makeAllExts all' in the specification directory as part of the build - intended for one-step checking of spec changes" OFF)
option(
BUILD_SPECIFICATION
"Run './makeAllExts all' in the specification directory as part of the build - intended for one-step checking of spec changes"
OFF
)
if(BUILD_SPECIFICATION)
add_custom_target(spec-all ALL
${BASH_COMMAND} ./makeAllExts all
add_custom_target(
spec-all ALL
"${BASH_COMMAND}" ./makeAllExts all
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/specification"
VERBATIM
COMMENT "Running './makeAllExts all' in the specification directory"
USES_TERMINAL)
USES_TERMINAL
)
endif()
endif()

if(ANDROID AND INSTALL_TO_ARCHITECTURE_PREFIXES)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" DESTINATION META-INF COMPONENT License)
install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
DESTINATION META-INF
COMPONENT License
)

else()
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" DESTINATION share/doc/openxr COMPONENT License)
install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
DESTINATION share/doc/openxr
COMPONENT License
)
endif()
4 changes: 2 additions & 2 deletions changes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ If you want to preview the changelog or perform a release, you can run a command
like the following to install it locally:

```sh
pip3 install proclamation
pipx install proclamation
```

See <https://gitlab.com/ryanpavlik/proclamation> for more details on *proclamation*.
See <https://gitlab.com/proclamation/proclamation> for more details on *proclamation*.

## Fragments

Expand Down
1 change: 1 addition & 0 deletions changes/conformance/mr.2501.gl.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- issue.1726.gl
- mr.2758.gl
- mr.3038.gl
---
- Improvement: Add PBR rendering subsystem for loading and rendering of glTF assets.
- New test: Interactive (rendering) test of `XR_MSFT_controller_model` as an initial usage of the glTF/PBR rendering.
5 changes: 5 additions & 0 deletions changes/conformance/mr.2703.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- mr.2703.gl
- mr.3033.gl
---
Improvement: Handle the loader passing `xrInitializeLoaderKHR` calls to enabled API layers if `XR_KHR_loader_init` is enabled, per ratified update to that extension.
1 change: 1 addition & 0 deletions changes/conformance/mr.2886.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improvement: Clean up our CMake build substantially, correcting dependencies and narrowing the scope of includes.
1 change: 1 addition & 0 deletions changes/conformance/mr.2951.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- New test: Try zero XrTime values in hand tracking joints test.
1 change: 1 addition & 0 deletions changes/conformance/mr.2987.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improvement: Build system cleanup.
1 change: 1 addition & 0 deletions changes/conformance/mr.2994.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improvement: Use "matchers" rather than STL algorithms to verify that supported environment blend modes do not include an invalid value.
1 change: 1 addition & 0 deletions changes/conformance/mr.3000.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix: Correct linking to GLX when glvnd is not found on the system.
4 changes: 4 additions & 0 deletions changes/conformance/mr.3008.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- mr.3008.gl
---
- Fix: Warning/build fix
9 changes: 4 additions & 5 deletions external/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
#
# SPDX-License-Identifier: Apache-2.0

set( INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" )
set(INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")

set( GL_HEADERS
${INCLUDE_DIR}/GL/gl_format.h )
set(GL_HEADERS ${INCLUDE_DIR}/GL/gl_format.h)

# These can be dropped by some subsetted source distributions since
# they ought to exist, if required, in your OpenGL SDK package.
Expand All @@ -15,5 +14,5 @@ foreach(FN ${INCLUDE_DIR}/GL/glext.h ${INCLUDE_DIR}/GL/wglext.h)
endif()
endforeach()

source_group( GL FILES ${GL_HEADERS} )
set_property( TARGET include PROPERTY FOLDER external/include )
source_group(GL FILES ${GL_HEADERS})
set_property(TARGET include PROPERTY FOLDER external/include)
5 changes: 1 addition & 4 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017 The Khronos Group Inc.
# Copyright (c) 2017-2023, The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
Expand All @@ -13,8 +13,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author:
#

add_subdirectory(openxr)
Loading

0 comments on commit 8ecba63

Please sign in to comment.