Skip to content

Commit

Permalink
Changes from OpenXR 1.1.43.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 46d1c5e46ca0e9f37d3233f36dbd7a1f8fe8460c
  • Loading branch information
rpavlik committed Nov 27, 2024
1 parent 76d9e3b commit e22d4f1
Show file tree
Hide file tree
Showing 69 changed files with 1,864 additions and 550 deletions.
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Files: src/external/jnipp/*
Copyright: 2016-2020, Mitchell Dowd
2020, Collabora, Ltd.
License: MIT
Comment: Unmodified, vendored copy of commit e6c415837c5a487809fdbb2f71f1080d454eb99a
Comment: Unmodified, vendored copy of commit v1.0.0-13-gcdd6293

Files: src/external/metal-cpp/*
Copyright: Copyright 2020-2022 Apple Inc.
Expand Down
7 changes: 7 additions & 0 deletions changes/conformance/mr.3379.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- issue.2162.gl
- issue.2400.gl
- mr.2597.gl
- mr.3600.gl
---
- New test: Automated test that attempts to write from a compute shader to swapchain images in formats that support unordered access, via Vulkan. D3D11/12 check flags to see that they *could* do so but do not yet actually attempt it.
1 change: 1 addition & 0 deletions changes/conformance/mr.3401.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improvement: Add ability to quit/fail test for `XR_EXT_eye_gaze_interaction` by closing your eyes or otherwise losing eye tracking for 10 seconds.
1 change: 1 addition & 0 deletions changes/conformance/mr.3555.gl.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Improvement: Add example image for _Anisotropy Barn Lamp_ self-test
5 changes: 5 additions & 0 deletions changes/conformance/mr.3555.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- issue.2390.gl
---
- Fix: Correctly load the `glCompressedTexImage2D` function
- Fix: Upload compressed and mip-mapped textures correctly on OpenGL and OpenGL ES
1 change: 1 addition & 0 deletions changes/conformance/mr.3561.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Improvement: Rename types, fields, and variables to use the term "binding path" when appropriate. In the past these have sometimes been confusingly called "input sources" despite being unrelated to the paths returned from `xrEnumerateBoundSourcesForAction` and passed to `xrGetInputSourceLocalizedName`.
5 changes: 5 additions & 0 deletions changes/conformance/mr.3575.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- mr.3575.gl
- mr.3609.gl
---
Improvement: Code cleanup, documentation, and consistency improvements.
1 change: 1 addition & 0 deletions changes/conformance/mr.3582.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix: Fix printing of some printf-based messages in the CTS.
4 changes: 4 additions & 0 deletions changes/conformance/mr.3589.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- mr.3589.gl
---
Improvement: Update jnipp, used for Android loader builds. New version includes a build fix for some environments, as well as a crash fix.
1 change: 1 addition & 0 deletions changes/conformance/mr.3592.gl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improvement: Add Vulkan debug messages during Vulkan instance creation.
2 changes: 1 addition & 1 deletion specification/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ endif
VERSIONS := XR_VERSION_1_0 XR_VERSION_1_1 XR_LOADER_VERSION_1_0
VERSIONOPTIONS := $(foreach version,$(VERSIONS),-feature $(version))

SPECREVISION = 1.1.42
SPECREVISION = 1.1.43
REVISION_COMPONENTS = $(subst ., ,$(SPECREVISION))
MAJORMINORVER = $(word 1,$(REVISION_COMPONENTS)).$(word 2,$(REVISION_COMPONENTS))

Expand Down
463 changes: 424 additions & 39 deletions specification/registry/xr.xml

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions specification/scripts/spec_tools/macro_checker_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
# or containing our interested area when matched against the text preceding).
# Used to skip checking in some places.
OPEN_LINK = re.compile(
r'.*(?<!`)<<[^>]*$'
r'.*(?<!`)(<<[^>]*|xref:[^\[]*)$'
)

# Matches if a string begins and is followed by a link "close" without a matching open.
Expand All @@ -85,8 +85,9 @@
# - `ifdef:`
# - `endif:`
# - `todo` (followed by something matching \b, like : or (. capitalization ignored)
# - `[#` (anchor for an image)
SKIP_LINE = re.compile(
r'^(ifdef:)|(endif:)|([tT][oO][dD][oO]\b).*'
r'^(ifdef:)|(endif:)|([tT][oO][dD][oO]\b)|(\[#).*'
)

# Matches the whole inside of a refpage tag.
Expand Down
4 changes: 2 additions & 2 deletions src/common/gfxwrapper_opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ void GlInitExtensions() {
#if defined(OS_WINDOWS)
glActiveTexture = (PFNGLACTIVETEXTUREPROC)GetExtension("glActiveTexture");
glTexImage3D = (PFNGLTEXIMAGE3DPROC)GetExtension("glTexImage3D");
glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)GetExtension("glCompressedTexImage2D ");
glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)GetExtension("glCompressedTexImage3D ");
glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)GetExtension("glCompressedTexImage2D");
glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)GetExtension("glCompressedTexImage3D");
glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)GetExtension("glTexSubImage3D");
glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)GetExtension("glCompressedTexSubImage2D");
glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)GetExtension("glCompressedTexSubImage3D");
Expand Down
2 changes: 1 addition & 1 deletion src/conformance/conformance_layer/Action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ XrResult ConformanceHooks::xrGetActionStatePose(XrSession session, const XrActio
const XrResult result = ConformanceHooksBase::xrGetActionStatePose(session, getInfo, data);
if (XR_SUCCEEDED(result)) {
CustomActionState* const actionData = GetCustomActionState(getInfo->action);
NONCONFORMANT_IF(actionData->type != XR_ACTION_TYPE_POSE_INPUT, "Unexpected success with action handle type %s",
NONCONFORMANT_IF(actionData->type != XR_ACTION_TYPE_POSE_INPUT, "Unexpected success with action handle type %d",
(int)actionData->type);
VALIDATE_XRBOOL32(data->isActive);
}
Expand Down
9 changes: 8 additions & 1 deletion src/conformance/conformance_layer/ConformanceHooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
#include "gen_dispatch.h"
#include <cstdint>

#ifdef __GNUC__
#define LAYER_PRINT_ATTRIBUTE(a, b) __attribute__((format(printf, a, b)))
#else
#define LAYER_PRINT_ATTRIBUTE(a, b)
#endif

// Implementation of methods are distributed across multiple files, based on the primary handle type.
// IConformanceHooks provides empty default implementations of all OpenXR functions. Only provide an override
// if custom validation logic needs to be written.
Expand All @@ -29,7 +35,8 @@ struct ConformanceHooks : ConformanceHooksBase
{
using ConformanceHooksBase::ConformanceHooksBase;

void ConformanceFailure(XrDebugUtilsMessageSeverityFlagsEXT severity, const char* functionName, const char* fmtMessage, ...) override;
void LAYER_PRINT_ATTRIBUTE(4, 5)
ConformanceFailure(XrDebugUtilsMessageSeverityFlagsEXT severity, const char* functionName, const char* fmtMessage, ...) override;

//
// Defined in Instance.cpp
Expand Down
5 changes: 3 additions & 2 deletions src/conformance/conformance_layer/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// limitations under the License.

#include <assert.h>
#include <inttypes.h>
#include "ConformanceHooks.h"
#include "CustomHandleState.h"
#include "RuntimeFailure.h"
Expand Down Expand Up @@ -302,7 +303,7 @@ XrResult ConformanceHooks::xrEndSession(XrSession session)
if (XR_SUCCEEDED(result)) {
NONCONFORMANT_IF(!customSessionState->sessionBegun, "Expected XR_ERROR_SESSION_NOT_RUNNING but got %s", to_string(result));
POSSIBLE_NONCONFORMANT_IF(customSessionState->sessionState != XR_SESSION_STATE_STOPPING,
"Expected XR_ERROR_SESSION_NOT_STOPPING when last known session state was %s", to_string(result),
"Expected XR_ERROR_SESSION_NOT_STOPPING when last known session state was %s",
to_string(customSessionState->sessionState));

customSessionState->sessionBegun = false;
Expand Down Expand Up @@ -351,7 +352,7 @@ XrResult ConformanceHooks::xrWaitFrame(XrSession session, const XrFrameWaitInfo*
// to xrWaitFrame must block the caller until the start of the next rendering interval after the frame's target display time
// as determined by the runtime.
NONCONFORMANT_IF(frameState->predictedDisplayTime <= customSessionState->lastPredictedDisplayTime,
"New predicted display time %lld is less or equal to the previous predicted display time %lld",
"New predicted display time %" PRId64 " is less or equal to the previous predicted display time %" PRId64,
frameState->predictedDisplayTime, customSessionState->lastPredictedDisplayTime);

customSessionState->lastPredictedDisplayTime = frameState->predictedDisplayTime;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SPDX-FileCopyrightText: Copyright 2023 Wayfair, LLC.
SPDX-FileCopyrightText: 2023-2024, The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0
79 changes: 39 additions & 40 deletions src/conformance/conformance_test/test_ActionPoses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "utilities/stringification.h"
#include "utilities/throw_helpers.h"
#include "utilities/types_and_constants.h"
#include "utilities/xr_math_operators.h"

#include <openxr/openxr.h>
#include <catch2/catch_test_macros.hpp>
Expand All @@ -37,9 +38,6 @@

using namespace Conformance;

// Useful to track down errors when debugging stateful graphics APIs like OpenGL:
#define CHKGR() GetGlobalData().graphicsPlugin->CheckState(XRC_FILE_AND_LINE)

namespace Conformance
{
using namespace openxr::math_operators;
Expand All @@ -59,8 +57,9 @@ namespace Conformance
"Press menu to complete the validation.";

CompositionHelper compositionHelper("Grip and Aim Pose");

const XrSpace localSpace = compositionHelper.CreateReferenceSpace(XR_REFERENCE_SPACE_TYPE_LOCAL, Pose::Identity);
XrInstance instance = compositionHelper.GetInstance();
XrSession session = compositionHelper.GetSession();
const XrSpace localSpace = compositionHelper.CreateReferenceSpace(XR_REFERENCE_SPACE_TYPE_LOCAL);

// Set up composition projection layer and swapchains (one swapchain per view).
std::vector<XrSwapchain> swapchains;
Expand Down Expand Up @@ -89,19 +88,22 @@ namespace Conformance
std::vector<SpaceCube> pointerCubes;
};

Hand hands[2];
hands[0].subactionPath = StringToPath(compositionHelper.GetInstance(), "/user/hand/left");
hands[1].subactionPath = StringToPath(compositionHelper.GetInstance(), "/user/hand/right");
Hand hands[2] = {};
hands[0].subactionPath = StringToPath(instance, "/user/hand/left");
hands[1].subactionPath = StringToPath(instance, "/user/hand/right");

// Set up the actions.
const std::array<XrPath, 2> subactionPaths{hands[0].subactionPath, hands[1].subactionPath};
const std::array<XrPath, 2> subactionPaths{
hands[0].subactionPath,
hands[1].subactionPath,
};
XrActionSet actionSet;
XrAction completeAction, switchHandsAction, gripPoseAction, aimPoseAction;
{
XrActionSetCreateInfo actionSetInfo{XR_TYPE_ACTION_SET_CREATE_INFO};
strcpy(actionSetInfo.actionSetName, "interaction_test");
strcpy(actionSetInfo.localizedActionSetName, "Interaction Test");
XRC_CHECK_THROW_XRCMD(xrCreateActionSet(compositionHelper.GetInstance(), &actionSetInfo, &actionSet));
XRC_CHECK_THROW_XRCMD(xrCreateActionSet(instance, &actionSetInfo, &actionSet));

XrActionCreateInfo actionInfo{XR_TYPE_ACTION_CREATE_INFO};
actionInfo.actionType = XR_ACTION_TYPE_BOOLEAN_INPUT;
Expand Down Expand Up @@ -132,45 +134,45 @@ namespace Conformance
}

const std::vector<XrActionSuggestedBinding> bindings = {
{completeAction, StringToPath(compositionHelper.GetInstance(), "/user/hand/left/input/menu/click")},
{completeAction, StringToPath(compositionHelper.GetInstance(), "/user/hand/right/input/menu/click")},
{switchHandsAction, StringToPath(compositionHelper.GetInstance(), "/user/hand/left/input/select/click")},
{switchHandsAction, StringToPath(compositionHelper.GetInstance(), "/user/hand/right/input/select/click")},
{gripPoseAction, StringToPath(compositionHelper.GetInstance(), "/user/hand/left/input/grip/pose")},
{gripPoseAction, StringToPath(compositionHelper.GetInstance(), "/user/hand/right/input/grip/pose")},
{aimPoseAction, StringToPath(compositionHelper.GetInstance(), "/user/hand/left/input/aim/pose")},
{aimPoseAction, StringToPath(compositionHelper.GetInstance(), "/user/hand/right/input/aim/pose")},
{completeAction, StringToPath(instance, "/user/hand/left/input/menu/click")},
{completeAction, StringToPath(instance, "/user/hand/right/input/menu/click")},
{switchHandsAction, StringToPath(instance, "/user/hand/left/input/select/click")},
{switchHandsAction, StringToPath(instance, "/user/hand/right/input/select/click")},
{gripPoseAction, StringToPath(instance, "/user/hand/left/input/grip/pose")},
{gripPoseAction, StringToPath(instance, "/user/hand/right/input/grip/pose")},
{aimPoseAction, StringToPath(instance, "/user/hand/left/input/aim/pose")},
{aimPoseAction, StringToPath(instance, "/user/hand/right/input/aim/pose")},
};

XrInteractionProfileSuggestedBinding suggestedBindings{XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING};
suggestedBindings.interactionProfile = StringToPath(compositionHelper.GetInstance(), "/interaction_profiles/khr/simple_controller");
suggestedBindings.interactionProfile = StringToPath(instance, "/interaction_profiles/khr/simple_controller");
suggestedBindings.suggestedBindings = bindings.data();
suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size();
XRC_CHECK_THROW_XRCMD(xrSuggestInteractionProfileBindings(compositionHelper.GetInstance(), &suggestedBindings));
XRC_CHECK_THROW_XRCMD(xrSuggestInteractionProfileBindings(instance, &suggestedBindings));

XrSessionActionSetsAttachInfo attachInfo{XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO};
attachInfo.actionSets = &actionSet;
attachInfo.countActionSets = 1;
XRC_CHECK_THROW_XRCMD(xrAttachSessionActionSets(compositionHelper.GetSession(), &attachInfo));
XRC_CHECK_THROW_XRCMD(xrAttachSessionActionSets(session, &attachInfo));

compositionHelper.BeginSession();

// Create the instructional quad layer placed to the left bottom.
XrCompositionLayerQuad* const instructionsQuad =
compositionHelper.CreateQuadLayer(compositionHelper.CreateStaticSwapchainImage(CreateTextImage(1024, 512, instructions, 48)),
localSpace, 1.0f, {{0, 0, 0, 1}, {-1.5f, -0.33f, -0.3f}});
localSpace, 1.0f, {Quat::Identity, {-1.5f, -0.33f, -0.3f}});
instructionsQuad->pose.orientation = Quat::FromAxisAngle(Up, DegToRad(70));

// Create the diagram quad layer placed to the left top.
XrCompositionLayerQuad* const diagramQuad =
compositionHelper.CreateQuadLayer(compositionHelper.CreateStaticSwapchainImage(RGBAImage::Load(diagramImage)), localSpace, 1.0f,
{{0, 0, 0, 1}, {-1.5f, 0.33f, -0.3f}});
{Quat::Identity, {-1.5f, 0.33f, -0.3f}});
diagramQuad->pose.orientation = Quat::FromAxisAngle(Up, DegToRad(70));

// Create a sample image quad layer placed to the right.
XrCompositionLayerQuad* const exampleQuad =
compositionHelper.CreateQuadLayer(compositionHelper.CreateStaticSwapchainImage(RGBAImage::Load(exampleImage)), localSpace,
1.25f, {{0, 0, 0, 1}, {1.5f, 0, -0.3f}});
1.25f, {Quat::Identity, {1.5f, 0, -0.3f}});
exampleQuad->pose.orientation = Quat::FromAxisAngle(Up, DegToRad(-70));

const float PointerLength = 4.00f;
Expand All @@ -195,8 +197,8 @@ namespace Conformance
XrActionSpaceCreateInfo spaceCreateInfo{XR_TYPE_ACTION_SPACE_CREATE_INFO};
spaceCreateInfo.subactionPath = hand.subactionPath;
spaceCreateInfo.action = poseAction;
spaceCreateInfo.poseInActionSpace = {{0, 0, 0, 1}, poseInSpacePos};
XRC_CHECK_THROW_XRCMD(xrCreateActionSpace(compositionHelper.GetSession(), &spaceCreateInfo, &spaceCube.space));
spaceCreateInfo.poseInActionSpace = {Quat::Identity, poseInSpacePos};
XRC_CHECK_THROW_XRCMD(xrCreateActionSpace(session, &spaceCreateInfo, &spaceCube.space));
spaceCubes.push_back(std::move(spaceCube));
};

Expand Down Expand Up @@ -227,15 +229,14 @@ namespace Conformance
XrActionsSyncInfo syncInfo{XR_TYPE_ACTIONS_SYNC_INFO};
syncInfo.activeActionSets = activeActionSets.data();
syncInfo.countActiveActionSets = (uint32_t)activeActionSets.size();
XRC_CHECK_THROW_XRCMD(xrSyncActions(compositionHelper.GetSession(), &syncInfo));
XRC_CHECK_THROW_XRCMD(xrSyncActions(session, &syncInfo));

// Check if user has requested to complete the test.
{
XrActionStateGetInfo completeActionGetInfo{XR_TYPE_ACTION_STATE_GET_INFO};
completeActionGetInfo.action = completeAction;
XrActionStateBoolean completeActionState{XR_TYPE_ACTION_STATE_BOOLEAN};
XRC_CHECK_THROW_XRCMD(
xrGetActionStateBoolean(compositionHelper.GetSession(), &completeActionGetInfo, &completeActionState));
XRC_CHECK_THROW_XRCMD(xrGetActionStateBoolean(session, &completeActionGetInfo, &completeActionState));
if (completeActionState.currentState == XR_TRUE && completeActionState.changedSinceLastSync) {
return false;
}
Expand All @@ -259,7 +260,7 @@ namespace Conformance
swapActionGetInfo.action = switchHandsAction;
swapActionGetInfo.subactionPath = hand.subactionPath;
XrActionStateBoolean swapActionState{XR_TYPE_ACTION_STATE_BOOLEAN};
XRC_CHECK_THROW_XRCMD(xrGetActionStateBoolean(compositionHelper.GetSession(), &swapActionGetInfo, &swapActionState));
XRC_CHECK_THROW_XRCMD(xrGetActionStateBoolean(session, &swapActionGetInfo, &swapActionState));
if (swapActionState.currentState == XR_TRUE && swapActionState.changedSinceLastSync) {
pointerHand = hand.subactionPath;
}
Expand All @@ -282,15 +283,13 @@ namespace Conformance

// Render into each of the separate swapchains using the projection layer view fov and pose.
for (size_t view = 0; view < views.size(); view++) {
compositionHelper.AcquireWaitReleaseImage(swapchains[view], //
[&](const XrSwapchainImageBaseHeader* swapchainImage) {
GetGlobalData().graphicsPlugin->ClearImageSlice(swapchainImage);
const_cast<XrFovf&>(projLayer->views[view].fov) = views[view].fov;
const_cast<XrPosef&>(projLayer->views[view].pose) = views[view].pose;
GetGlobalData().graphicsPlugin->RenderView(
projLayer->views[view], swapchainImage,
RenderParams().Draw(renderedCubes));
});
compositionHelper.AcquireWaitReleaseImage(swapchains[view], [&](const XrSwapchainImageBaseHeader* swapchainImage) {
GetGlobalData().graphicsPlugin->ClearImageSlice(swapchainImage);
const_cast<XrFovf&>(projLayer->views[view].fov) = views[view].fov;
const_cast<XrPosef&>(projLayer->views[view].pose) = views[view].pose;
GetGlobalData().graphicsPlugin->RenderView(projLayer->views[view], swapchainImage,
RenderParams().Draw(renderedCubes));
});
}

layers.push_back({reinterpret_cast<XrCompositionLayerBaseHeader*>(projLayer)});
Expand All @@ -306,6 +305,6 @@ namespace Conformance
return true;
};

RenderLoop(compositionHelper.GetSession(), update).Loop();
RenderLoop(session, update).Loop();
}
} // namespace Conformance
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace Conformance

XrSession session = compositionHelper.GetSession();

const XrSpace viewSpace = compositionHelper.CreateReferenceSpace(XR_REFERENCE_SPACE_TYPE_VIEW, Pose::Identity);
const XrSpace viewSpace = compositionHelper.CreateReferenceSpace(XR_REFERENCE_SPACE_TYPE_VIEW);

// Enumerate formats
std::vector<int64_t> imageFormatArray;
Expand Down
Loading

0 comments on commit e22d4f1

Please sign in to comment.