Add quirk for FS2020

This commit is contained in:
Patrick Nicolas
2026-10-27 18:42:28 +01:00
parent 44c64ba866
commit 64ae13e293
3 changed files with 150 additions and 7 deletions
@@ -1,7 +1,7 @@
From 3033e3e9e4eb16693f21b12a00eacf60ea816b6b Mon Sep 17 00:00:00 2001
From cdd0a756a872e391f38b23ce73259497209c559b Mon Sep 17 00:00:00 2001
From: galister <85970-galister@users.noreply.gitlab.freedesktop.org>
Date: Fri, 18 Sep 2026 14:59:50 +0900
Subject: [PATCH 1/1] st/oxr: add XR_VALVE_frame_controller_interaction
Subject: [PATCH 11/13] st/oxr: add XR_VALVE_frame_controller_interaction
Signed-off-by: galister <85970-galister@users.noreply.gitlab.freedesktop.org>
---
@@ -17,10 +17,10 @@ Signed-off-by: galister <85970-galister@users.noreply.gitlab.freedesktop.org>
create mode 100644 src/external/openxr_includes/openxr/XR_VALVE_frame_controller_interaction.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4c06a042..7d3ae8b5e 100644
index 7f35c711d..f24211755 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -440,6 +440,7 @@ option(XRT_FEATURE_OPENXR_INTERACTION_CONTACTGLOVE2 "Enable XR_MND_contactglove2
@@ -444,6 +444,7 @@ option(XRT_FEATURE_OPENXR_INTERACTION_CONTACTGLOVE2 "Enable XR_MND_contactglove2
option(XRT_FEATURE_OPENXR_INTERACTION_VIVE_COSMOS "Enable XR_HTC_vive_cosmos_controller_interaction" ON)
option(XRT_FEATURE_OPENXR_INTERACTION_VIVE_FOCUS3 "Enable XR_HTC_vive_focus3_controller_interaction" ON)
option(XRT_FEATURE_OPENXR_INTERACTION_FB_PROXIMITY "Enable XR_FB_touch_controller_proximity" ON)
@@ -28,7 +28,7 @@ index c4c06a042..7d3ae8b5e 100644
option(XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PRO "Enable XR_FB_touch_controller_pro" ON)
option(XRT_FEATURE_OPENXR_INTERACTION_TOUCH_PLUS "Enable XR_META_touch_controller_plus" ON)
option(XRT_FEATURE_OPENXR_INTERACTION_LOGITECH_MX_INK "Enable XR_LOGITECH_mx_ink_stylus_interaction" OFF)
@@ -696,6 +697,7 @@ if(XRT_MODULE_OPENXR_STATE_TRACKER)
@@ -707,6 +708,7 @@ if(XRT_MODULE_OPENXR_STATE_TRACKER)
message(STATUS "# FEATURE_OPENXR_INTERACTION_EXT_EYE_GAZE: ${XRT_FEATURE_OPENXR_INTERACTION_EXT_EYE_GAZE}")
message(STATUS "# FEATURE_OPENXR_INTERACTION_EXT_HAND: ${XRT_FEATURE_OPENXR_INTERACTION_EXT_HAND}")
message(STATUS "# FEATURE_OPENXR_INTERACTION_EXT_PALM_POSE: ${XRT_FEATURE_OPENXR_INTERACTION_EXT_PALM_POSE}")
@@ -361,7 +361,7 @@ index 873b15b0a..81c547b90 100644
#cmakedefine XRT_FEATURE_OPENXR_INTERACTION_LOGITECH_MX_INK
#cmakedefine XRT_FEATURE_OPENXR_INTERACTION_ML2
diff --git a/src/xrt/include/xrt/xrt_defines.h b/src/xrt/include/xrt/xrt_defines.h
index a5c5bd65f..404f617c9 100644
index 996010e1a..3fa2bdd6a 100644
--- a/src/xrt/include/xrt/xrt_defines.h
+++ b/src/xrt/include/xrt/xrt_defines.h
@@ -832,6 +832,9 @@ enum xrt_device_name
@@ -455,5 +455,5 @@ index e9be594f9..12b54fec4 100644
['XR_EXTX_overlay', 'XRT_FEATURE_OPENXR_OVERLAY'],
['XR_HTCX_vive_tracker_interaction', 'ALWAYS_DISABLED'],
--
2.55.0
2.56.0
@@ -0,0 +1,111 @@
From 6b03fa953e4309e1dd7c011434a4147435bca803 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Mon, 26 Oct 2026 18:58:21 +0100
Subject: [PATCH 12/13] st/oxr: Add quirk to disable layerFlags validation
Signed-off-by: Patrick Nicolas <patricknicolas@laposte.net>
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/3063>
---
src/xrt/state_trackers/oxr/oxr_instance.c | 45 ++++++++++---------
src/xrt/state_trackers/oxr/oxr_objects.h | 7 +++
.../oxr/oxr_session_frame_end.c | 3 ++
3 files changed, 34 insertions(+), 21 deletions(-)
diff --git a/src/xrt/state_trackers/oxr/oxr_instance.c b/src/xrt/state_trackers/oxr/oxr_instance.c
index 82e4ed4f8..4ecf12770 100644
--- a/src/xrt/state_trackers/oxr/oxr_instance.c
+++ b/src/xrt/state_trackers/oxr/oxr_instance.c
@@ -209,6 +209,7 @@ apply_quirks(struct oxr_logger *log, struct oxr_instance *inst, const XrInstance
inst->quirks.parallel_views = false;
inst->quirks.no_texture_source_alpha = false;
inst->quirks.no_usage_bit_validation_in_create_swapchain = false;
+ inst->quirks.no_layer_flags_bit_validation = false;
if (starts_with("UnrealEngine", inst->appinfo.detected.engine.name) && //
inst->appinfo.detected.engine.major == 4 && //
@@ -426,27 +427,29 @@ oxr_instance_create(struct oxr_logger *log,
"\tquirks.skip_end_session: %s\n"
"\tquirks.parallel_views: %s\n"
"\tquirks.no_texture_source_alpha: %s\n"
- "\tquirks.ignore_invalid_swapchain_usage_bits: %s\n",
- createInfo->applicationInfo.applicationName, //
- createInfo->applicationInfo.applicationVersion, //
- createInfo->applicationInfo.engineName, //
- createInfo->applicationInfo.engineVersion, //
- XR_VERSION_MAJOR(createInfo->applicationInfo.apiVersion), //
- XR_VERSION_MINOR(createInfo->applicationInfo.apiVersion), //
- XR_VERSION_PATCH(createInfo->applicationInfo.apiVersion), //
- inst->appinfo.detected.engine.name, //
- inst->appinfo.detected.engine.major, //
- inst->appinfo.detected.engine.minor, //
- inst->appinfo.detected.engine.patch, //
- inst->quirks.disable_vulkan_format_depth ? "true" : "false", //
- inst->quirks.disable_vulkan_format_depth_stencil ? "true" : "false", //
- inst->quirks.disable_quad_views ? "true" : "false", //
- inst->quirks.no_validation_error_in_create_ref_space ? "true" : "false", //
- inst->quirks.skip_end_session ? "true" : "false", //
- inst->quirks.parallel_views ? "true" : "false", //
- inst->quirks.no_texture_source_alpha ? "true" : "false", //
- inst->quirks.no_usage_bit_validation_in_create_swapchain ? "true" : "false" //
- ); //
+ "\tquirks.ignore_invalid_swapchain_usage_bits: %s\n"
+ "\tquirks.ignore_invalid_layer_flags_bits: %s\n",
+ createInfo->applicationInfo.applicationName, //
+ createInfo->applicationInfo.applicationVersion, //
+ createInfo->applicationInfo.engineName, //
+ createInfo->applicationInfo.engineVersion, //
+ XR_VERSION_MAJOR(createInfo->applicationInfo.apiVersion), //
+ XR_VERSION_MINOR(createInfo->applicationInfo.apiVersion), //
+ XR_VERSION_PATCH(createInfo->applicationInfo.apiVersion), //
+ inst->appinfo.detected.engine.name, //
+ inst->appinfo.detected.engine.major, //
+ inst->appinfo.detected.engine.minor, //
+ inst->appinfo.detected.engine.patch, //
+ inst->quirks.disable_vulkan_format_depth ? "true" : "false", //
+ inst->quirks.disable_vulkan_format_depth_stencil ? "true" : "false", //
+ inst->quirks.disable_quad_views ? "true" : "false", //
+ inst->quirks.no_validation_error_in_create_ref_space ? "true" : "false", //
+ inst->quirks.skip_end_session ? "true" : "false", //
+ inst->quirks.parallel_views ? "true" : "false", //
+ inst->quirks.no_texture_source_alpha ? "true" : "false", //
+ inst->quirks.no_usage_bit_validation_in_create_swapchain ? "true" : "false", //
+ inst->quirks.no_layer_flags_bit_validation ? "true" : "false" //
+ ); //
#ifdef XRT_FEATURE_RENDERDOC
diff --git a/src/xrt/state_trackers/oxr/oxr_objects.h b/src/xrt/state_trackers/oxr/oxr_objects.h
index c8fbdadcd..0839b1606 100644
--- a/src/xrt/state_trackers/oxr/oxr_objects.h
+++ b/src/xrt/state_trackers/oxr/oxr_objects.h
@@ -1286,6 +1286,13 @@ struct oxr_instance
* calling xrCreateSwapchain.
*/
bool no_usage_bit_validation_in_create_swapchain;
+
+ /*!
+ * Don't return XR_ERROR_VALIDATION_FAILURE if an
+ * application sets unsupported flags in XrCompositionLayer
+ * when calling xrEndFrame.
+ */
+ bool no_layer_flags_bit_validation;
} quirks;
//! Debug messengers
diff --git a/src/xrt/state_trackers/oxr/oxr_session_frame_end.c b/src/xrt/state_trackers/oxr/oxr_session_frame_end.c
index 5bc5d81fb..fb6cf09f9 100644
--- a/src/xrt/state_trackers/oxr/oxr_session_frame_end.c
+++ b/src/xrt/state_trackers/oxr/oxr_session_frame_end.c
@@ -412,6 +412,9 @@ verify_layer_flags(struct oxr_logger *log,
uint32_t layer_index,
XrCompositionLayerFlags layerFlags)
{
+ if (sess->sys->inst->quirks.no_layer_flags_bit_validation) {
+ return XR_SUCCESS;
+ }
// Check if any invalid bits are set
if ((layerFlags & ~XR_COMPOSITION_LAYER_FLAGS_ALL_VALID) != 0) {
--
2.56.0
@@ -0,0 +1,32 @@
From 7f8d9723e09978fd13d588cedef4815e1a8c5674 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Mon, 26 Oct 2026 19:13:17 +0100
Subject: [PATCH 13/13] st/oxr: enable layer flags quirk for FS2020
Issue reported in https://github.com/WiVRn/WiVRn/issues/1193
Signed-off-by: Patrick Nicolas <patricknicolas@laposte.net>
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/3063>
---
src/xrt/state_trackers/oxr/oxr_instance.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/xrt/state_trackers/oxr/oxr_instance.c b/src/xrt/state_trackers/oxr/oxr_instance.c
index 4ecf12770..c2fcd5f25 100644
--- a/src/xrt/state_trackers/oxr/oxr_instance.c
+++ b/src/xrt/state_trackers/oxr/oxr_instance.c
@@ -228,6 +228,11 @@ apply_quirks(struct oxr_logger *log, struct oxr_instance *inst, const XrInstance
inst->quirks.no_usage_bit_validation_in_create_swapchain = true;
}
+ // Microsoft Flight Simulator 2020 writes garbage in layerFlags for xrEndFrame
+ if (strcmp("FS2020", create_info->applicationInfo.applicationName) == 0) {
+ inst->quirks.no_layer_flags_bit_validation = true;
+ }
+
// Currently always true.
inst->quirks.no_validation_error_in_create_ref_space = true;
--
2.56.0