Skip to content

Commit

Permalink
OpenXR CTS 1.0.30.0 (2023-10-12)
Browse files Browse the repository at this point in the history
-   Conformance Tests
    -   Fix: Replace early returns with SKIP(). (internal MR 2898,
        OpenXR-CTS issue 60, internal issue 2072)
    -   Fix: Remove infinite loop in Timed_Pipelined_Frame_Submission in
        error case. (internal MR 2915)
    -   Fix: Test failure count API (internal MR 2940, internal issue
        2072, internal MR 2965, internal MR 2999)
    -   Fix: Fix waiting for xrWaitSwapchainImage timeout cases.
        (internal MR 2944)
    -   Fix: Enable build with clang, clang-cl, and GCC (MinGW64) on
        Windows. (internal MR 2948, internal MR 2975)
    -   Fix: Do not request hand tracking joint poses with an XrTime of
        0: it is invalid. Be sure to be in “FOCUSED” since we want input
        data. (internal MR 2977)
    -   Improvement: Add validation of test tags to CTS. (internal MR
        2924, internal issue 2050, internal issue 2062)
    -   Improvement: Make conformance layer initialization clear and
        consistent with other layers in the official OpenXR repos.
        (internal MR 2926)
    -   Improvement: Update Khronos registry URLs in comments. (internal
        MR 2935)
    -   Improvement: Add conformance test library API output value for
        Catch2 error conditions. (internal MR 2940, internal issue 2072,
        internal MR 2965, internal MR 2999)
    -   Improvement: Add OpenGL 3.3 functions to gfxwrapper, an internal
        utility library used by the CTS. (internal MR 2941)
    -   New test: Add additional tests for XR_EXT_debug_utils based on
        the test app loader_test. (internal MR 2861)
    -   New test: Check that no interaction profile is returned as
        current before calling xrSyncActions. (internal MR 2897,
        internal issue 1942)

GitOrigin-RevId: c43f8b8c0380df42fe71b98c3d5a53632eda0eb9
  • Loading branch information
rpavlik committed Oct 18, 2023
1 parent 6430ec6 commit f2789ff
Show file tree
Hide file tree
Showing 36 changed files with 446 additions and 105 deletions.
48 changes: 48 additions & 0 deletions CHANGELOG.CTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,54 @@ particular, since it is primarily software, pull requests may be integrated as
they are accepted even between periodic updates. However, versions that are not
signed tags on the `approved` branch are not valid for conformance submission.

## OpenXR CTS 1.0.30.0 (2023-10-12)

- Conformance Tests
- Fix: Replace early returns with `SKIP()`.
([internal MR 2898](https://gitlab.khronos.org/openxr/openxr/merge_requests/2898),
[OpenXR-CTS issue 60](https://github.com/KhronosGroup/OpenXR-CTS/issues/60),
[internal issue 2072](https://gitlab.khronos.org/openxr/openxr/issues/2072))
- Fix: Remove infinite loop in `Timed_Pipelined_Frame_Submission` in error case.
([internal MR 2915](https://gitlab.khronos.org/openxr/openxr/merge_requests/2915))
- Fix: Test failure count API
([internal MR 2940](https://gitlab.khronos.org/openxr/openxr/merge_requests/2940),
[internal issue 2072](https://gitlab.khronos.org/openxr/openxr/issues/2072),
[internal MR 2965](https://gitlab.khronos.org/openxr/openxr/merge_requests/2965),
[internal MR 2999](https://gitlab.khronos.org/openxr/openxr/merge_requests/2999))
- Fix: Fix waiting for `xrWaitSwapchainImage` timeout cases.
([internal MR 2944](https://gitlab.khronos.org/openxr/openxr/merge_requests/2944))
- Fix: Enable build with clang, clang-cl, and GCC (MinGW64) on Windows.
([internal MR 2948](https://gitlab.khronos.org/openxr/openxr/merge_requests/2948),
[internal MR 2975](https://gitlab.khronos.org/openxr/openxr/merge_requests/2975))
- Fix: Do not request hand tracking joint poses with an `XrTime` of 0: it is
invalid. Be sure to be in "FOCUSED" since we want input data.
([internal MR 2977](https://gitlab.khronos.org/openxr/openxr/merge_requests/2977))
- Improvement: Add validation of test tags to CTS.
([internal MR 2924](https://gitlab.khronos.org/openxr/openxr/merge_requests/2924),
[internal issue 2050](https://gitlab.khronos.org/openxr/openxr/issues/2050),
[internal issue 2062](https://gitlab.khronos.org/openxr/openxr/issues/2062))
- Improvement: Make conformance layer initialization clear and consistent with
other layers in the official OpenXR repos.
([internal MR 2926](https://gitlab.khronos.org/openxr/openxr/merge_requests/2926))
- Improvement: Update Khronos registry URLs in comments.
([internal MR 2935](https://gitlab.khronos.org/openxr/openxr/merge_requests/2935))
- Improvement: Add conformance test library API output value for Catch2 error
conditions.
([internal MR 2940](https://gitlab.khronos.org/openxr/openxr/merge_requests/2940),
[internal issue 2072](https://gitlab.khronos.org/openxr/openxr/issues/2072),
[internal MR 2965](https://gitlab.khronos.org/openxr/openxr/merge_requests/2965),
[internal MR 2999](https://gitlab.khronos.org/openxr/openxr/merge_requests/2999))
- Improvement: Add OpenGL 3.3 functions to gfxwrapper, an internal utility
library used by the CTS.
([internal MR 2941](https://gitlab.khronos.org/openxr/openxr/merge_requests/2941))
- New test: Add additional tests for `XR_EXT_debug_utils` based on the test app
`loader_test`.
([internal MR 2861](https://gitlab.khronos.org/openxr/openxr/merge_requests/2861))
- New test: Check that no interaction profile is returned as current before
calling `xrSyncActions`.
([internal MR 2897](https://gitlab.khronos.org/openxr/openxr/merge_requests/2897),
[internal issue 1942](https://gitlab.khronos.org/openxr/openxr/issues/1942))

## OpenXR CTS 1.0.29.0 (2023-09-07)

- Conformance Tests
Expand Down
4 changes: 0 additions & 4 deletions changes/conformance/mr.2861.gl.md

This file was deleted.

1 change: 0 additions & 1 deletion changes/conformance/mr.2935.gl.md

This file was deleted.

32 changes: 29 additions & 3 deletions specification/scripts/check_spec_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,20 @@
###
# "Configuration" constants

EXTRA_DEFINES = ('XRAPI_ATTR', 'XRAPI_CALL', 'XRAPI_PTR', 'XR_NO_STDINT_H')
FREEFORM_CATEGORY = 'freeform'
REFLINK_MACRO = 'reflink'

EXTRA_DEFINES = (
'XRAPI_ATTR',
'XRAPI_CALL',
'XRAPI_PTR',
'XR_NO_STDINT_H',
)

# TODO move permissions into XML eventually
EXTRA_REFPAGES = (
'org.khronos.openxr.permission.ext.HAND_TRACKING',
)

# These are marked with the code: macro
SYSTEM_TYPES = set(('void', 'char', 'float', 'size_t',
Expand Down Expand Up @@ -61,12 +74,17 @@ def populateMacros(self):
# TODO: What about flag wildcards? There are a few such uses...
self.addMacro('elink', ('enums', 'flags',), link=True)
self.addMacro('basetype', ('basetypes',), link=True)
self.addMacro(REFLINK_MACRO, (FREEFORM_CATEGORY,), link=True)


def populateEntities(self):
# These are not mentioned in the XML
for name in EXTRA_DEFINES:
self.addEntity(name, 'dlink', category='configdefines',
generates=False)
self.addEntity(name, 'dlink',
category=FREEFORM_CATEGORY, generates=False)
for name in EXTRA_REFPAGES:
self.addEntity(name, REFLINK_MACRO,
category=FREEFORM_CATEGORY, generates=False)

def handleType(self, name, info, requires):
"""Extend superclass implementation for OpenXR bitmasks."""
Expand Down Expand Up @@ -118,6 +136,14 @@ def processBlockOpen(self, block_type, context=None, delimiter=None):
super().processBlockOpen(block_type, context=context,
delimiter=delimiter)

def perform_entity_check(self, t):
"""Returns True if an entity check should be performed on this
refpage type.
May override."""

return t != FREEFORM_CATEGORY

@property
def allowEnumXrefs(self):
"""Returns True if enums can be specified in the 'xrefs' attribute
Expand Down
3 changes: 2 additions & 1 deletion specification/scripts/spec-macros/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ def text
# Generic reference page link to any entity with an anchor/refpage
class ReflinkInlineMacro < LinkInlineMacroBase
named :reflink
match /reflink:([-\w]+)/
# Permissions included periods in the middle, so we want to accept periods in the middle of names but not the end.
match /reflink:(([-\w]+[.])*[-\w]+)/
end

# Link to an extension appendix/refpage
Expand Down
19 changes: 13 additions & 6 deletions specification/scripts/spec_tools/macro_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,27 @@ def __init__(self, enabled_messages, entity_db,
# apiPrefix, followed by some word characters or * as many times as desired,
# NOT followed by >> and NOT preceded by one of the characters in that first character class.
# (which distinguish "names being used somewhere other than prose").
self.suspected_missing_macro_re = re.compile(
r'\b(?<![-=:/[\.`+,])(?P<entity_name>{}[\w*]+)\b(?!>>)'.format(
self.entity_db.case_insensitive_name_prefix_pattern)
self.suspected_missing_macro_re = re.compile( fr'''
\b(?<![-=:/[\.`+,]) # NOT preceded by one of these characters
(?P<entity_name>{self.entity_db.case_insensitive_name_prefix_pattern}[\w*]+) # Something that looks like our entity names
\b(?!>>) # NOT followed by >>
''', re.VERBOSE
)
self.heading_command_re = re.compile(
r'=+ (?P<command>{}[\w]+)'.format(self.entity_db.name_prefix)
fr'=+ (?P<command>{self.entity_db.name_prefix}[\w]+)'
)

macros_pattern = '|'.join((re.escape(macro)
for macro in self.entity_db.macros))
# the "formatting" group is to strip matching */**/_/__
# surrounding an entire macro.
self.macro_re = re.compile(
r'(?P<formatting>\**|_*)(?P<macro>{}):(?P<entity_name>[\w*]+((?P<subscript>[\[][^\]]*[\]]))?)(?P=formatting)'.format(macros_pattern))
self.macro_re = re.compile(fr'''
(?P<formatting>\**|_*) # opening formatting
(?P<macro>{macros_pattern}): # macro name and colon
(?P<entity_name>(([-\w]+[.])*)[-\w*]+(?P<subscript>\[([^\]]*)\])?)
(?P=formatting) # matching trailing formatting
''',
re.VERBOSE)

def haveLinkTarget(self, entity):
"""Report if we have parsed an API include (or heading) for an entity.
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ if(NOT MSVC)
endforeach()
if(APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
else()
elseif(NOT WIN32)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
endif()
endif()
Expand Down
34 changes: 33 additions & 1 deletion src/common/gfxwrapper_opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer;
PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
PFNGLVERTEXATTRIBDIVISORPROC glVertexAttribDivisor;
PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray;
PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray;
Expand Down Expand Up @@ -393,6 +394,21 @@ PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT;
PFNGLXDELAYBEFORESWAPNVPROC glXDelayBeforeSwapNV;
#endif

PFNGLBINDSAMPLERPROC glBindSampler;
PFNGLDELETESAMPLERSPROC glDeleteSamplers;
PFNGLGENSAMPLERSPROC glGenSamplers;
PFNGLGETSAMPLERPARAMETERIIVPROC glGetSamplerParameterIiv;
PFNGLGETSAMPLERPARAMETERIUIVPROC glGetSamplerParameterIuiv;
PFNGLGETSAMPLERPARAMETERFVPROC glGetSamplerParameterfv;
PFNGLGETSAMPLERPARAMETERIVPROC glGetSamplerParameteriv;
PFNGLISSAMPLERPROC glIsSampler;
PFNGLSAMPLERPARAMETERIIVPROC glSamplerParameterIiv;
PFNGLSAMPLERPARAMETERIUIVPROC glSamplerParameterIuiv;
PFNGLSAMPLERPARAMETERFPROC glSamplerParameterf;
PFNGLSAMPLERPARAMETERFVPROC glSamplerParameterfv;
PFNGLSAMPLERPARAMETERIPROC glSamplerParameteri;
PFNGLSAMPLERPARAMETERIVPROC glSamplerParameteriv;

void GlBootstrapExtensions() {
#if defined(OS_WINDOWS)
wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)GetExtension("wglChoosePixelFormatARB");
Expand Down Expand Up @@ -445,6 +461,7 @@ void GlInitExtensions() {
glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)GetExtension("glDeleteVertexArrays");
glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)GetExtension("glBindVertexArray");
glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)GetExtension("glVertexAttribPointer");
glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)GetExtension("glVertexAttribIPointer");
glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)GetExtension("glVertexAttribDivisor");
glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)GetExtension("glDisableVertexAttribArray");
glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)GetExtension("glEnableVertexAttribArray");
Expand Down Expand Up @@ -539,6 +556,21 @@ void GlInitExtensions() {
glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)GetExtension("glDebugMessageControl");
glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)GetExtension("glDebugMessageCallback");

glBindSampler = (PFNGLBINDSAMPLERPROC)GetExtension("glBindSampler");
glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)GetExtension("glDeleteSamplers");
glGenSamplers = (PFNGLGENSAMPLERSPROC)GetExtension("glGenSamplers");
glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)GetExtension("glGetSamplerParameterIiv");
glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)GetExtension("glGetSamplerParameterIuiv");
glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)GetExtension("glGetSamplerParameterfv");
glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)GetExtension("glGetSamplerParameteriv");
glIsSampler = (PFNGLISSAMPLERPROC)GetExtension("glIsSampler");
glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)GetExtension("glSamplerParameterIiv");
glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)GetExtension("glSamplerParameterIuiv");
glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)GetExtension("glSamplerParameterf");
glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)GetExtension("glSamplerParameterfv");
glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)GetExtension("glSamplerParameteri");
glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)GetExtension("glSamplerParameteriv");

glExtensions.timer_query = GlCheckExtension("GL_EXT_timer_query");
glExtensions.texture_clamp_to_border = true; // always available
glExtensions.buffer_storage =
Expand Down Expand Up @@ -1626,7 +1658,7 @@ void ksGpuContext_UnsetCurrent(ksGpuContext *context) {
#if defined(OS_WINDOWS)
wglMakeCurrent(context->hDC, NULL);
#elif defined(OS_LINUX_XLIB) || defined(OS_LINUX_XCB_GLX)
glXMakeCurrent(context->xDisplay, None, NULL);
glXMakeCurrent(context->xDisplay, /* None */ 0L, NULL);
#elif defined(OS_LINUX_XCB)
xcb_glx_make_current(context->connection, 0, 0, 0);
#elif defined(OS_APPLE_MACOS)
Expand Down
42 changes: 41 additions & 1 deletion src/common/gfxwrapper_opengl.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Platform headers / declarations
#define USE_SYNC_OBJECT 0 // 0 = GLsync, 1 = EGLSyncKHR, 2 = storage buffer

#if !defined(_XOPEN_SOURCE)
#if __STDC_VERSION__ >= 199901L
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
Expand All @@ -213,6 +213,18 @@ Platform headers / declarations
#include <X11/extensions/Xrandr.h> // for resolution changes
#include <GL/glx.h>

#ifdef Success
#undef Success
#endif // Success

#ifdef Always
#undef Always
#endif // Always

#ifdef None
#undef None
#endif // None

#elif defined(OS_LINUX_XCB) || defined(OS_LINUX_XCB_GLX)
#define XR_USE_PLATFORM_XCB 1

Expand All @@ -225,6 +237,18 @@ Platform headers / declarations
#include <xcb/dri2.h>
#include <GL/glx.h>

#ifdef Success
#undef Success
#endif // Success

#ifdef Always
#undef Always
#endif // Always

#ifdef None
#undef None
#endif // None

#elif defined(OS_LINUX_WAYLAND)
#define XR_USE_PLATFORM_WAYLAND 1

Expand Down Expand Up @@ -495,6 +519,7 @@ extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
extern PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer;
extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
extern PFNGLVERTEXATTRIBDIVISORPROC glVertexAttribDivisor;
extern PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray;
extern PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray;
Expand Down Expand Up @@ -597,6 +622,21 @@ extern PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT;
extern PFNGLXDELAYBEFORESWAPNVPROC glXDelayBeforeSwapNV;
#endif

extern PFNGLBINDSAMPLERPROC glBindSampler;
extern PFNGLDELETESAMPLERSPROC glDeleteSamplers;
extern PFNGLGENSAMPLERSPROC glGenSamplers;
extern PFNGLGETSAMPLERPARAMETERIIVPROC glGetSamplerParameterIiv;
extern PFNGLGETSAMPLERPARAMETERIUIVPROC glGetSamplerParameterIuiv;
extern PFNGLGETSAMPLERPARAMETERFVPROC glGetSamplerParameterfv;
extern PFNGLGETSAMPLERPARAMETERIVPROC glGetSamplerParameteriv;
extern PFNGLISSAMPLERPROC glIsSampler;
extern PFNGLSAMPLERPARAMETERIIVPROC glSamplerParameterIiv;
extern PFNGLSAMPLERPARAMETERIUIVPROC glSamplerParameterIuiv;
extern PFNGLSAMPLERPARAMETERFPROC glSamplerParameterf;
extern PFNGLSAMPLERPARAMETERFVPROC glSamplerParameterfv;
extern PFNGLSAMPLERPARAMETERIPROC glSamplerParameteri;
extern PFNGLSAMPLERPARAMETERIVPROC glSamplerParameteriv;

#elif defined(OS_APPLE_MACOS)

#ifdef GL_GLEXT_FUNCTION_POINTERS
Expand Down
7 changes: 4 additions & 3 deletions src/conformance/conformance_cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ int main(int argc, const char** argv)
launchSettings.argv = argv;
launchSettings.message = OnTestMessage;

uint32_t failureCount = 0;
XrcResult result = xrcRunConformanceTests(&launchSettings, &failureCount);
XrcTestResult testResult;
uint64_t failureCount = 0;
XrcResult result = xrcRunConformanceTests(&launchSettings, &testResult, &failureCount);
if (result != XRC_SUCCESS) {
return 2; // Tests failed to run.
}

xrcCleanup();

return failureCount == 0 ? 0 : 1;
return testResult == XRC_TEST_RESULT_SUCCESS ? 0 : 1;
}
30 changes: 19 additions & 11 deletions src/conformance/conformance_layer/Negotiate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

namespace
{
constexpr XrVersion LayerApiVersion = XR_CURRENT_API_VERSION;

XRAPI_ATTR XrResult XRAPI_CALL ConformanceLayer_RegisterInstance(const XrInstanceCreateInfo* createInfo,
const XrApiLayerCreateInfo* apiLayerInfo, XrInstance* instance)
{
Expand Down Expand Up @@ -67,32 +65,42 @@ namespace
#define LAYER_EXPORT
#endif

// Function used to negotiate an interface betewen the loader and an API layer. Each library exposing one or
// more API layers needs to expose at least this function.
extern "C" LAYER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrNegotiateLoaderApiLayerInterface(const XrNegotiateLoaderInfo* loaderInfo,
const char* /*apiLayerName*/,
XrNegotiateApiLayerRequest* apiLayerRequest)
{
if (loaderInfo->structType != XR_LOADER_INTERFACE_STRUCT_LOADER_INFO || loaderInfo->structVersion != XR_LOADER_INFO_STRUCT_VERSION ||
loaderInfo->structSize != sizeof(XrNegotiateLoaderInfo)) {
return XR_ERROR_INITIALIZATION_FAILED; // TODO: Log reason somehow.
if (loaderInfo == nullptr || loaderInfo->structType != XR_LOADER_INTERFACE_STRUCT_LOADER_INFO ||
loaderInfo->structVersion != XR_LOADER_INFO_STRUCT_VERSION || loaderInfo->structSize != sizeof(XrNegotiateLoaderInfo)) {
// TODO: Log reason somehow.
// LogPlatformUtilsError("loaderInfo struct is not valid");
return XR_ERROR_INITIALIZATION_FAILED;
}

if (loaderInfo->minInterfaceVersion > XR_CURRENT_LOADER_API_LAYER_VERSION ||
loaderInfo->maxInterfaceVersion < XR_CURRENT_LOADER_API_LAYER_VERSION) {
return XR_ERROR_INITIALIZATION_FAILED; // TODO: Log reason somehow.
// TODO: Log reason somehow.
// LogPlatformUtilsError("loader interface version is not in the range [minInterfaceVersion, maxInterfaceVersion]");
return XR_ERROR_INITIALIZATION_FAILED;
}

if (XR_CURRENT_API_VERSION > loaderInfo->maxApiVersion || XR_CURRENT_API_VERSION < loaderInfo->minApiVersion) {
return XR_ERROR_INITIALIZATION_FAILED; // TODO: Log reason somehow.
if (loaderInfo->minApiVersion > XR_CURRENT_API_VERSION || loaderInfo->maxApiVersion < XR_CURRENT_API_VERSION) {
// TODO: Log reason somehow.
// LogPlatformUtilsError("loader api version is not in the range [minApiVersion, maxApiVersion]");
return XR_ERROR_INITIALIZATION_FAILED;
}

if (apiLayerRequest->structType != XR_LOADER_INTERFACE_STRUCT_API_LAYER_REQUEST ||
if (apiLayerRequest == nullptr || apiLayerRequest->structType != XR_LOADER_INTERFACE_STRUCT_API_LAYER_REQUEST ||
apiLayerRequest->structVersion != XR_API_LAYER_INFO_STRUCT_VERSION ||
apiLayerRequest->structSize != sizeof(XrNegotiateApiLayerRequest)) {
return XR_ERROR_INITIALIZATION_FAILED; // TODO: Log reason somehow.
// TODO: Log reason somehow.
// LogPlatformUtilsError("apiLayerRequest is not valid");
return XR_ERROR_INITIALIZATION_FAILED;
}

apiLayerRequest->layerInterfaceVersion = XR_CURRENT_LOADER_API_LAYER_VERSION;
apiLayerRequest->layerApiVersion = LayerApiVersion;
apiLayerRequest->layerApiVersion = XR_CURRENT_API_VERSION;
apiLayerRequest->getInstanceProcAddr = ConformanceLayer_xrGetInstanceProcAddr;
apiLayerRequest->createApiLayerInstance = ConformanceLayer_RegisterInstance;

Expand Down
Loading

0 comments on commit f2789ff

Please sign in to comment.