Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync latest fixes in XrUtility and samples, and normalize file-end linebreaks. #128

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,3 @@ ASALocalRun/
# MFractors (Xamarin productivity tool) working folder
.mfractor/


4 changes: 2 additions & 2 deletions openxr_preview/include/openxr_preview/openxr_msft_preview.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
// clang-format off

// Supports XrStructTraits and ValidateStruct
#define XR_LIST_STRUCTURE_TYPES_MSFT_PREVIEW(_)
#define XR_LIST_STRUCTURE_TYPES_MSFT_PREVIEW(_)

// Supports IXrExtensionConfiguration.EnabledExtensions()
#define XR_LIST_EXTENSIONS_MSFT_PREVIEW(_)

// Supports xrStructureTypeToString and IsKnownStructType
#define XR_LIST_ENUM_XrStructureType_MSFT_PREVIEW(_)
#define XR_LIST_ENUM_XrStructureType_MSFT_PREVIEW(_)

// Supports XrDispatchTable.h
#define XR_LIST_FUNCTIONS_MSFT_PREVIEW(_)
Expand Down
105,457 changes: 105,457 additions & 0 deletions openxr_preview/openxr.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions samples/BasicXrApp/BasicXrApp_uwp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<!-- PREfast builds only compile code, not link them. Set the uwp projects to static lib to skip package generation problems. -->
<ConfigurationType Condition="'$(LinkCompiled)'!='false'">Application</ConfigurationType>
<ConfigurationType Condition="'$(LinkCompiled)'=='false'">StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
Expand Down Expand Up @@ -173,4 +173,4 @@
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props'))" />
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets'))" />
</Target>
</Project>
</Project>
4 changes: 2 additions & 2 deletions samples/BasicXrApp/BasicXrApp_win32.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Expand Down Expand Up @@ -124,4 +124,4 @@
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props'))" />
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets'))" />
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion samples/BasicXrApp/CubeGraphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ namespace {
const std::vector<const sample::Cube*>& cubes) override {
const uint32_t viewInstanceCount = (uint32_t)viewProjections.size();
CHECK_MSG(viewInstanceCount <= CubeShader::MaxViewInstance,
"Sample shader supports 2 or fewer view instances. Adjust shader to accommodate more.")
"Sample shader supports 2 or fewer view instances. Adjust shader to accommodate more.");

CD3D11_VIEWPORT viewport(
(float)imageRect.offset.x, (float)imageRect.offset.y, (float)imageRect.extent.width, (float)imageRect.extent.height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props'))" />
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets'))" />
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion samples/SampleSceneUwp/SampleSceneUwp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props'))" />
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets'))" />
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion samples/SampleSceneWin32/SampleSceneWin32.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props'))" />
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets'))" />
</Target>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>
</Project>
1 change: 0 additions & 1 deletion samples/SceneUnderstandingUwp/Scene_QRCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,4 +475,3 @@ namespace {
std::unique_ptr<engine::Scene> TryCreateQRCodeScene(engine::Context& context) {
return context.Extensions.XR_MSFT_scene_marker_enabled ? std::make_unique<QRCodeScene>(context) : nullptr;
}

2 changes: 1 addition & 1 deletion samples/ThreeSpacesUwp/ThreeSpacesUwp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.props'))" />
<Error Condition="!Exists('..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets'))" />
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion shared/SampleShared/SampleShared_uwp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -398,4 +398,4 @@
<Error Condition="!Exists('..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props'))" />
<Error Condition="!Exists('..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets'))" />
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion shared/SampleShared/SampleShared_win32.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,4 @@
<Error Condition="!Exists('..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props'))" />
<Error Condition="!Exists('..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets'))" />
</Target>
</Project>
</Project>
8 changes: 4 additions & 4 deletions shared/SampleShared/XrSessionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ namespace sample {

// note: all runtimes must support VIEW and LOCAL reference spaces.
std::vector<XrReferenceSpaceType> SupportedReferenceSpaces;
bool SupportsStageSpace;
bool XR_MSFT_unbounded_reference_space_enabled;
bool SupportsStageSpace{};
bool SupportsUnboundedSpace{};

explicit SessionContext(xr::SessionHandle sessionHandle,
const sample::SystemContext& system,
Expand Down Expand Up @@ -53,8 +53,8 @@ namespace sample {
assert(xr::Contains(SupportedReferenceSpaces, XR_REFERENCE_SPACE_TYPE_VIEW));
assert(xr::Contains(SupportedReferenceSpaces, XR_REFERENCE_SPACE_TYPE_LOCAL));
SupportsStageSpace = xr::Contains(SupportedReferenceSpaces, XR_REFERENCE_SPACE_TYPE_STAGE);
XR_MSFT_unbounded_reference_space_enabled =
extensions.XR_MSFT_unbounded_reference_space_enabled&& xr::Contains(SupportedReferenceSpaces, XR_REFERENCE_SPACE_TYPE_UNBOUNDED_MSFT);
SupportsUnboundedSpace = extensions.XR_MSFT_unbounded_reference_space_enabled &&
xr::Contains(SupportedReferenceSpaces, XR_REFERENCE_SPACE_TYPE_UNBOUNDED_MSFT);
}

private:
Expand Down
1 change: 0 additions & 1 deletion shared/XrSceneLib/CompositionLayers.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ namespace engine {
std::vector<XrCompositionLayerBaseHeader const*> m_compositionLayers;
};
} // namespace engine

1 change: 0 additions & 1 deletion shared/XrSceneLib/ProjectionLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,3 @@ void engine::AppendProjectionLayer(CompositionLayers& layers, ProjectionLayer* l
}

}

1 change: 0 additions & 1 deletion shared/XrSceneLib/ProjectionLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,3 @@ namespace engine {
std::vector<std::unique_ptr<ProjectionLayer>> m_projectionLayers;
};
} // namespace engine

1 change: 0 additions & 1 deletion shared/XrSceneLib/QuadLayerObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ void engine::AppendQuadLayer(engine::CompositionLayers& layers, engine::QuadLaye

xr::math::StoreXrExtent(&quadLayer.size, scale); // Use x and y but ignore z.
};

1 change: 0 additions & 1 deletion shared/XrSceneLib/XrApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,4 +692,3 @@ namespace engine {
return std::make_unique<ImplementXrApp>(std::move(appConfiguration));
}
} // namespace engine

1 change: 0 additions & 1 deletion shared/XrSceneLib/XrApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ namespace engine {

std::unique_ptr<XrApp> CreateXrApp(XrAppConfiguration appConfiguration);
} // namespace engine

2 changes: 1 addition & 1 deletion shared/XrSceneLib/XrSceneLib_uwp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@
<Error Condition="!Exists('..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props'))" />
<Error Condition="!Exists('..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets'))" />
</Target>
</Project>
</Project>
1 change: 0 additions & 1 deletion shared/XrSceneLib/XrSceneLib_uwp.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,3 @@
<None Include="$(OpenXRLoaderBinaryRoot)\bin\openxr_loader.dll" />
</ItemGroup>
</Project>

2 changes: 1 addition & 1 deletion shared/XrSceneLib/XrSceneLib_win32.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@
<Error Condition="!Exists('..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props'))" />
<Error Condition="!Exists('..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets'))" />
</Target>
</Project>
</Project>
1 change: 0 additions & 1 deletion shared/XrUtility/XrDispatchTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ namespace xr {
#undef XR_DISPATCH_TABLE_NO_OP
// clang-format on
#endif // ENABLE_GLOBAL_XR_DISPATCH_TABLE

1 change: 0 additions & 1 deletion shared/XrUtility/XrEnabledExtensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,3 @@ namespace xr {
};

} // namespace xr

22 changes: 20 additions & 2 deletions shared/XrUtility/XrEnumerate.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

#pragma once

#include "XrError.h"

#include <openxr/openxr.h>
#include <vector>

#include <algorithm>
#include <set>
#include "XrError.h"
#include <vector>

namespace xr {
template <typename TArray, typename TValue>
Expand Down Expand Up @@ -52,9 +55,24 @@ namespace xr {

std::vector<XrViewConfigurationType> viewConfigs(viewConfigurationCount);
CHECK_XRCMD(xrEnumerateViewConfigurations(instance, systemId, viewConfigurationCount, &viewConfigurationCount, viewConfigs.data()));

return viewConfigs;
}

// Pick the first supported XrViewConfigurationType from runtime's supported list.
inline XrViewConfigurationType PickViewConfiguration(const std::vector<XrViewConfigurationType>& systemSupportedViewConfigs,
const std::vector<XrViewConfigurationType>& appSupportedViewConfigs) {
auto viewConfigIt = std::find_first_of(systemSupportedViewConfigs.begin(),
systemSupportedViewConfigs.end(),
appSupportedViewConfigs.begin(),
appSupportedViewConfigs.end());
if (viewConfigIt == std::end(systemSupportedViewConfigs)) {
throw std::runtime_error("No view configs supported");
}

return *viewConfigIt;
}

inline std::vector<XrViewConfigurationView> EnumerateViewConfigurationViews(XrInstance instance,
XrSystemId systemId,
XrViewConfigurationType viewConfigurationType) {
Expand Down
25 changes: 13 additions & 12 deletions shared/XrUtility/XrError.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@
#include <android/log.h>
#endif

#define THROW(msg) xr::detail::_Throw(msg, nullptr, FILE_AND_LINE)
#define CHECK(exp) xr::detail::_Check((exp), "Check failed", #exp, FILE_AND_LINE)
#define CHECK_MSG(exp, msg) xr::detail::_Check((exp), msg, #exp, FILE_AND_LINE)

#define THROW_XRRESULT(res, cmdStr) xr::detail::_ThrowXrResult(res, cmdStr, FILE_AND_LINE)
#define CHECK_XRCMD(cmd) xr::detail::_CheckXrResult(cmd, #cmd, FILE_AND_LINE)
#define CHECK_XRRESULT(res, cmdStr) xr::detail::_CheckXrResult(res, cmdStr, FILE_AND_LINE)

#define CHECK_XRCMD_PRINT(cmd) xr::detail::_CheckXrResultPrint(cmd, #cmd, FILE_AND_LINE)

#define THROW_HRESULT(res, cmdStr) xr::detail::_ThrowHResult(res, cmdStr, FILE_AND_LINE)
#define CHECK_HRCMD(cmd) xr::detail::_CheckHResult(cmd, #cmd, FILE_AND_LINE)
#define CHECK_HRESULT(res, cmdStr) xr::detail::_CheckHResult(res, cmdStr, FILE_AND_LINE)

Expand Down Expand Up @@ -76,18 +82,13 @@ namespace xr::detail {
#endif
}

#define THROW(msg) xr::detail::_Throw(msg, nullptr, FILE_AND_LINE)
#define CHECK(exp) \
{ \
if (!(exp)) { \
xr::detail::_Throw("Check failed", #exp, FILE_AND_LINE); \
} \
}
#define CHECK_MSG(exp, msg) \
{ \
if (!(exp)) { \
xr::detail::_Throw(msg, #exp, FILE_AND_LINE); \
} \
template <typename T>
inline T&& _Check(T&& res, const char* failureMessage, const char* originator = nullptr, const char* sourceLocation = nullptr) {
if (!res) {
xr::detail::_Throw(failureMessage, originator, sourceLocation);
}

return std::forward<T>(res);
}

[[noreturn]] inline void _ThrowXrResult(XrResult res, const char* originator = nullptr, const char* sourceLocation = nullptr) {
Expand Down
6 changes: 6 additions & 0 deletions shared/XrUtility/XrExtensionDefined.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
#define XR_KHR_D3D12_enable_DEFINED(_, defined, undefined) _(undefined)
#endif

#ifdef XR_KHR_vulkan_enable2
#define XR_KHR_vulkan_enable2_DEFINED(_, defined, undefined) _(defined)
#else
#define XR_KHR_vulkan_enable2_DEFINED(_, defined, undefined) _(undefined)
#endif

#ifdef XR_KHR_visibility_mask
#define XR_KHR_visibility_mask_DEFINED(_, defined, undefined) _(defined)
#else
Expand Down
1 change: 1 addition & 0 deletions shared/XrUtility/XrHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@ namespace xr {
class SwapchainHandle : public UniqueXrHandle<XrSwapchain> {};
class SpatialAnchorHandle : public UniqueXrHandle<XrSpatialAnchorMSFT> {};
class HandTrackerHandle : public UniqueXrHandle<XrHandTrackerEXT> {};
class FoveationProfileHandle : public UniqueXrHandle<XrFoveationProfileFB> {};

} // namespace xr
8 changes: 8 additions & 0 deletions shared/XrUtility/XrListFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@

#define XR_LIST_FUNCTIONS_XR_KHR_D3D11_enable(_) _(xrGetD3D11GraphicsRequirementsKHR)
#define XR_LIST_FUNCTIONS_XR_KHR_D3D12_enable(_) _(xrGetD3D12GraphicsRequirementsKHR)

#define XR_LIST_FUNCTIONS_XR_KHR_vulkan_enable2(_) \
_(xrCreateVulkanInstanceKHR) \
_(xrCreateVulkanDeviceKHR) \
_(xrGetVulkanGraphicsDevice2KHR) \
_(xrGetVulkanGraphicsRequirements2KHR)

#define XR_LIST_FUNCTIONS_XR_KHR_visibility_mask(_) _(xrGetVisibilityMaskKHR)

#define XR_LIST_FUNCTIONS_XR_MSFT_controller_model(_) \
Expand Down Expand Up @@ -188,6 +195,7 @@
XR_KHR_convert_timespec_time_DEFINED(XR_LIST_FUNCTIONS_XR_KHR_convert_timespec_time, _, __) \
XR_KHR_D3D11_enable_DEFINED(XR_LIST_FUNCTIONS_XR_KHR_D3D11_enable, _, __) \
XR_KHR_D3D12_enable_DEFINED(XR_LIST_FUNCTIONS_XR_KHR_D3D12_enable, _, __) \
XR_KHR_vulkan_enable2_DEFINED(XR_LIST_FUNCTIONS_XR_KHR_vulkan_enable2, _, __) \
XR_KHR_visibility_mask_DEFINED(XR_LIST_FUNCTIONS_XR_KHR_visibility_mask, _, __) \
XR_MSFT_controller_model_DEFINED(XR_LIST_FUNCTIONS_XR_MSFT_controller_model, _, __) \
XR_MSFT_spatial_anchor_DEFINED(XR_LIST_FUNCTIONS_XR_MSFT_spatial_anchor, _, __) \
Expand Down
12 changes: 8 additions & 4 deletions shared/XrUtility/XrString.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@
namespace xr {

inline XrPath StringToPath(XrInstance instance, const char* str) {
XrPath path;
XrPath path = XR_NULL_PATH;
CHECK_XRCMD(xrStringToPath(instance, str, &path));
return path;
}

inline std::string PathToString(XrInstance instance, XrPath path) {
uint32_t count;
uint32_t count = 0;
CHECK_XRCMD(xrPathToString(instance, path, 0, &count, nullptr));
std::string string;
string.resize(count - 1); // OpenXR size includes '\0', std::string::size doesn't.
CHECK_XRCMD(xrPathToString(instance, path, count, &count, string.data()));

if (count > 0) {
string.resize(count - 1); // OpenXR size includes '\0', std::string::size doesn't.
CHECK_XRCMD(xrPathToString(instance, path, count, &count, string.data()));
}

return string;
}

Expand Down
1 change: 0 additions & 1 deletion shared/XrUtility/XrStructTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ namespace msxr {
XR_LIST_STRUCTURE_TYPES(DECLARE_XR_STRUCT_TRAITS)
XR_LIST_STRUCTURE_TYPES_MSFT_PREVIEW(DECLARE_XR_STRUCT_TRAITS)
} // namespace msxr

2 changes: 1 addition & 1 deletion shared/gltf/Gltf_uwp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion shared/gltf/Gltf_win32.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion shared/pbr/pbr_uwp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -412,4 +412,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion shared/pbr/pbr_win32.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -393,4 +393,4 @@
</Target>
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>