-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
## [1.12.0-exp.1] - 2024-06-28 ### Fixed * Fixed Custom Composition Layer Feature not showing up in the OpenXR feature setting UI after importing into project. * Fixed a crash with composition layers in scene due to race condition. ### Changed * Implements the construction and maintenance of native composition layers in C# via our LayerProvider classes inheriting from OpenXRCustomLayerHandler.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"DefineConstants": "XR_COMPOSITION_LAYERS" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"hideGlobalNamespace": false, | ||
"_noIndex": false, | ||
"useMemberPages": false, | ||
"showScriptRef": true, | ||
"pmdt-additional-preprocessors": "XR_COMPOSITION_LAYERS" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#include "mock_khr_android_thread_settings.h" | ||
|
||
#ifdef XR_USE_PLATFORM_ANDROID | ||
|
||
#define CHECK_EXT_INIT() \ | ||
if (nullptr == MockAndroidThreadSettings::Instance()) \ | ||
return XR_ERROR_FUNCTION_UNSUPPORTED; | ||
|
||
std::unique_ptr<MockAndroidThreadSettings> MockAndroidThreadSettings::s_Instance; | ||
|
||
MockAndroidThreadSettings* MockAndroidThreadSettings::Instance() | ||
{ | ||
return s_Instance.get(); | ||
} | ||
|
||
void MockAndroidThreadSettings::Init(MockRuntime& runtime) | ||
{ | ||
s_Instance.reset(new MockAndroidThreadSettings(runtime)); | ||
} | ||
|
||
void MockAndroidThreadSettings::Deinit() | ||
{ | ||
s_Instance.reset(); | ||
} | ||
|
||
MockAndroidThreadSettings::MockAndroidThreadSettings(MockRuntime& runtime) | ||
: m_Runtime{runtime} | ||
{ | ||
} | ||
|
||
XrResult MockAndroidThreadSettings::SetAndroidApplicationThread(XrAndroidThreadTypeKHR threadType, uint32_t threadId) | ||
{ | ||
m_AssignedThreadTypes[threadId] = threadType; | ||
return XR_SUCCESS; | ||
} | ||
|
||
bool MockAndroidThreadSettings::IsAndroidThreadTypeRegistered(XrAndroidThreadTypeKHR threadType) const | ||
{ | ||
for (auto i = m_AssignedThreadTypes.cbegin(); i != m_AssignedThreadTypes.cend(); ++i) | ||
{ | ||
if (i->second == threadType) | ||
{ | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
uint32_t MockAndroidThreadSettings::GetRegisteredAndroidThreadsCount() const | ||
{ | ||
return m_AssignedThreadTypes.size(); | ||
} | ||
|
||
extern "C" XrResult UNITY_INTERFACE_EXPORT XRAPI_PTR | ||
xrSetAndroidApplicationThreadKHR( | ||
XrSession session, | ||
XrAndroidThreadTypeKHR threadType, | ||
uint32_t threadId) | ||
{ | ||
LOG_FUNC(); | ||
CHECK_SESSION(session); | ||
CHECK_EXT_INIT(); | ||
MOCK_HOOK_BEFORE(); | ||
|
||
const XrResult result = | ||
MockAndroidThreadSettings::Instance()->SetAndroidApplicationThread( | ||
threadType, | ||
threadId); | ||
|
||
MOCK_HOOK_AFTER(result); | ||
|
||
return result; | ||
} | ||
|
||
XrResult MockAndroidThreadSettings_GetInstanceProcAddr(const char* name, PFN_xrVoidFunction* function) | ||
{ | ||
GET_PROC_ADDRESS(xrSetAndroidApplicationThreadKHR) | ||
return XR_ERROR_FEATURE_UNSUPPORTED; | ||
} | ||
|
||
#undef CHECK_EXT_INIT | ||
#endif // XR_USE_PLATFORM_ANDROID |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include "../mock.h" | ||
#include <map> | ||
#include <memory> | ||
|
||
#ifdef XR_USE_PLATFORM_ANDROID | ||
class MockAndroidThreadSettings | ||
{ | ||
public: | ||
static MockAndroidThreadSettings* Instance(); | ||
static void Init(MockRuntime& runtime); | ||
static void Deinit(); | ||
|
||
MockAndroidThreadSettings(MockRuntime& runtime); | ||
|
||
XrResult SetAndroidApplicationThread(XrAndroidThreadTypeKHR threadType, uint32_t threadId); | ||
bool IsAndroidThreadTypeRegistered(XrAndroidThreadTypeKHR threadType) const; | ||
uint32_t GetRegisteredAndroidThreadsCount() const; | ||
|
||
private: | ||
static std::unique_ptr<MockAndroidThreadSettings> s_Instance; | ||
|
||
MockRuntime& m_Runtime; | ||
std::map<uint32_t, XrAndroidThreadTypeKHR> m_AssignedThreadTypes{}; | ||
}; | ||
|
||
XrResult MockAndroidThreadSettings_GetInstanceProcAddr(const char* name, PFN_xrVoidFunction* function); | ||
#endif |