diff --git a/src/xrt/state_trackers/oxr/oxr_instance.c b/src/xrt/state_trackers/oxr/oxr_instance.c index 247b8ad0c..5c2e84108 100644 --- a/src/xrt/state_trackers/oxr/oxr_instance.c +++ b/src/xrt/state_trackers/oxr/oxr_instance.c @@ -199,6 +199,7 @@ apply_quirks(struct oxr_logger *log, struct oxr_instance *inst) { // Reset. inst->quirks.skip_end_session = false; + inst->quirks.disable_vulkan_format_depth = false; inst->quirks.disable_vulkan_format_depth_stencil = false; inst->quirks.no_validation_error_in_create_ref_space = false; @@ -442,6 +443,7 @@ oxr_instance_create(struct oxr_logger *log, "\tcreateInfo->applicationInfo.apiVersion: %d.%d.%d\n" "\tappinfo.detected.engine.name: %s\n" "\tappinfo.detected.engine.version: %i.%i.%i\n" + "\tquirks.disable_vulkan_format_depth: %s\n" "\tquirks.disable_vulkan_format_depth_stencil: %s\n" "\tquirks.no_validation_error_in_create_ref_space: %s\n" "\tquirks.skip_end_session: %s\n" @@ -457,6 +459,7 @@ oxr_instance_create(struct oxr_logger *log, 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.no_validation_error_in_create_ref_space ? "true" : "false", // inst->quirks.skip_end_session ? "true" : "false", // diff --git a/src/xrt/state_trackers/oxr/oxr_objects.h b/src/xrt/state_trackers/oxr/oxr_objects.h index 4649a7e5b..5b4aed373 100644 --- a/src/xrt/state_trackers/oxr/oxr_objects.h +++ b/src/xrt/state_trackers/oxr/oxr_objects.h @@ -1754,8 +1754,27 @@ struct oxr_instance struct { - //! Unreal has a bug in the VulkanRHI backend. + /*! + * Some applications can't handle depth formats, or they trigger + * a bug in a specific version of the application or engine. + * This flag only disables depth formats + * @see disable_vulkan_format_depth_stencil for depth-stencil formats. + */ + bool disable_vulkan_format_depth; + + /*! + * Some applications can't handle depth stencil formats, or they + * trigger a bug in a specific version of the application or + * engine. + * + * This flag only disables depth-stencil formats, + * @see disable_vulkan_format_depth flag for depth only formats. + * + * In the past it was used to work around a bug in Unreal's + * VulkanRHI backend. + */ bool disable_vulkan_format_depth_stencil; + //! Unreal 4 has a bug calling xrEndSession; the function should just exit bool skip_end_session; diff --git a/src/xrt/state_trackers/oxr/oxr_session.c b/src/xrt/state_trackers/oxr/oxr_session.c index d53e9d8ae..998b02fc1 100644 --- a/src/xrt/state_trackers/oxr/oxr_session.c +++ b/src/xrt/state_trackers/oxr/oxr_session.c @@ -70,7 +70,7 @@ should_skip_format_vk_1_and_2(const struct oxr_instance *inst, uint64_t format) { bool skip_depth_stencil = inst->quirks.disable_vulkan_format_depth_stencil; bool skip_stencil = false; - bool skip_depth = false; + bool skip_depth = inst->quirks.disable_vulkan_format_depth; // Access to Vulkan headers are not guaranteed. switch (format) {