st/oxr: Skip oxr_session_end if connected to Unreal 4.

This commit is contained in:
SJakab 2022-05-05 10:50:04 -05:00 committed by Korcan Hussein
parent 4709ab85ca
commit e4a40a6e4e
3 changed files with 12 additions and 6 deletions

View file

@ -167,15 +167,14 @@ detect_engine(struct oxr_logger *log, struct oxr_instance *inst, const XrInstanc
static void
apply_quirks(struct oxr_logger *log, struct oxr_instance *inst)
{
#if 0
// This is no longer needed.
inst->quirks.skip_end_session = false;
inst->quirks.disable_vulkan_format_depth_stencil = false;
if (starts_with("UnrealEngine", inst->appinfo.detected.engine.name) && //
inst->appinfo.detected.engine.major == 4 && //
inst->appinfo.detected.engine.minor <= 27 && //
inst->appinfo.detected.engine.patch <= 0) {
inst->quirks.disable_vulkan_format_depth_stencil = true;
inst->appinfo.detected.engine.minor <= 27) {
inst->quirks.skip_end_session = true;
}
#endif
}
XrResult

View file

@ -1509,6 +1509,8 @@ struct oxr_instance
{
//! Unreal has a bug in the VulkanRHI backend.
bool disable_vulkan_format_depth_stencil;
//! Unreal 4 has a bug calling xrEndSession; the function should just exit
bool skip_end_session;
} quirks;
//! Debug messengers

View file

@ -164,6 +164,11 @@ oxr_session_begin(struct oxr_logger *log, struct oxr_session *sess, const XrSess
XrResult
oxr_session_end(struct oxr_logger *log, struct oxr_session *sess)
{
// there is a bug in Unreal 4 where calling this function will result in a crash, so skip it.
if (sess->sys->inst->quirks.skip_end_session) {
return XR_SUCCESS;
}
struct xrt_compositor *xc = sess->compositor;
if (!is_running(sess)) {