Skip to content

Commit

Permalink
OpenXR loader: add API layer discovery support.
Browse files Browse the repository at this point in the history
Revert "Update local repo to latest."
  • Loading branch information
dengkail committed Aug 14, 2023
1 parent 6f3ccf3 commit 434f398
Show file tree
Hide file tree
Showing 111 changed files with 4,746 additions and 2,538 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

version: 1.0.28.{build}
version: 1.0.27.{build}
image: Visual Studio 2017


Expand Down
5 changes: 1 addition & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
*.sh eol=lf

*.png binary

# git-lfs big files
*.pdf filter=lfs diff=lfs merge=lfs -text
*.glb filter=lfs diff=lfs merge=lfs -text
*.pdf binary

# Shell/python scripts that don't end in .sh
specification/makeAllExts eol=lf
Expand Down
25 changes: 0 additions & 25 deletions .github/scripts/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,6 @@
"CMAKE_SYSTEM_NAME": "WindowsStore",
"CMAKE_SYSTEM_VERSION": "10.0"
}
},
{
"name": ".base-cts-msvc",
"generator": "Visual Studio 17 2022",
"hidden": true,
"installDir": "$env{INSTALL_DIR}",
"cacheVariables": {
"DYNAMIC_LOADER": false,
"BUILD_ALL_EXTENSIONS": true
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "cts-win32",
"inherits": ".base-cts-msvc",
"architecture": "Win32"
},
{
"name": "cts-x64",
"inherits": ".base-cts-msvc",
"architecture": "x64"
}
]
}
15 changes: 1 addition & 14 deletions .github/scripts/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import json
import sys
import os
from dataclasses import dataclass
from itertools import product

Expand All @@ -26,10 +25,6 @@ def should_skip(self) -> bool:
# can switch to just doing x64 for speed of testing
# return self.arch != "x64"

def has_cts_build(self) -> bool:
# No UWP CTS right now
return not self.uwp and not self.should_skip()

def preset(self) -> str:
if self.uwp:
return f"{self.arch.lower()}_uwp"
Expand All @@ -39,9 +34,6 @@ def preset(self) -> str:
def win_artifact_name(self) -> str:
return f"loader_{self.preset()}"

def win_cts_artifact_name(self) -> str:
return f"loader_{self.preset()}"

def platform_dirname(self) -> str:
if self.uwp:
return f"{self.arch}_uwp"
Expand All @@ -54,14 +46,9 @@ def platform_dirname(self) -> str:

BUILD_CONFIGS = [c for c in _UNFILTERED_BUILD_CONFIGS if not c.should_skip()]

CTS_BUILD_CONFIGS = [c for c in _UNFILTERED_BUILD_CONFIGS if c.has_cts_build()]


def output_json(data, variable_name=None):
if variable_name:
envfile = os.getenv("GITHUB_ENV")
assert envfile
with open(envfile, "w", encoding="utf-8") as fp:
fp.write(f"{variable_name}={json.dumps(data)}")
print(f"::set-output name={variable_name}::{json.dumps(data)}")
else:
print(json.dumps(data, indent=4))
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Get modern CMake and Ninja
uses: lukka/get-cmake@v3.26.4
uses: lukka/get-cmake@v3.25.2

- name: set up JDK 11
uses: actions/setup-java@v3
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Get modern CMake and Ninja
uses: lukka/get-cmake@v3.26.4
uses: lukka/get-cmake@v3.25.2
- name: set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/msvc-build-preset.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2023, Collabora, Ltd.
# Copyright 2021-2022, Collabora, Ltd.
# SPDX-License-Identifier: CC0-1.0

on:
Expand All @@ -9,18 +9,13 @@ on:
type: string
required: true
buildType:
description: "Build configuration"
description: "Build type"
type: string
required: true
default: RelWithDebInfo
artifactName:
description: "Artifact name to upload to."
type: string
required: false
subdir:
description: "Subdir of the workspace to upload as an artifact."
type: string
default: install

jobs:
msvc-build:
Expand All @@ -30,33 +25,30 @@ jobs:
INSTALL_DIR: "${{ github.workspace }}/install"
steps:
- uses: actions/checkout@v3

- name: Get modern CMake and Ninja
uses: lukka/[email protected]

- uses: lukka/[email protected]
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Install Vulkan SDK
run: ./.github/scripts/install_vulkan.ps1
if: "${{ !contains( inputs.preset, 'uwp') }}"
working-directory: "${{ github.workspace }}"
if: ${{ !contains( inputs.preset, 'uwp') }}
working-directory: ${{ github.workspace }}
shell: pwsh
run: ./.github/scripts/install_vulkan.ps1

- name: Generate build system
shell: pwsh
run: |
Copy-Item .github/scripts/CMakePresets.json .
cmake --fresh --preset ${{ inputs.preset }} -S . -B $env:RUNNER_TEMP
- name: Build
run: "cmake --build $env:RUNNER_TEMP --parallel --clean-first --config ${{ inputs.buildType }}"
run: cmake --build $env:RUNNER_TEMP --parallel --clean-first --config ${{ inputs.buildType }}

- name: Install
run: "cmake --build $env:RUNNER_TEMP --parallel --config ${{ inputs.buildType }} --target install"
run: cmake --build $env:RUNNER_TEMP --parallel --config ${{ inputs.buildType }} --target install

- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: inputs.artifactName
with:
name: "${{ inputs.artifactName }}"
path: "${{ github.workspace }}/${{ inputs.subdir }}"
name: ${{ inputs.artifactName }}
path: ${{ github.workspace }}/install
53 changes: 21 additions & 32 deletions .github/workflows/windows-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2023, Collabora, Ltd.
# Copyright 2021-2022, Collabora, Ltd.
# SPDX-License-Identifier: CC0-1.0

name: Windows builds
Expand All @@ -12,73 +12,62 @@ on:
workflow_dispatch:

jobs:
# generate_matrix:
# runs-on: ubuntu-latest
# outputs:
# matrix: "${{ steps.set-matrix.outputs.matrix }}"
# steps:
# - uses: "actions/checkout@v3"
# - id: set-matrix
# run: "python3 .github/scripts/generate_windows_matrix_build.py matrix"
generate_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: set-matrix
run: python3 .github/scripts/generate_windows_matrix_build.py matrix
msvc-build:
# needs: generate_matrix
needs: generate_matrix
strategy:
fail-fast: true
# TODO: Fix matrix generation? Broke recently due to changes in github actions
# matrix: "${{fromJson(needs.generate_matrix.outputs.matrix)}}"
matrix:
preset:
- win32
- x64
- win32_uwp
- x64_uwp
- arm64_uwp
- arm_uwp
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}}

uses: "./.github/workflows/msvc-build-preset.yml"
uses: ./.github/workflows/msvc-build-preset.yml
with:
preset: "${{ matrix.preset }}"
preset: ${{ matrix.preset }}
artifactName: "loader_${{ matrix.preset }}"
buildType: "RelWithDebInfo"

organize-and-release-artifacts:
if: inputs.organizeAndRelease
needs:
- msvc-build
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v3"
- uses: actions/checkout@v3

- name: Retrieve artifacts
uses: "actions/download-artifact@v3"
uses: actions/download-artifact@v3
with:
path: artifacts

- name: Organize artifacts
run: 'python .github/scripts/organize_windows_artifacts.py "${{ github.workspace }}" "${{ github.workspace }}/openxr_loader"'
run: python .github/scripts/organize_windows_artifacts.py "${{ github.workspace }}" "${{ github.workspace }}/openxr_loader"

- name: Upload combined artifact
uses: "actions/upload-artifact@v3"
uses: actions/upload-artifact@v3
with:
name: openxr_loader_windows
path: "${{ github.workspace }}/openxr_loader"

# NuGet stuff now

- name: Setup NuGet
uses: "NuGet/setup-nuget@296fd3ccf8528660c91106efefe2364482f86d6f"
uses: NuGet/setup-nuget@v1
with:
nuget-version: "5.x"

- name: Stage loader and headers for NuGet
shell: pwsh
run: '${{ github.workspace }}/.azure-pipelines/nuget/stage_nuget.ps1 "${{ github.workspace }}/openxr_loader" "${{ github.workspace }}/specification/Makefile" "${{ github.workspace }}/openxr_loader_staging"'
run: ${{ github.workspace }}/.azure-pipelines/nuget/stage_nuget.ps1 "${{ github.workspace }}/openxr_loader" "${{ github.workspace }}/specification/Makefile" "${{ github.workspace }}/openxr_loader_staging"

- name: Pack NuGet package
run: 'nuget pack "${{ github.workspace }}/openxr_loader_staging/OpenXR.Loader.nuspec" -OutputDirectory "${{ github.workspace }}/nuget"'
run: nuget pack ${{ github.workspace }}/openxr_loader_staging/OpenXR.Loader.nuspec -OutputDirectory ${{ github.workspace }}/nuget

- name: Upload NuGet artifact
uses: "actions/upload-artifact@v3"
uses: actions/upload-artifact@v3
with:
name: NuGet
path: "${{ github.workspace }}/nuget"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pregen/
generated-includes
cmake_install.cmake
cmake_uninstall.cmake
cmake-build-*

# Marker file for a snapshot build
SNAPSHOT
Expand Down
26 changes: 2 additions & 24 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Upstream-Contact: Ryan Pavlik <openxr-speceditor AT khronos DOT org>
Source: https://khronos.org/registry/OpenXR/

Files: changes/*
HOTFIX
Copyright: 2019-2023, The Khronos Group Inc.
License: CC-BY-4.0

Expand Down Expand Up @@ -39,27 +38,6 @@ Copyright: 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
License: MIT OR LicenseRef-jsoncpp-public-domain
Comment: Unmodified, vendored copy of jsoncpp 1.9.5

Files: src/external/tinygltf/*
Copyright: 2017 Syoyo Fujita, Aurélien Chatelain and many contributors
License: MIT
Comment: Unmodified, vendored copy of a subset of the tiny-gltf repo v2.8.9

Files: src/external/tinygltf/json.hpp
Copyright: 2013-2017 Niels Lohmann <http://nlohmann.me>
License: MIT
Comment: Unmodified, included in tiny-gltf repo.

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

Files: src/external/mikktspace/*
Copyright: 2011 by Morten S. Mikkelsen
License: Zlib
Comment: Unmodified, vendored copy of MikkTSpace commit 3e895b4

Files: src/external/jnipp/*
Copyright: 2016-2020, Mitchell Dowd
2020, Collabora, Ltd.
Expand Down Expand Up @@ -89,7 +67,7 @@ Comment: In-line license comments requested, https://gitlab.khronos.org/openxr/o

Files: specification/sources/chapters/extensions/ext/ext_performance_settings.adoc
specification/sources/chapters/extensions/ext/ext_thermal_query.adoc
Copyright: 2017-2023, The Khronos Group Inc.
Copyright: 2017-2020, The Khronos Group Inc.
License: CC-BY-4.0
Comment: In-line license comments requested, https://gitlab.khronos.org/openxr/openxr/-/issues/1419

Expand All @@ -98,7 +76,7 @@ Files: src/conformance/platform_specific/android_resources/mipmap-hdpi/*
src/conformance/platform_specific/android_resources/mipmap-xhdpi/*
src/conformance/platform_specific/android_resources/mipmap-xxhdpi/*
src/conformance/platform_specific/android_resources/mipmap-xxxhdpi/*
Copyright: 2020-2023, The Khronos Group Inc.
Copyright: 2020, The Khronos Group Inc.
2020, Google
License: Apache-2.0
Comment: Generated .png versions of an icon, created in Android Studio
Expand Down
15 changes: 0 additions & 15 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,6 @@ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ../..
make
```

### macOS

Building the OpenXR components in this tree on macOS is supported using Xcode
14.0 and newer. You may need to install Xcode Command Line Tools and cmake.

First, generate the Xcode project file using CMake:

```cmd
mkdir -p build/macos
cd build/macos
cmake -G "Xcode" ../..
```

Finally, open the build/macos/OPENXR.xcodeproj in Xcode to build the samples.

### Android

```sh
Expand Down
Loading

0 comments on commit 434f398

Please sign in to comment.