[Bf-blender-cvs] [fe7b01a08fd] soc-2019-openxr: Correctly request session end according to OpenXR 1.0 specification
Julian Eisel
noreply at git.blender.org
Wed Aug 7 22:21:01 CEST 2019
Commit: fe7b01a08fdf20757f5740735ec16717e4d6fd20
Author: Julian Eisel
Date: Wed Aug 7 22:13:35 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rBfe7b01a08fdf20757f5740735ec16717e4d6fd20
Correctly request session end according to OpenXR 1.0 specification
===================================================================
M intern/ghost/intern/GHOST_XrContext.cpp
M intern/ghost/intern/GHOST_XrSession.cpp
M intern/ghost/intern/GHOST_XrSession.h
===================================================================
diff --git a/intern/ghost/intern/GHOST_XrContext.cpp b/intern/ghost/intern/GHOST_XrContext.cpp
index 07ed037fb5b..8edbd625f3a 100644
--- a/intern/ghost/intern/GHOST_XrContext.cpp
+++ b/intern/ghost/intern/GHOST_XrContext.cpp
@@ -452,8 +452,7 @@ void GHOST_XrContext::startSession(const GHOST_XrSessionBeginInfo *begin_info)
}
void GHOST_XrContext::endSession()
{
- m_session->end();
- m_session = nullptr;
+ m_session->requestEnd();
}
bool GHOST_XrContext::isSessionRunning() const
diff --git a/intern/ghost/intern/GHOST_XrSession.cpp b/intern/ghost/intern/GHOST_XrSession.cpp
index f2f01a9b354..a3772348569 100644
--- a/intern/ghost/intern/GHOST_XrSession.cpp
+++ b/intern/ghost/intern/GHOST_XrSession.cpp
@@ -181,6 +181,11 @@ void GHOST_XrSession::start(const GHOST_XrSessionBeginInfo *begin_info)
create_reference_space(m_oxr.get(), &begin_info->base_pose);
}
+void GHOST_XrSession::requestEnd()
+{
+ xrRequestExitSession(m_oxr->session);
+}
+
void GHOST_XrSession::end()
{
assert(m_oxr->session != XR_NULL_HANDLE);
diff --git a/intern/ghost/intern/GHOST_XrSession.h b/intern/ghost/intern/GHOST_XrSession.h
index 7b75bdbae56..1d75b0030a3 100644
--- a/intern/ghost/intern/GHOST_XrSession.h
+++ b/intern/ghost/intern/GHOST_XrSession.h
@@ -35,7 +35,7 @@ class GHOST_XrSession {
~GHOST_XrSession();
void start(const GHOST_XrSessionBeginInfo *begin_info);
- void end();
+ void requestEnd();
eLifeExpectancy handleStateChangeEvent(const struct XrEventDataSessionStateChanged *lifecycle);
@@ -60,6 +60,7 @@ class GHOST_XrSession {
std::unique_ptr<struct GHOST_XrDrawInfo> m_draw_info;
void initSystem();
+ void end();
void bindGraphicsContext();
More information about the Bf-blender-cvs
mailing list