Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
BattleAxeVR committed Sep 26, 2024
2 parents db795c1 + 2c9b058 commit bc75a40
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 41 deletions.
9 changes: 5 additions & 4 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@v4
- name: Get modern CMake and Ninja
uses: "lukka/[email protected].1"
uses: "lukka/[email protected].2"

# Do this before building aar since it affects the version
- name: Touch SNAPSHOT marker file
Expand All @@ -36,7 +36,7 @@ jobs:
run: "./maintainer-scripts/build-aar.sh"

- name: Upload bare AAR
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: AAR and POM
path: openxr_loader_for_android*
Expand All @@ -47,12 +47,13 @@ jobs:
steps:
- uses: "actions/checkout@v4"
- name: "Get modern CMake and Ninja"
uses: "lukka/[email protected].1"
uses: "lukka/[email protected].2"
- name: "set up JDK 11"
uses: "actions/setup-java@v4"
with:
java-version: "11"
distribution: "temurin"
# Also performs Gradle wrapper validation
- uses: "gradle/actions/setup-gradle@v4"

# HelloXR OpenGLES version
Expand All @@ -61,7 +62,7 @@ jobs:

- name: Upload HelloXR OpenGLES (debug) for Android
if: "!inputs.release"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: HelloXR OpenGLES Android
path: "src/tests/hello_xr/build/outputs/apk/OpenGLES/debug/*.apk"
2 changes: 1 addition & 1 deletion .github/workflows/check_clang_format_and_codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
if: ${{ failure() }}
- name: Publish diff
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ${{ runner.temp }}/clang-format.patch
name: clang-format-changes
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (c) 2024, The Khronos Group Inc.
# SPDX-License-Identifier: CC0-1.0

name: macOS

on:
push:
branches: [ main ]

pull_request:
branches: [ main ]

permissions:
contents: read

jobs:
macOS-build:
strategy:
matrix:
device: [
macos-14, # Tests Mac arm64
]
runs-on: ${{ matrix.device }}

steps:
- uses: actions/checkout@v4
- name: "Get modern CMake and Ninja"
uses: "lukka/[email protected]"
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.290.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Build
run: |
mkdir -p build/macos
cd build/macos
cmake -G "Xcode" ../..
xcodebuild -list -project OPENXR.xcodeproj/
xcodebuild -scheme ALL_BUILD build
6 changes: 3 additions & 3 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-2024, Collabora, Ltd.
# SPDX-License-Identifier: CC0-1.0

on:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
lfs: true

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

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
Expand All @@ -57,7 +57,7 @@ jobs:
run: "cmake --build $env:RUNNER_TEMP --parallel --config ${{ inputs.buildType }} --target install"

- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: inputs.artifactName
with:
name: "${{ inputs.artifactName }}"
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2022, Collabora, Ltd.
# Copyright 2021-2024, Collabora, Ltd.
# SPDX-License-Identifier: CC0-1.0

name: Build release artifacts
Expand All @@ -8,13 +8,13 @@ on:
workflow_dispatch:

jobs:
android:
uses: ./.github/workflows/android.yml
with:
release: true
# Currently Android artifacts are generated and signed internally before publication to GitHub.
# android:
# uses: ./.github/workflows/android.yml
# with:
# release: true

msvc-build:
uses: ./.github/workflows/windows-matrix.yml
with:
organizeAndRelease: true # TODO

organizeAndRelease: true
6 changes: 3 additions & 3 deletions .github/workflows/windows-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ jobs:
- uses: "actions/checkout@v4"

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

- name: Organize artifacts
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@v4"
with:
name: openxr_loader_windows
path: "${{ github.workspace }}/openxr_loader"
Expand All @@ -78,7 +78,7 @@ jobs:
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@v4"
with:
name: NuGet
path: "${{ github.workspace }}/nuget"
11 changes: 10 additions & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,16 @@ cd build/macos
cmake -G "Xcode" ../..
```

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

If you want to build on the command line, you can run the following command to
check available targets and built `ALL_BUILD` target as example:

```shell
# In build/macos directory
xcodebuild -list -project OPENXR.xcodeproj/
xcodebuild -scheme ALL_BUILD build
```

### Android

Expand Down
1 change: 1 addition & 0 deletions changes/sdk/pr.403.gh.OpenXR-SDK-Source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Addition: hello_xr: Log Vulkan extensions requested by runtime and by app, visible when running with `--verbose`.
1 change: 1 addition & 0 deletions changes/sdk/pr.500.gh.OpenXR-SDK-Source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci: Remove now-redundant gradle-wrapper-validation job from GitHub Actions
2 changes: 2 additions & 0 deletions changes/sdk/pr.501.gh.OpenXR-SDK-Source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- ci: Add GitHub Action for macOS building
- doc: Add command to build OpenXR targets on macOS
19 changes: 19 additions & 0 deletions src/tests/hello_xr/graphicsplugin_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,19 @@ struct VulkanGraphicsPluginLegacy : public VulkanGraphicsPlugin {
virtual XrStructureType GetGraphicsBindingType() const override { return XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR; }
virtual XrStructureType GetSwapchainImageType() const override { return XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR; }

static void LogVulkanExtensions(const std::string title, const std::vector<const char*>& extensions, unsigned int start = 0) {
const std::string indentStr(1, ' ');

Log::Write(Log::Level::Verbose, Fmt("%s: (%d)", title.c_str(), extensions.size() - start));
for (auto ext : extensions) {
if (start) {
start--;
continue;
}
Log::Write(Log::Level::Verbose, Fmt("%s Name=%s", indentStr.c_str(), ext));
}
}

virtual XrResult CreateVulkanInstanceKHR(XrInstance instance, const XrVulkanInstanceCreateInfoKHR* createInfo,
VkInstance* vulkanInstance, VkResult* vulkanResult) override {
PFN_xrGetVulkanInstanceExtensionsKHR pfnGetVulkanInstanceExtensionsKHR = nullptr;
Expand All @@ -2068,11 +2081,14 @@ struct VulkanGraphicsPluginLegacy : public VulkanGraphicsPlugin {
// Note: This cannot outlive the extensionNames above, since it's just a collection of views into that string!
std::vector<const char*> extensions = ParseExtensionString(&extensionNames[0]);
#endif
LogVulkanExtensions("Vulkan Instance Extensions, requested by runtime", extensions);

// Merge the runtime's request with the applications requests
for (uint32_t i = 0; i < createInfo->vulkanCreateInfo->enabledExtensionCount; ++i) {
extensions.push_back(createInfo->vulkanCreateInfo->ppEnabledExtensionNames[i]);
}
LogVulkanExtensions("Vulkan Instance Extensions, requested by application", extensions,
extensions.size() - createInfo->vulkanCreateInfo->enabledExtensionCount);

VkInstanceCreateInfo instInfo{VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO};
memcpy(&instInfo, createInfo->vulkanCreateInfo, sizeof(instInfo));
Expand Down Expand Up @@ -2157,11 +2173,14 @@ struct VulkanGraphicsPluginLegacy : public VulkanGraphicsPlugin {
extensions = ParseExtensionString(&deviceExtensionNames[0]);
}
#endif
LogVulkanExtensions("Vulkan Device Extensions, requested by runtime", extensions);

// Merge the runtime's request with the applications requests
for (uint32_t i = 0; i < createInfo->vulkanCreateInfo->enabledExtensionCount; ++i) {
extensions.push_back(createInfo->vulkanCreateInfo->ppEnabledExtensionNames[i]);
}
LogVulkanExtensions("Vulkan Device Extensions, requested by application", extensions,
extensions.size() - createInfo->vulkanCreateInfo->enabledExtensionCount);

VkPhysicalDeviceFeatures features{};
memcpy(&features, createInfo->vulkanCreateInfo->pEnabledFeatures, sizeof(features));
Expand Down

0 comments on commit bc75a40

Please sign in to comment.